From d0c45d2af13dd27869252d281b76bddd7e0fc02c Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 29 May 2013 22:39:09 +0200 Subject: [PATCH] inpcom.c, drop some local variables --- src/frontend/inpcom.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 2bef3beb1..162994d33 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -941,10 +941,9 @@ inp_fix_gnd_name(struct line *c) static struct line* create_new_card(char *card_str, int *line_number) { - char *str = strdup(card_str); struct line *newcard = alloc(struct line); - newcard->li_line = str; + newcard->li_line = strdup(card_str); newcard->li_linenum = *line_number; newcard->li_error = NULL; newcard->li_actual = NULL; @@ -1313,15 +1312,14 @@ get_model_name(char *line, int num_terminals) static char* get_model_type(char *line) { - char *model_type, *beg_ptr; + char *beg_ptr; if (!(ciprefix(".model", line))) return NULL; beg_ptr = skip_non_ws(line); /* eat .model */ beg_ptr = skip_ws(beg_ptr); beg_ptr = skip_non_ws(beg_ptr); /* eat model name */ beg_ptr = skip_ws(beg_ptr); - model_type = gettok(&beg_ptr); - return model_type; + return gettok(&beg_ptr); } @@ -2505,14 +2503,13 @@ inp_fix_inst_line(char *inst_line, static bool found_mult_param(int num_params, char *param_names[]) { - bool found_mult = FALSE; int i; for (i = 0; i < num_params; i++) if (strcmp(param_names[i], "m") == 0) - found_mult = TRUE; + return TRUE; - return found_mult; + return FALSE; } /* If a subcircuit invocation (X-line) is found, which contains the