diff options
| author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-11-27 16:49:31 +0000 |
|---|---|---|
| committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-11-27 16:49:31 +0000 |
| commit | bb89b301143fe9deb962bb2d48264b27a945fcf4 (patch) | |
| tree | 0d8cba8e45b1a8b975e0b8c7a8377703ab5547a6 /coreutils | |
| parent | 09d6cecd11b71856abab9bb68e74f0dd87a425fa (diff) | |
| download | busybox-w32-bb89b301143fe9deb962bb2d48264b27a945fcf4.tar.gz busybox-w32-bb89b301143fe9deb962bb2d48264b27a945fcf4.tar.bz2 busybox-w32-bb89b301143fe9deb962bb2d48264b27a945fcf4.zip | |
style cleanup: return(a) -> return a, part 1
git-svn-id: svn://busybox.net/trunk/busybox@16690 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils')
| -rw-r--r-- | coreutils/diff.c | 30 | ||||
| -rw-r--r-- | coreutils/install.c | 4 | ||||
| -rw-r--r-- | coreutils/sync.c | 2 | ||||
| -rw-r--r-- | coreutils/test.c | 16 | ||||
| -rw-r--r-- | coreutils/tr.c | 2 |
5 files changed, 27 insertions, 27 deletions
diff --git a/coreutils/diff.c b/coreutils/diff.c index f26bcca86..2920bf143 100644 --- a/coreutils/diff.c +++ b/coreutils/diff.c | |||
| @@ -183,7 +183,7 @@ static int readhash(FILE * f) | |||
| 183 | for (i = 0; (t = getc(f)) != '\n'; i++) { | 183 | for (i = 0; (t = getc(f)) != '\n'; i++) { |
| 184 | if (t == EOF) { | 184 | if (t == EOF) { |
| 185 | if (i == 0) | 185 | if (i == 0) |
| 186 | return (0); | 186 | return 0; |
| 187 | break; | 187 | break; |
| 188 | } | 188 | } |
| 189 | sum = sum * 127 + t; | 189 | sum = sum * 127 + t; |
| @@ -191,7 +191,7 @@ static int readhash(FILE * f) | |||
| 191 | for (i = 0; (t = getc(f)) != '\n'; i++) { | 191 | for (i = 0; (t = getc(f)) != '\n'; i++) { |
| 192 | if (t == EOF) { | 192 | if (t == EOF) { |
| 193 | if (i == 0) | 193 | if (i == 0) |
| 194 | return (0); | 194 | return 0; |
| 195 | break; | 195 | break; |
| 196 | } | 196 | } |
| 197 | sum = sum * 127 + t; | 197 | sum = sum * 127 + t; |
| @@ -216,7 +216,7 @@ static int readhash(FILE * f) | |||
| 216 | continue; | 216 | continue; |
| 217 | case EOF: | 217 | case EOF: |
| 218 | if (i == 0) | 218 | if (i == 0) |
| 219 | return (0); | 219 | return 0; |
| 220 | /* FALLTHROUGH */ | 220 | /* FALLTHROUGH */ |
| 221 | case '\n': | 221 | case '\n': |
| 222 | break; | 222 | break; |
| @@ -244,19 +244,19 @@ static int files_differ(FILE * f1, FILE * f2, int flags) | |||
| 244 | 244 | ||
| 245 | if ((flags & (D_EMPTY1 | D_EMPTY2)) || stb1.st_size != stb2.st_size || | 245 | if ((flags & (D_EMPTY1 | D_EMPTY2)) || stb1.st_size != stb2.st_size || |
| 246 | (stb1.st_mode & S_IFMT) != (stb2.st_mode & S_IFMT)) | 246 | (stb1.st_mode & S_IFMT) != (stb2.st_mode & S_IFMT)) |
| 247 | return (1); | 247 | return 1; |
| 248 | while (1) { | 248 | while (1) { |
| 249 | i = fread(buf1, 1, sizeof(buf1), f1); | 249 | i = fread(buf1, 1, sizeof(buf1), f1); |
| 250 | j = fread(buf2, 1, sizeof(buf2), f2); | 250 | j = fread(buf2, 1, sizeof(buf2), f2); |
| 251 | if (i != j) | 251 | if (i != j) |
| 252 | return (1); | 252 | return 1; |
| 253 | if (i == 0 && j == 0) { | 253 | if (i == 0 && j == 0) { |
| 254 | if (ferror(f1) || ferror(f2)) | 254 | if (ferror(f1) || ferror(f2)) |
| 255 | return (1); | 255 | return 1; |
| 256 | return (0); | 256 | return 0; |
| 257 | } | 257 | } |
| 258 | if (memcmp(buf1, buf2, i) != 0) | 258 | if (memcmp(buf1, buf2, i) != 0) |
| 259 | return (1); | 259 | return 1; |
| 260 | } | 260 | } |
| 261 | } | 261 | } |
| 262 | 262 | ||
| @@ -333,7 +333,7 @@ static int isqrt(int n) | |||
| 333 | int y, x = 1; | 333 | int y, x = 1; |
| 334 | 334 | ||
| 335 | if (n == 0) | 335 | if (n == 0) |
| 336 | return (0); | 336 | return 0; |
| 337 | 337 | ||
| 338 | do { | 338 | do { |
| 339 | y = x; | 339 | y = x; |
| @@ -610,7 +610,7 @@ static int fetch(long *f, int a, int b, FILE * lb, int ch) | |||
| 610 | int i, j, c, lastc, col, nc; | 610 | int i, j, c, lastc, col, nc; |
| 611 | 611 | ||
| 612 | if (a > b) | 612 | if (a > b) |
| 613 | return (0); | 613 | return 0; |
| 614 | for (i = a; i <= b; i++) { | 614 | for (i = a; i <= b; i++) { |
| 615 | fseek(lb, f[i - 1], SEEK_SET); | 615 | fseek(lb, f[i - 1], SEEK_SET); |
| 616 | nc = f[i] - f[i - 1]; | 616 | nc = f[i] - f[i - 1]; |
| @@ -623,7 +623,7 @@ static int fetch(long *f, int a, int b, FILE * lb, int ch) | |||
| 623 | for (j = 0, lastc = '\0'; j < nc; j++, lastc = c) { | 623 | for (j = 0, lastc = '\0'; j < nc; j++, lastc = c) { |
| 624 | if ((c = getc(lb)) == EOF) { | 624 | if ((c = getc(lb)) == EOF) { |
| 625 | puts("\n\\ No newline at end of file"); | 625 | puts("\n\\ No newline at end of file"); |
| 626 | return (0); | 626 | return 0; |
| 627 | } | 627 | } |
| 628 | if (c == '\t' && (cmd_flags & FLAG_t)) { | 628 | if (c == '\t' && (cmd_flags & FLAG_t)) { |
| 629 | do { | 629 | do { |
| @@ -635,7 +635,7 @@ static int fetch(long *f, int a, int b, FILE * lb, int ch) | |||
| 635 | } | 635 | } |
| 636 | } | 636 | } |
| 637 | } | 637 | } |
| 638 | return (0); | 638 | return 0; |
| 639 | } | 639 | } |
| 640 | 640 | ||
| 641 | static int asciifile(FILE * f) | 641 | static int asciifile(FILE * f) |
| @@ -646,18 +646,18 @@ static int asciifile(FILE * f) | |||
| 646 | #endif | 646 | #endif |
| 647 | 647 | ||
| 648 | if ((cmd_flags & FLAG_a) || f == NULL) | 648 | if ((cmd_flags & FLAG_a) || f == NULL) |
| 649 | return (1); | 649 | return 1; |
| 650 | 650 | ||
| 651 | #if ENABLE_FEATURE_DIFF_BINARY | 651 | #if ENABLE_FEATURE_DIFF_BINARY |
| 652 | rewind(f); | 652 | rewind(f); |
| 653 | cnt = fread(buf, 1, sizeof(buf), f); | 653 | cnt = fread(buf, 1, sizeof(buf), f); |
| 654 | for (i = 0; i < cnt; i++) { | 654 | for (i = 0; i < cnt; i++) { |
| 655 | if (!isprint(buf[i]) && !isspace(buf[i])) { | 655 | if (!isprint(buf[i]) && !isspace(buf[i])) { |
| 656 | return (0); | 656 | return 0; |
| 657 | } | 657 | } |
| 658 | } | 658 | } |
| 659 | #endif | 659 | #endif |
| 660 | return (1); | 660 | return 1; |
| 661 | } | 661 | } |
| 662 | 662 | ||
| 663 | /* dump accumulated "unified" diff changes */ | 663 | /* dump accumulated "unified" diff changes */ |
diff --git a/coreutils/install.c b/coreutils/install.c index 54adc2b6e..3e003905e 100644 --- a/coreutils/install.c +++ b/coreutils/install.c | |||
| @@ -92,7 +92,7 @@ int install_main(int argc, char **argv) | |||
| 92 | } | 92 | } |
| 93 | } while (old_argv_ptr); | 93 | } while (old_argv_ptr); |
| 94 | } | 94 | } |
| 95 | return(ret); | 95 | return ret; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | { | 98 | { |
| @@ -127,5 +127,5 @@ int install_main(int argc, char **argv) | |||
| 127 | if(ENABLE_FEATURE_CLEAN_UP && isdir) free(dest); | 127 | if(ENABLE_FEATURE_CLEAN_UP && isdir) free(dest); |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | return(ret); | 130 | return ret; |
| 131 | } | 131 | } |
diff --git a/coreutils/sync.c b/coreutils/sync.c index 8a7f18265..59f0b504a 100644 --- a/coreutils/sync.c +++ b/coreutils/sync.c | |||
| @@ -19,5 +19,5 @@ int sync_main(int argc, char **argv) | |||
| 19 | 19 | ||
| 20 | sync(); | 20 | sync(); |
| 21 | 21 | ||
| 22 | return(EXIT_SUCCESS); | 22 | return EXIT_SUCCESS; |
| 23 | } | 23 | } |
diff --git a/coreutils/test.c b/coreutils/test.c index c1097c28c..ebb4f9086 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
| @@ -520,17 +520,17 @@ static int test_eaccess(char *path, int mode) | |||
| 520 | unsigned int euid = geteuid(); | 520 | unsigned int euid = geteuid(); |
| 521 | 521 | ||
| 522 | if (stat(path, &st) < 0) | 522 | if (stat(path, &st) < 0) |
| 523 | return (-1); | 523 | return -1; |
| 524 | 524 | ||
| 525 | if (euid == 0) { | 525 | if (euid == 0) { |
| 526 | /* Root can read or write any file. */ | 526 | /* Root can read or write any file. */ |
| 527 | if (mode != X_OK) | 527 | if (mode != X_OK) |
| 528 | return (0); | 528 | return 0; |
| 529 | 529 | ||
| 530 | /* Root can execute any file that has any one of the execute | 530 | /* Root can execute any file that has any one of the execute |
| 531 | bits set. */ | 531 | bits set. */ |
| 532 | if (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) | 532 | if (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) |
| 533 | return (0); | 533 | return 0; |
| 534 | } | 534 | } |
| 535 | 535 | ||
| 536 | if (st.st_uid == euid) /* owner */ | 536 | if (st.st_uid == euid) /* owner */ |
| @@ -539,9 +539,9 @@ static int test_eaccess(char *path, int mode) | |||
| 539 | mode <<= 3; | 539 | mode <<= 3; |
| 540 | 540 | ||
| 541 | if (st.st_mode & mode) | 541 | if (st.st_mode & mode) |
| 542 | return (0); | 542 | return 0; |
| 543 | 543 | ||
| 544 | return (-1); | 544 | return -1; |
| 545 | } | 545 | } |
| 546 | 546 | ||
| 547 | static void initialize_group_array(void) | 547 | static void initialize_group_array(void) |
| @@ -560,7 +560,7 @@ static int is_a_group_member(gid_t gid) | |||
| 560 | 560 | ||
| 561 | /* Short-circuit if possible, maybe saving a call to getgroups(). */ | 561 | /* Short-circuit if possible, maybe saving a call to getgroups(). */ |
| 562 | if (gid == getgid() || gid == getegid()) | 562 | if (gid == getgid() || gid == getegid()) |
| 563 | return (1); | 563 | return 1; |
| 564 | 564 | ||
| 565 | if (ngroups == 0) | 565 | if (ngroups == 0) |
| 566 | initialize_group_array(); | 566 | initialize_group_array(); |
| @@ -568,9 +568,9 @@ static int is_a_group_member(gid_t gid) | |||
| 568 | /* Search through the list looking for GID. */ | 568 | /* Search through the list looking for GID. */ |
| 569 | for (i = 0; i < ngroups; i++) | 569 | for (i = 0; i < ngroups; i++) |
| 570 | if (gid == group_array[i]) | 570 | if (gid == group_array[i]) |
| 571 | return (1); | 571 | return 1; |
| 572 | 572 | ||
| 573 | return (0); | 573 | return 0; |
| 574 | } | 574 | } |
| 575 | 575 | ||
| 576 | 576 | ||
diff --git a/coreutils/tr.c b/coreutils/tr.c index f2c9065d1..237ade047 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c | |||
| @@ -249,5 +249,5 @@ int tr_main(int argc, char **argv) | |||
| 249 | outvec[(GCC4_IS_STUPID)output[i]] = TRUE; | 249 | outvec[(GCC4_IS_STUPID)output[i]] = TRUE; |
| 250 | } | 250 | } |
| 251 | convert(); | 251 | convert(); |
| 252 | return (0); | 252 | return 0; |
| 253 | } | 253 | } |
