Re: [Openocd-development] [PATCH 5/5] improve command registration

2009-11-11 Thread Zach Welch
On Wed, 2009-11-11 at 13:54 -0700, David Brownell wrote: > On Wednesday 11 November 2009, Zachary T Welch wrote: > > + for (cc = *head; cc && cc->next; cc = cc->next) ; > > Style point: such unadorned empty statements are worth avoiding. > They're not quickly apparent when scanning code ...

Re: [Openocd-development] [PATCH 5/5] improve command registration

2009-11-11 Thread David Brownell
On Wednesday 11 November 2009, Zachary T Welch wrote: > +   for (cc = *head; cc && cc->next; cc = cc->next) ; Style point: such unadorned empty statements are worth avoiding. They're not quickly apparent when scanning code ... either their presence or their absence. That translates to being

[Openocd-development] [PATCH 5/5] improve command registration

2009-11-11 Thread Zachary T Welch
Eliminate duplicate code for linking commands into a list. Adds a check to ensure the command does not already exist; if it does, return that one instead of creating a duplicate. Signed-off-by: Zachary T Welch --- src/helper/command.c | 75 + 1