Commit Graph

2914 Commits

Author SHA1 Message Date
rlar c47b827ab6 code beautify 2012-03-25 19:31:53 +02:00
rlar 33352be13e whitespace and untabify 2012-03-25 19:19:34 +02:00
rlar ff9dcd6593 modnames, drop modnames artifacts, EXACT 2012-03-25 19:14:08 +02:00
rlar f2cc623d0f modnames, inp_subckt, modnames need not be static any longer, EXACT
wl_free can cope with NULL argument.
  trailing modnames = NULL not neccessairy, nobody reads it.
2012-03-25 19:14:02 +02:00
rlar 0478f3d691 modnames, doit, unreference modnames,
modnames was restored on regular returns.

  it was not restored on error returns.
    consider this a bug.

  if we assume it was saved for error returns as well,
  then modnames need not be passed by reference,
    and the unreferenced variant need not be restored.

  we see now more clearly,
    that a wl_free of the locally prepended new elements
    to modnames should be freed on return.
2012-03-25 19:13:57 +02:00
rlar d094ba9763 modnames, translate(), pass modnames unreferenced, EXACT
was only used by numnodes, and is not modified there
2012-03-25 19:13:50 +02:00
rlar 595e804b43 modnames, numnodes(), pass modnames unrefererenced, EXACT
since the reference was readonly, was not modified
2012-03-25 19:13:46 +02:00
rlar f707311f85 modnames, pass global `modnames' by reference, EXACT transformation
lives in
    inp_subcktexpand() where it is used and passed to doit()

  doit()
    where it is (read only) used, and passed to doit() modtranslate() and translate()
    does a strance protect,

  translate()
    where it not used, but passed to numnodes()

  numnodes()
     where it is used read-only

  modtranslate()
    where it is used to insert at the front
2012-03-25 19:13:41 +02:00
rlar f048ead53a submod, remove useless usage of `submod' (submod === NULL), EXACT 2012-03-25 19:13:34 +02:00
rlar 536bf69a24 submod, drop renamed subname artifacts, EXACT 2012-03-25 19:13:30 +02:00
rlar 6bd39e1037 submod, doit() `submod0' is a true local variable
submod0 is only aceesd in doit,
     always set NULL on entry,
     (almost) always restored on return

   was not restored on error ...
     fixme check this changed behaviour
2012-03-25 19:13:25 +02:00
rlar 5d85d00b6f submod, pass global `submod' by reference, EXACT
doit()
    uses this list, and executes modtranslate() and devmodtranslate()

  modtranslate()
    uses submod, to prepend to the list

  devmodtranslate()
    just traverses the list
2012-03-25 19:13:14 +02:00
rlar 02fee87faf subs, subs === sssfree, drop sssfree, EXACT 2012-03-25 19:13:08 +02:00
rlar aa192231f8 subs, no need to save and restore subs here, EXACT 2012-03-25 19:11:09 +02:00
rlar 3725ae2575 subs, rewrite "!subs" criterion, sss === subs, EXACT 2012-03-25 19:10:43 +02:00
rlar 6d7ecf7c6c subs, remove rename artifacts, EXACT 2012-03-25 19:10:32 +02:00
rlar 30a56fc113 subs, localize `subs0'
nobody looks at subs0, except doit().
  doit() allways initializes it to NULL,
    and restores it on return
    thus its a local ...

  note:
    in error cases subs is *not* allways restored
    assume this to have been a bug
2012-03-25 19:10:27 +02:00
rlar 7dbff22038 subs, translate, unreference, EXACT 2012-03-25 19:10:21 +02:00
rlar e3cc185a64 subs, numnodes, unreference compiler proofen *subs beeing un-modified, EXACT 2012-03-25 19:10:14 +02:00
rlar ca4cd48786 subs, pass global `subs' by reference, EXACT
global subs0
    used and modified in doit()
    passed to translate()

  translate()
    pass only to nunmodes()

  numnodes()
    doesn't modify
2012-03-25 19:09:07 +02:00
rlar 56618c91f6 doit, drop braces 2012-03-25 19:08:49 +02:00
rlar 7eb5e83b8d doit, tiny rewrite 2012-03-25 19:08:04 +02:00
rlar 90dc1da4d2 doit, return allows shortcuting else if 2012-03-25 19:07:47 +02:00
rlar a69ddd9ad0 doit, rewrite 2012-03-25 19:07:29 +02:00
rlar b29b3afee2 doit, comments 2012-03-25 19:07:25 +02:00
rlar f6d1f1fa73 nest, cleanup the loop, pronounce the `c', `lcc' pair 2012-03-25 19:07:22 +02:00
rlar 0be258a808 nest, initialize `lcc' with `last' instead of NULL to avoid special handling for empty bodies 2012-03-25 19:07:15 +02:00
rlar 679a8d34e8 nest, delay setting of `lcc' a bit for readability 2012-03-25 19:06:10 +02:00
rlar b8b1c9dc6a nest, rewrite 2012-03-25 19:05:34 +02:00
rlar c86d52aab6 nest, rewrite 2012-03-25 19:05:32 +02:00
rlar 54d743c87e next, identical with tail of the loop 2012-03-25 19:05:31 +02:00
rlar 9dc52933f8 nest, drop else {} due to break 2012-03-25 19:05:30 +02:00
rlar e41db66b6c nest, increment semantics of `nest' 2012-03-25 19:05:29 +02:00
rlar 4af931d9e4 nest, shrink scope of `nest' 2012-03-25 19:05:27 +02:00
rlar 74ec911f01 doit, drop unused `gotone' assignment 2012-03-25 19:05:25 +02:00
rlar 1be324ca38 doit, tiny rewrite 2012-03-25 19:04:49 +02:00
rlar c866517dfb doit, drop local `i' 2012-03-25 19:04:37 +02:00
rlar 107827af14 doit, shrink scope of `c' 2012-03-25 19:04:34 +02:00
rlar 091a83019a doit, shrink scope of `lcc', drop an unused `lcc' assignment at the scopes tail 2012-03-25 19:04:33 +02:00
rlar 8f73a4dd23 doit, shrink scope of `s' 2012-03-25 19:04:32 +02:00
rlar 0cee0467e2 doit, shrink scope of `t' 2012-03-25 19:04:31 +02:00
rlar 79ad78d28c doit, shrink scope of `i' 2012-03-25 19:04:29 +02:00
rlar 1ea5561a18 doit, shrink scope of `lc' and `last' 2012-03-25 19:04:15 +02:00
rlar a78251d5da doit, shrink scope of `ks' 2012-03-25 19:04:12 +02:00
rlar 8fd8611bc4 doit, shrink scope of `subname' and `scname' 2012-03-25 19:04:00 +02:00
rlar 63d3c28d60 doit, shrink scope of `savenext' 2012-03-25 19:03:56 +02:00
rlar 45f6b7b1dd devmodtranslate, mark a possible bug 2012-03-25 19:03:47 +02:00
rlar fa2212b305 devmodtranslate, drop braces 2012-03-25 19:03:44 +02:00
rlar d4b453698c devmodtranslate, shrink scope of variables 2012-03-25 19:03:39 +02:00
rlar ead1ef3736 devmodtranslate, drop `found' variable, use loop termination criterion instead
for(;criterion;)
     if(..)
       found=TRUE; break;
   if(found)
     ...

  ==>

   for(;criterion;)
     if(..)
       break;
   if(!criterion)
     ...
2012-03-25 19:03:30 +02:00