On Jan-15, Melvin Smith wrote: > At 11:20 AM 1/15/2004 +0100, Leopold Toetsch wrote: > >Melvin Smith <[EMAIL PROTECTED]> wrote: > >> > >> For some reason 1 test in pcc.t is failing (the nci call) > > > >Off by one error caused by: > > > >> - for (j = 0; j < 4; j++) { > > > >> + for (set = 0; set < REGSET_MAX; set++) { > > > >As most loops inside Parrot use the former scheme, I'd rather keep it > >then switching to an (it seems) error prone variant "set <= REGSET_MAX" > > I like my version because it is self-documenting.
I think these are #defines, but for enums I always use the pattern: enum { CLR_BLUE, CLR_RED, CLR_VOMIT_GREEN, NUM_COLORS /* or CLR_COUNT, or CLR_ENTRIES, or ... */ }; for (i = 0; i < NUM_COLORS; i++) ... So how about a REGSET_SIZE?