On Sun, Mar 04, 2007 at 06:07:08PM +0100, Magnus Fromreide wrote:
> On sön, 2007-03-04 at 13:55 +0100, Thomas Anders wrote:
> > Magnus Fromreide wrote:
> > > Are patches like the attached ones of interest for the project or should
> > > I just ignore such things when I see them?
> > 
> > Cleanup is always appreciated.
> > 
> > > The advantage of the patches is that they make the code more local so
> > > you do not have to keep track of lots of function scope variables, see
> > > for instance make-zone-local where there are two uses of the variable,
> > > 25 and 50 lines from the declaration or make-len-local where the use is
> > > 90 lines from the declaration.
> > > 
> > > make-len-local
> > >         Move the len variable from function scope to the scope of the if
> > >         clause where it i used.
> > > 
> > > make-zone-local
> > >         Move the zone variable from function scopes of the two if
> > >         clauses  where it is used.
> > 
> > Don't these two patches introduce potential problems with C89 compilers?
> 
> No.
> 
> In both cases the declarations is at the start of a block, and as far as
> I know it have always been valid to declare variables at the start of a
> block, even if it is an inner block.

Steve the language lawyer concurs, with hearty applause: scope reductions
make code easier to understand and maintain.

Steve :-)


-- 
Stephen J Friedl | Security Consultant |  UNIX Wizard  |   +1 714 544-6561
www.unixwiz.net  | Tustin, Calif. USA  | Microsoft MVP | [EMAIL PROTECTED]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to