On Mon, 17 Jul 2006 20:53:30 +0200, Andreas Mohr said: > Hi all, > > for (i = 0; i < 4; i++) { > j = INDEX(i); > do { > if (j < (INDEX(i)) && i < 3) > list = varray[i + 1]->vec + (INDEX(i + 1)); > goto found; > } while (j != (INDEX(i))); > } > found: > Excuse me, but why do we have a while loop here if the last instruction in > the while loop is a straight "goto found"? Consider if we take the 'goto found' when i==1. We leave not only the do/while but also the for loop. A 'continue' instead would leave the do/while and then drive the i==2 and subsequent 'for' iterations.... (Unless my C mastery has severely faded of late?)
Attachment:
pgpgeRvjzCWrq.pgp
Description: PGP signature
- Follow-Ups:
- Re: kernel/timer.c: next_timer_interrupt() strange/buggy(?) code (2.6.18-rc1-mm2)
- From: Michael Buesch <[email protected]>
- Re: kernel/timer.c: next_timer_interrupt() strange/buggy(?) code (2.6.18-rc1-mm2)
- From: Steven Rostedt <[email protected]>
- Re: kernel/timer.c: next_timer_interrupt() strange/buggy(?) code (2.6.18-rc1-mm2)
- References:
- Prev by Date: Re: bttv-driver.c:3964: error: void value not ignored as it ought to be
- Next by Date: Re: [PATCH] reiserfs: fix handling of device names with /'s in them
- Previous by thread: Re: kernel/timer.c: next_timer_interrupt() strange/buggy(?) code (2.6.18-rc1-mm2)
- Next by thread: Re: kernel/timer.c: next_timer_interrupt() strange/buggy(?) code (2.6.18-rc1-mm2)
- Index(es):