[Insight-developers] Dashboard Cleanup: mini0.nlm MacOSX-cross-rosetta : 50 tests failing
Michel Audette
michel.audette at kitware.com
Thu Jan 28 17:59:22 EST 2010
Dear collaborators,
I've committed several more files today, with about a dozen or so to go, and
updated the wiki.
http://www.itk.org/Wiki/Proposals:Updating_Nrrd_library_2009#Table
I will monitor the dashboard, and in the meantime am lauching experimental
tests on Linux and cross-compiled Mac. If you find anything problematic,
feel free to let me know.
Best wishes,
Michel
On Thu, Jan 28, 2010 at 3:42 PM, Luis Ibanez <luis.ibanez at kitware.com>wrote:
> I would certainly prefer to use "while" loops
> instead of "for" loops, whenever possible.
>
>
> A "for" loop compacts three statements in a
> single line, and becomes a nightmare for debugging.
>
>
> Luis
>
>
> ---------------------------------------------------------------------
> On Thu, Jan 28, 2010 at 2:16 PM, Michel Audette
> <michel.audette at kitware.com> wrote:
> > Hi Kevin,
> >
> > I added a pair of brackets that makes d local. I only alerted Luis,
> because
> > I thought that would almost spam the list. In any event, I wanted to
> > preserve the functionality as much as possible, although Luis is steering
> me
> > to while loops these days, as they tend to debug well. I'll keep an eye
> on
> > the dashboard.
> >
> > Cheers,
> >
> > Michel
> >
> > On Thu, Jan 28, 2010 at 1:59 PM, Kevin H. Hobbs <hobbsk at ohiou.edu>
> wrote:
> >>
> >> On 01/28/2010 01:31 PM, Michel Audette wrote:
> >> > Hi Luis,
> >> >
> >> > your value *d* in the bolded part of your suggested code is undefined
> >> > when used as an index. It has to be as
> >> > d = dim - 1;
> >> > l = coord[d];
> >> > d--;
> >> > for coord to have a valid index, doesn't it?
> >> >
> >> > I propose... (extra check on validity of index d)
> >> > #define NRRD_INDEX_GEN(I, coord, size, dim) \
> >> > int d;
> \
> >> > d = (dim) - 1; \
> >> > if ( (d) >= 0 ) \
> >> > {
> >> > \
> >> > (I) = (coord)[d]; \
> >> > d--;
> \
> >> > while( d >= 0 ) \
> >> > {
> >> > \
> >> > (I) = (coord)[d] + (size)[d] * (I); \
> >> > d--;
> \
> >> > }
> >> > \
> >> > }
> >> > \
> >> > and to take out the pragmas.
> >> >
> >> > Seem reasonable?
> >> >
> >> > Michel
> >> >
> >>
> >> I like your check for d >= 0. Nothing will happen if dim = 1 where I'm
> >> guessing the present code would do something undefined if dim == 1. Does
> >> NRRD even deal with 1-d things?
> >>
> >> The only other thing that jumps to mind is that since this is a macro in
> >> C we might want to follow the lead of the original header and wrap the
> >> whole thing up in a do{...}while(0) I guess this is to avoid redefining
> >> d or declaring d in the middle of a block of code. This will probably
> >> make the code easier to digest for older compilers but I'm by no means
> >> an expert here.
> >>
> >> Instead of do{...}while(0) could it be if ( dim >= 1 ){...} else {...} ?
> >>
> >
> >
> >
> > --
> > Michel Audette, Ph.D.
> > R & D Engineer,
> > Kitware Inc.,
> > Chapel Hill, N.C.
> >
> >
>
--
Michel Audette, Ph.D.
R & D Engineer,
Kitware Inc.,
Chapel Hill, N.C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20100128/edb011cb/attachment.htm>
More information about the Insight-developers
mailing list