[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] code review comments
From: |
Theodore A. Roth |
Subject: |
Re: [avrdude-dev] code review comments |
Date: |
Wed, 7 Jul 2004 16:32:27 -0700 (PDT) |
On Wed, 7 Jul 2004, E. Weddington wrote:
> On 7 Jul 2004 at 16:06, Theodore A. Roth wrote:
>
> > Hi,
> >
> > I'm looking through the code a bit and have a few comments.
> >
> > In main():
> >
> > 905 else {
> > 906 update_progress = update_progress_no_tty;
> > 907 #if defined(WIN32NATIVE)
> > 908 /* disable all buffering of stderr for compatibility with
> > 909 software that captures and redirects output to a GUI
> > 910 i.e. Programmers Notepad */
> > 911 setvbuf( stderr, NULL, _IONBF, 0 );
> > 912 setvbuf( stdout, NULL, _IONBF, 0 );
> > 913 #endif /* WIN32NATIVE */
> > 914 }
> >
> > Could lines 907 and 913 just be removed? I doubt this would hurt for
> > other systems and might even help.
>
> If those function calls work on Linux, FreeBSD, and Mac OSX, then why not?
>From the man page for setvbuf:
CONFORMING TO
The setbuf and setvbuf functions conform to ANSI X3.159-1989
(``ANSI C'').
>
>
> > Copyright needs updated.
> >
> > Is the native w32 still experimental? Can that be removed?
>
> It should be removed. It's been tested enough IMHO.
OK.
>
> > Shouldn't all the leading '#' characters for preprocessor directives be
> > at the beginning of the line instead of intended? Does indenting those
> > work with all compilers on all systems?
>
> Considering all the systems that avrdude is known to work on, the
> compiler that is being used on all those systems is GCC, and no other.
> Indenting preprocessor directives is known to work on GCC. So,
> technically it's fine. But if somebody (Brian) wants to declare a
> stylistic preference for the application, that's a different matter.
Personnally, I'd rather they were not indented. They are harder to
notice when indented and are usually code that need more careful looking
over since the code is compiled differently based on the defines. They
should really stick out like a sore thumb so that they get noticed and
scrutinized. Indenting them also confuses some editor when coloring the
syntax further hiding them. I've never seen any code with them indented
either.
---
Ted Roth
PGP Key ID: 0x18F846E9
Jabber ID: address@hidden