tree-wide: replace while(1) by for(;;) everywhere
Another Coccinelle script.
This commit is contained in:
parent
1f6b411372
commit
57255510c9
|
@ -0,0 +1,12 @@
|
||||||
|
@@
|
||||||
|
statement s;
|
||||||
|
@@
|
||||||
|
- while (true)
|
||||||
|
+ for (;;)
|
||||||
|
s
|
||||||
|
@@
|
||||||
|
statement s;
|
||||||
|
@@
|
||||||
|
- while (1)
|
||||||
|
+ for (;;)
|
||||||
|
s
|
|
@ -888,7 +888,7 @@ static struct ps_struct *get_next_ps(struct ps_struct *ps, struct ps_struct *ps_
|
||||||
return ps->next;
|
return ps->next;
|
||||||
|
|
||||||
/* go back for parent siblings */
|
/* go back for parent siblings */
|
||||||
while (1) {
|
for (;;) {
|
||||||
if (ps->parent && ps->parent->next)
|
if (ps->parent && ps->parent->next)
|
||||||
return ps->parent->next;
|
return ps->parent->next;
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ static int get_line(RemoteSource *source, char **line, size_t *size) {
|
||||||
assert(source->buf == NULL || source->size > 0);
|
assert(source->buf == NULL || source->size > 0);
|
||||||
assert(source->fd >= 0);
|
assert(source->fd >= 0);
|
||||||
|
|
||||||
while (true) {
|
for (;;) {
|
||||||
if (source->buf) {
|
if (source->buf) {
|
||||||
size_t start = MAX(source->scanned, source->offset);
|
size_t start = MAX(source->scanned, source->offset);
|
||||||
|
|
||||||
|
|
|
@ -518,7 +518,7 @@ static int process_http_upload(
|
||||||
} else
|
} else
|
||||||
finished = true;
|
finished = true;
|
||||||
|
|
||||||
while (true) {
|
for (;;) {
|
||||||
r = process_source(source, arg_compress, arg_seal);
|
r = process_source(source, arg_compress, arg_seal);
|
||||||
if (r == -EAGAIN)
|
if (r == -EAGAIN)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -17,7 +17,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
|
||||||
|
|
||||||
assert(size <= SSIZE_MAX);
|
assert(size <= SSIZE_MAX);
|
||||||
|
|
||||||
while (true) {
|
for (;;) {
|
||||||
|
|
||||||
switch(u->entry_state) {
|
switch(u->entry_state) {
|
||||||
case ENTRY_CURSOR: {
|
case ENTRY_CURSOR: {
|
||||||
|
|
|
@ -828,7 +828,7 @@ int main(int argc, char **argv) {
|
||||||
"READY=1\n"
|
"READY=1\n"
|
||||||
"STATUS=Processing input...");
|
"STATUS=Processing input...");
|
||||||
|
|
||||||
while (true) {
|
for (;;) {
|
||||||
r = sd_event_get_state(u.events);
|
r = sd_event_get_state(u.events);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -432,7 +432,7 @@ int main(int argc, char *argv[])
|
||||||
if (udev == NULL)
|
if (udev == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
while (1) {
|
for (;;) {
|
||||||
int option;
|
int option;
|
||||||
|
|
||||||
option = getopt_long(argc, argv, "xh", options, NULL);
|
option = getopt_long(argc, argv, "xh", options, NULL);
|
||||||
|
|
|
@ -868,7 +868,7 @@ int main(int argc, char *argv[])
|
||||||
if (udev == NULL)
|
if (udev == NULL)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
while (1) {
|
for (;;) {
|
||||||
int option;
|
int option;
|
||||||
|
|
||||||
option = getopt_long(argc, argv, "deluh", options, NULL);
|
option = getopt_long(argc, argv, "deluh", options, NULL);
|
||||||
|
|
|
@ -364,7 +364,7 @@ int main(int argc, char **argv)
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1) {
|
for (;;) {
|
||||||
int option;
|
int option;
|
||||||
|
|
||||||
option = getopt_long(argc, argv, "ardh", options, NULL);
|
option = getopt_long(argc, argv, "ardh", options, NULL);
|
||||||
|
|
|
@ -190,7 +190,7 @@ static int get_file_options(struct udev *udev,
|
||||||
|
|
||||||
*newargv = NULL;
|
*newargv = NULL;
|
||||||
lineno = 0;
|
lineno = 0;
|
||||||
while (1) {
|
for (;;) {
|
||||||
vendor_in = model_in = options_in = NULL;
|
vendor_in = model_in = options_in = NULL;
|
||||||
|
|
||||||
buf = fgets(buffer, MAX_BUFFER_LEN, f);
|
buf = fgets(buffer, MAX_BUFFER_LEN, f);
|
||||||
|
|
Loading…
Reference in New Issue