From cdf4623b6f40f1c360c6a815dd4dabf4671177c5 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 9 Aug 2014 19:38:29 +0200 Subject: [PATCH] xpressn.c, whitespace --- src/frontend/numparam/xpressn.c | 86 ++++++++++++++++----------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 502672d7b..9292ea85f 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -293,17 +293,17 @@ dicostack_push(tdico *dico) { int asize; /* allocation size */ - dico->stack_depth++; - if (dico->stack_depth > dico->symbol_stack_alloc) { - /* Just double the stack alloc */ - dico->symbol_stack_alloc *= 2; - asize = dico->symbol_stack_alloc + 1; /* account for zero */ - dico->local_symbols = TREALLOC(NGHASHPTR, dico->local_symbols, asize); - dico->inst_name = TREALLOC(char*, dico->inst_name, asize); - } - /* lazy allocation - don't allocate space if we can help it */ - dico->local_symbols[dico->stack_depth] = NULL; - dico->inst_name[dico->stack_depth] = nupa_inst_name; + dico->stack_depth++; + if (dico->stack_depth > dico->symbol_stack_alloc) { + /* Just double the stack alloc */ + dico->symbol_stack_alloc *= 2; + asize = dico->symbol_stack_alloc + 1; /* account for zero */ + dico->local_symbols = TREALLOC(NGHASHPTR, dico->local_symbols, asize); + dico->inst_name = TREALLOC(char*, dico->inst_name, asize); + } + /* lazy allocation - don't allocate space if we can help it */ + dico->local_symbols[dico->stack_depth] = NULL; + dico->inst_name[dico->stack_depth] = nupa_inst_name; } @@ -317,40 +317,40 @@ dicostack_pop(tdico *dico) NGHASHPTR htable_p; /* current hash table */ NGHASHITER iter; /* hash iterator - thread safe */ - if (dico->stack_depth <= 0) { - message(dico, " Subckt Stack underflow.\n"); - return; + if (dico->stack_depth <= 0) { + message(dico, " Subckt Stack underflow.\n"); + return; + } + + /* ----------------------------------------------------------------- + * Keep instance parameters around by transferring current local + * scope variables to an instance qualified hash table. + * ----------------------------------------------------------------- */ + inst_name = dico->inst_name[dico->stack_depth]; + htable_p = dico->local_symbols[dico->stack_depth]; + if (htable_p) { + SPICE_DSTRING param_name; /* build a qualified name */ + spice_dstring_init(¶m_name); + + NGHASH_FIRST(&iter); + for (entry_p = (entry *) nghash_enumerateRE(htable_p, &iter); + entry_p; + entry_p = (entry *) nghash_enumerateRE(htable_p, &iter)) + { + spice_dstring_reinit(¶m_name); + param_p = spice_dstring_print(¶m_name, "%s.%s", + inst_name, entry_p->symbol); + nupa_add_inst_param(param_p, entry_p->vl); + dico_free_entry(entry_p); } + nghash_free(htable_p, NULL, NULL); + spice_dstring_free(¶m_name); + } + tfree(inst_name); - /* ----------------------------------------------------------------- - * Keep instance parameters around by transferring current local - * scope variables to an instance qualified hash table. - * ----------------------------------------------------------------- */ - inst_name = dico->inst_name[dico->stack_depth]; - htable_p = dico->local_symbols[dico->stack_depth]; - if (htable_p) { - SPICE_DSTRING param_name; /* build a qualified name */ - spice_dstring_init(¶m_name); - - NGHASH_FIRST(&iter); - for (entry_p = (entry *) nghash_enumerateRE(htable_p, &iter); - entry_p; - entry_p = (entry *) nghash_enumerateRE(htable_p, &iter)) - { - spice_dstring_reinit(¶m_name); - param_p = spice_dstring_print(¶m_name, "%s.%s", - inst_name, entry_p->symbol); - nupa_add_inst_param(param_p, entry_p->vl); - dico_free_entry(entry_p); - } - nghash_free(htable_p, NULL, NULL); - spice_dstring_free(¶m_name); - } - tfree(inst_name); - - dico->inst_name[dico->stack_depth] = NULL; - dico->local_symbols[dico->stack_depth] = NULL; - dico->stack_depth--; + dico->inst_name[dico->stack_depth] = NULL; + dico->local_symbols[dico->stack_depth] = NULL; + dico->stack_depth--; }