Re: [hackers] [quark] Use sizeof() instead of magic constants || FRIGN

From: Quentin Rameau <quinq_AT_fifth.space>
Date: Tue, 6 Sep 2016 14:20:45 +0200

> I think using goto loops sometimes is good, depend on the use case.
Obviously

> For example in spt.c:
>
> run:
> notify_send(timers[i].cmt);
>
> for (timecount = 0; timecount < timers[i].tmr; timecount +=
> inc) sleep(1);
>
> if (++i >= LEN(timers)) i = 0; /* i infinal loop */
> goto run;
>
> I tried using for and while loop, the goto loop still looks a lot
> better.

for (i = N; ; i = (i + 1) % LEN(timers)) {
        for (timecount = 0; timecount < timers[i].tmr; timecount += inc)
                sleep(1);
}
Received on Tue Sep 06 2016 - 14:20:45 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 06 2016 - 14:24:15 CEST