Main goto loop to for loop
Thanks to quinq http://lists.suckless.org/hackers/1609/12073.html
This commit is contained in:
parent
aa718fd83a
commit
906a6caa13
13
spt.c
13
spt.c
|
@ -129,14 +129,11 @@ main(int argc, char *argv[])
|
|||
if (signal(SIGUSR2, SIG_IGN) != SIG_IGN)
|
||||
signal(SIGUSR2, toggle);
|
||||
|
||||
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;
|
||||
for (i = 0; ; i = (i + 1) % LEN(timers)) {
|
||||
notify_send(timers[i].cmt);
|
||||
for (timecount = 0; timecount < timers[i].tmr; timecount += inc)
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user