inpcom.c, get_subckts_for_subckt(), reduce scope of local variables
This commit is contained in:
parent
e2dabb2e75
commit
a8d90775ca
|
|
@ -1615,9 +1615,9 @@ get_subckts_for_subckt(struct line *start_card, char *subckt_name,
|
||||||
bool has_models)
|
bool has_models)
|
||||||
{
|
{
|
||||||
struct line *card;
|
struct line *card;
|
||||||
char *curr_subckt_name, *inst_subckt_name, *model_name, *new_names[100];
|
char *new_names[100];
|
||||||
bool found_subckt = FALSE, have_subckt = FALSE, found_model = FALSE;
|
bool found_subckt = FALSE;
|
||||||
int i, num_terminals = 0, tmp_cnt = 0;
|
int i, tmp_cnt = 0;
|
||||||
|
|
||||||
for (card = start_card; card; card = card->li_next) {
|
for (card = start_card; card; card = card->li_next) {
|
||||||
|
|
||||||
|
|
@ -1630,7 +1630,7 @@ get_subckts_for_subckt(struct line *start_card, char *subckt_name,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (ciprefix(".subckt", line) || ciprefix(".macro", line)) {
|
if (ciprefix(".subckt", line) || ciprefix(".macro", line)) {
|
||||||
curr_subckt_name = get_subckt_model_name(line);
|
char *curr_subckt_name = get_subckt_model_name(line);
|
||||||
|
|
||||||
if (strcmp(curr_subckt_name, subckt_name) == 0)
|
if (strcmp(curr_subckt_name, subckt_name) == 0)
|
||||||
found_subckt = TRUE;
|
found_subckt = TRUE;
|
||||||
|
|
@ -1640,8 +1640,8 @@ get_subckts_for_subckt(struct line *start_card, char *subckt_name,
|
||||||
|
|
||||||
if (found_subckt) {
|
if (found_subckt) {
|
||||||
if (*line == 'x') {
|
if (*line == 'x') {
|
||||||
inst_subckt_name = get_instance_subckt(line);
|
char *inst_subckt_name = get_instance_subckt(line);
|
||||||
have_subckt = FALSE;
|
bool have_subckt = FALSE;
|
||||||
for (i = 0; i < *num_used_subckt_names; i++)
|
for (i = 0; i < *num_used_subckt_names; i++)
|
||||||
if (strcmp(used_subckt_names[i], inst_subckt_name) == 0)
|
if (strcmp(used_subckt_names[i], inst_subckt_name) == 0)
|
||||||
have_subckt = TRUE;
|
have_subckt = TRUE;
|
||||||
|
|
@ -1652,8 +1652,8 @@ get_subckts_for_subckt(struct line *start_card, char *subckt_name,
|
||||||
tfree(inst_subckt_name);
|
tfree(inst_subckt_name);
|
||||||
}
|
}
|
||||||
} else if (*line == 'a') {
|
} else if (*line == 'a') {
|
||||||
model_name = get_adevice_model_name(line);
|
char *model_name = get_adevice_model_name(line);
|
||||||
found_model = FALSE;
|
bool found_model = FALSE;
|
||||||
for (i = 0; i < *num_used_model_names; i++)
|
for (i = 0; i < *num_used_model_names; i++)
|
||||||
if (strcmp(used_model_names[i], model_name) == 0)
|
if (strcmp(used_model_names[i], model_name) == 0)
|
||||||
found_model = TRUE;
|
found_model = TRUE;
|
||||||
|
|
@ -1664,13 +1664,13 @@ get_subckts_for_subckt(struct line *start_card, char *subckt_name,
|
||||||
tfree(model_name);
|
tfree(model_name);
|
||||||
}
|
}
|
||||||
} else if (has_models) {
|
} else if (has_models) {
|
||||||
num_terminals = get_number_terminals(line);
|
int num_terminals = get_number_terminals(line);
|
||||||
|
|
||||||
if (num_terminals != 0) {
|
if (num_terminals != 0) {
|
||||||
model_name = get_model_name(line, num_terminals);
|
char *model_name = get_model_name(line, num_terminals);
|
||||||
|
|
||||||
if (is_a_modelname(model_name)) {
|
if (is_a_modelname(model_name)) {
|
||||||
found_model = FALSE;
|
bool found_model = FALSE;
|
||||||
for (i = 0; i < *num_used_model_names; i++)
|
for (i = 0; i < *num_used_model_names; i++)
|
||||||
if (strcmp(used_model_names[i], model_name) == 0) found_model = TRUE;
|
if (strcmp(used_model_names[i], model_name) == 0) found_model = TRUE;
|
||||||
if (!found_model) {
|
if (!found_model) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue