On Tue, 2009-04-28 at 09:03 +0200, Michael Bruck wrote:
> On Tue, Apr 28, 2009 at 8:23 AM, Øyvind Harboe <[email protected]> 
> wrote:
> > Do we really want to go down the path of macros?
> 
> Yes. The ifs obscure the actual algorithm by turning a short one-line
> function call into five lines of (dense) operator soup with the actual
> action lost somewhere in between.
> 
> 
> > There are two audiences for this code:
> >
> > - those that work on the code all the time
> > - the casual reader/debugger
> >
> > For the second group, the code is not less readable.
> 
> I disagree. Unless what you are trying to read is the syntactic sugar
> rather than the actual algorithm.

I think I agree with Michael; I was thinking about a similar construct
recently.  I would up the ante with a variant that takes an error string
that would printed on failure (CHECK_RETVAL_MSG?), as that is another
common pattern where a macro would make sections of code easier to read.

I also suggest putting these in more generic header than arm11.h.

Cheers,

Zach

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to