avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] Fix warnings patch


From: E. Weddington
Subject: Re: [avrdude-dev] Fix warnings patch
Date: Thu, 28 Aug 2003 21:42:19 GMT

> I didn't even remember that caused warnings.  Yes, that 
goto looked as a
> simple way to me to avoid overly nested if/else 
statements, but i admit

At the risk of starting a religious war, nested if/else 
statements look much better and are easier to read if the 
brace style were BSD/Allman w/ indent=4 rather than K&R 
style indent=2: 
<http://www.kafejo.com/komp/1tbs.htm>
Of course IMHO, YMMV. ;-)


> clean.  But Eric's version looks fine to me, and i trust 
him that he
> tested it.  (Eric, if you insist on me testing it before 
you're going
> to commit that, let me know.)

Hrm. The logic is essentially the same in the code, but no, 
I haven't tested it out.

If there is uneasiness about this, a smaller change would 
be to move the compound assignment statement to outside and 
in front of the if block and leave the if alone. But then 
it looks sort of funny to have the if block just have a 
goto statement by itself: 

  prescale = cmatch = 0;
  if (v <= 0.0) {
    goto setclock;
  }
  if (v > fbase / 2) {
    // ...  

hence the motivation for the additional change.

Eric
Eric






reply via email to

[Prev in Thread] Current Thread [Next in Thread]