On Mi. 19. Mär. 2008, 06:25:32, kjs wrote:
> hi,
> 
> attached a patch that does some aligning of "=" tokens and limits the
> scope of some variables.
> 
> I don't commit this myself, because I want to check whether this
> practice of localizing vars. is ok, as it introduces "else" clauses.
> For instance, instead of writing:
> 
> STRING *s;
> 
> if ( bla bla )
>      return -1;
> 
> s = xyz
> more stuff()
> return s
> 
> 
> I changed this into:
> 
> if (bla bla)
>      return -1;
> else {
>    STRING *s = xyz
>    more stuff()
>    return s;
> }
> 
> 
> 
> Not sure whether which is better. My personal preference is the patch,
> obviously.
> Comments welcome, so I know how to do this in the future.

Personally I like your version a little bit better, as *s is declared
close to where the action is.
Alternativels one could avoid the technical variable 's' altogether
and stick with using '*buf'.

Regards,
  Bernhard

-- 
/* [EMAIL PROTECTED] */

Reply via email to