From e4dcba1c103dc28e927e004791e331aaf604383d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 28 Oct 2010 18:57:19 +0200 Subject: *: whitespace fixes Signed-off-by: Denys Vlasenko --- archival/dpkg.c | 2 +- archival/gzip.c | 4 ++-- archival/libunarchive/decompress_uncompress.c | 4 ++-- coreutils/env.c | 6 +++--- coreutils/md5_sha1_sum.c | 6 +++--- coreutils/mkfifo.c | 2 +- coreutils/od.c | 28 +++++++++++++-------------- coreutils/rmdir.c | 2 +- coreutils/stat.c | 4 ++-- coreutils/stty.c | 6 +++--- coreutils/touch.c | 2 +- coreutils/tty.c | 4 ++-- coreutils/uniq.c | 2 +- e2fsprogs/old_e2fsprogs/ext2fs/bitops.c | 2 +- e2fsprogs/old_e2fsprogs/ext2fs/flushb.c | 6 +++--- e2fsprogs/old_e2fsprogs/ext2fs/inline.c | 4 ++-- e2fsprogs/old_e2fsprogs/ext2fs/ismounted.c | 10 +++++----- e2fsprogs/old_e2fsprogs/lsattr.c | 8 ++++---- e2fsprogs/tune2fs.c | 2 +- include/dump.h | 2 +- include/libbb.h | 4 ++-- include/platform.h | 2 +- init/mesg.c | 4 ++-- libbb/dump.c | 6 +++--- libbb/full_write.c | 2 +- libbb/human_readable.c | 4 ++-- libbb/inet_common.c | 2 +- libbb/inode_hash.c | 4 ++-- libbb/login.c | 2 +- libbb/make_directory.c | 2 +- libbb/parse_config.c | 2 +- libbb/parse_mode.c | 10 +++++----- libbb/progress.c | 6 +++--- libbb/speed_table.c | 4 ++-- libbb/update_passwd.c | 2 +- libbb/wfopen_input.c | 4 ++-- libbb/xatonum_template.c | 2 +- libbb/xgetcwd.c | 2 +- libpwdgrp/pwd_grp.c | 6 +++--- loginutils/chpasswd.c | 4 ++-- loginutils/cryptpw.c | 2 +- loginutils/getty.c | 4 ++-- loginutils/login.c | 4 ++-- miscutils/chat.c | 2 +- miscutils/crond.c | 4 ++-- miscutils/devfsd.c | 2 +- miscutils/flash_eraseall.c | 8 ++++---- miscutils/hdparm.c | 2 +- miscutils/last.c | 10 +++++----- miscutils/less.c | 6 +++--- miscutils/makedevs.c | 2 +- miscutils/mt.c | 2 +- miscutils/nandwrite.c | 12 ++++++------ miscutils/runlevel.c | 8 ++++---- miscutils/strings.c | 8 ++++---- miscutils/watchdog.c | 2 +- networking/brctl.c | 2 +- networking/ether-wake.c | 4 ++-- networking/ifupdown.c | 2 +- networking/libiproute/iplink.c | 2 +- networking/ping.c | 10 +++++----- networking/tc.c | 4 ++-- networking/tftp.c | 2 +- networking/udhcp/dhcpd.c | 2 +- networking/udhcp/dumpleases.c | 6 +++--- procps/powertop.c | 18 +++++++++-------- procps/renice.c | 6 +++--- runit/chpst.c | 6 +++--- runit/svlogd.c | 3 ++- shell/ash.c | 4 ++-- shell/hush.c | 4 ++-- sysklogd/logger.c | 6 +++--- util-linux/acpid.c | 2 +- util-linux/fdformat.c | 2 +- util-linux/fdisk_gpt.c | 2 +- util-linux/fdisk_sun.c | 2 +- util-linux/ipcrm.c | 7 +++---- util-linux/mkfs_ext2.c | 4 ++-- util-linux/mkfs_vfat.c | 2 +- util-linux/readprofile.c | 4 ++-- util-linux/rtcwake.c | 2 +- util-linux/script.c | 2 +- 82 files changed, 185 insertions(+), 183 deletions(-) diff --git a/archival/dpkg.c b/archival/dpkg.c index 07f0150..508b429 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c @@ -866,7 +866,7 @@ static void write_status_file(deb_file_t **deb_file) write_flag = TRUE; fputs("\n", new_status_file); } - else if (strcmp("config-files", name_hashtable[state_status]) == 0) { + else if (strcmp("config-files", name_hashtable[state_status]) == 0) { /* only change the status line */ while (1) { char *field_name; diff --git a/archival/gzip.c b/archival/gzip.c index 4d39906..80141f3 100644 --- a/archival/gzip.c +++ b/archival/gzip.c @@ -68,7 +68,7 @@ aa: 85.1% -- replaced with aa.gz */ #define SMALL_MEM -#ifndef INBUFSIZ +#ifndef INBUFSIZ # ifdef SMALL_MEM # define INBUFSIZ 0x2000 /* input buffer size */ # else @@ -76,7 +76,7 @@ aa: 85.1% -- replaced with aa.gz # endif #endif -#ifndef OUTBUFSIZ +#ifndef OUTBUFSIZ # ifdef SMALL_MEM # define OUTBUFSIZ 8192 /* output buffer size */ # else diff --git a/archival/libunarchive/decompress_uncompress.c b/archival/libunarchive/decompress_uncompress.c index 1ff89ce..285b4ef 100644 --- a/archival/libunarchive/decompress_uncompress.c +++ b/archival/libunarchive/decompress_uncompress.c @@ -29,10 +29,10 @@ /* Default input buffer size */ -#define IBUFSIZ 2048 +#define IBUFSIZ 2048 /* Default output buffer size */ -#define OBUFSIZ 2048 +#define OBUFSIZ 2048 /* Defines for third byte of header */ #define BIT_MASK 0x1f /* Mask for 'number of compresssion bits' */ diff --git a/coreutils/env.c b/coreutils/env.c index f50ee78..d64a714 100644 --- a/coreutils/env.c +++ b/coreutils/env.c @@ -3,7 +3,7 @@ * env implementation for busybox * * Copyright (c) 1988, 1993, 1994 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * Licensed under GPLv2 or later, see file LICENSE in this source tree. * @@ -103,8 +103,8 @@ int env_main(int argc UNUSED_PARAM, char **argv) * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * 3. + * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change + * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change * * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c index d3d294d..3b897c1 100644 --- a/coreutils/md5_sha1_sum.c +++ b/coreutils/md5_sha1_sum.c @@ -18,9 +18,9 @@ enum { HASH_SHA512 = '5', }; -#define FLAG_SILENT 1 -#define FLAG_CHECK 2 -#define FLAG_WARN 4 +#define FLAG_SILENT 1 +#define FLAG_CHECK 2 +#define FLAG_WARN 4 /* This might be useful elsewhere */ static unsigned char *hash_bin_to_hex(unsigned char *hash_value, diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c index 4388cca..d908ce4 100644 --- a/coreutils/mkfifo.c +++ b/coreutils/mkfifo.c @@ -30,7 +30,7 @@ int mkfifo_main(int argc UNUSED_PARAM, char **argv) do { if (mkfifo(*argv, mode) < 0) { - bb_simple_perror_msg(*argv); /* Avoid multibyte problems. */ + bb_simple_perror_msg(*argv); /* Avoid multibyte problems. */ retval = EXIT_FAILURE; } } while (*++argv); diff --git a/coreutils/od.c b/coreutils/od.c index 30b5bd6..dcd6934 100644 --- a/coreutils/od.c +++ b/coreutils/od.c @@ -110,7 +110,7 @@ odoffset(dumper_t *dumper, int argc, char ***argvp) * the offset is changed as well. This isn't pretty, * but it's easy. */ -#define TYPE_OFFSET 7 +#define TYPE_OFFSET 7 { char x_or_d; if (base == 16) { @@ -130,19 +130,19 @@ odoffset(dumper_t *dumper, int argc, char ***argvp) } static const char *const add_strings[] = { - "16/1 \"%3_u \" \"\\n\"", /* a */ - "8/2 \" %06o \" \"\\n\"", /* B, o */ - "16/1 \"%03o \" \"\\n\"", /* b */ - "16/1 \"%3_c \" \"\\n\"", /* c */ - "8/2 \" %05u \" \"\\n\"", /* d */ - "4/4 \" %010u \" \"\\n\"", /* D */ - "2/8 \" %21.14e \" \"\\n\"", /* e (undocumented in od), F */ - "4/4 \" %14.7e \" \"\\n\"", /* f */ - "4/4 \" %08x \" \"\\n\"", /* H, X */ - "8/2 \" %04x \" \"\\n\"", /* h, x */ - "4/4 \" %11d \" \"\\n\"", /* I, L, l */ - "8/2 \" %6d \" \"\\n\"", /* i */ - "4/4 \" %011o \" \"\\n\"", /* O */ + "16/1 \"%3_u \" \"\\n\"", /* a */ + "8/2 \" %06o \" \"\\n\"", /* B, o */ + "16/1 \"%03o \" \"\\n\"", /* b */ + "16/1 \"%3_c \" \"\\n\"", /* c */ + "8/2 \" %05u \" \"\\n\"", /* d */ + "4/4 \" %010u \" \"\\n\"", /* D */ + "2/8 \" %21.14e \" \"\\n\"", /* e (undocumented in od), F */ + "4/4 \" %14.7e \" \"\\n\"", /* f */ + "4/4 \" %08x \" \"\\n\"", /* H, X */ + "8/2 \" %04x \" \"\\n\"", /* h, x */ + "4/4 \" %11d \" \"\\n\"", /* I, L, l */ + "8/2 \" %6d \" \"\\n\"", /* i */ + "4/4 \" %011o \" \"\\n\"", /* O */ }; static const char od_opts[] ALIGN1 = "aBbcDdeFfHhIiLlOoXxv"; diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index 75bfc28..231793c 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c @@ -50,7 +50,7 @@ int rmdir_main(int argc UNUSED_PARAM, char **argv) if ((flags & IGNORE_NON_EMPTY) && errno == ENOTEMPTY) break; #endif - bb_perror_msg("'%s'", path); /* Match gnu rmdir msg. */ + bb_perror_msg("'%s'", path); /* Match gnu rmdir msg. */ status = EXIT_FAILURE; } else if (flags & PARENTS) { /* Note: path was not "" since rmdir succeeded. */ diff --git a/coreutils/stat.c b/coreutils/stat.c index d176d07..b4e6f10 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c @@ -469,7 +469,7 @@ static bool do_statfs(const char *filename, const char *format) if (scontext) freecon(scontext); # endif -#endif /* FEATURE_STAT_FORMAT */ +#endif /* FEATURE_STAT_FORMAT */ return 1; } @@ -635,7 +635,7 @@ static bool do_stat(const char *filename, const char *format) human_time(statbuf.st_mtime), human_time(statbuf.st_ctime)); } -#endif /* FEATURE_STAT_FORMAT */ +#endif /* FEATURE_STAT_FORMAT */ return 1; } diff --git a/coreutils/stty.c b/coreutils/stty.c index 0cb4fb2..e28e15c 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -1110,16 +1110,16 @@ static void set_mode(const struct mode_info *info, int reversed, if (reversed) mode->c_cflag = (mode->c_cflag & ~PARENB & ~CSIZE) | CS8; else - mode->c_cflag = (mode->c_cflag & ~PARODD & ~CSIZE) | PARENB | CS7; + mode->c_cflag = (mode->c_cflag & ~PARODD & ~CSIZE) | PARENB | CS7; } else if (info == &mode_info[IDX_oddp]) { if (reversed) mode->c_cflag = (mode->c_cflag & ~PARENB & ~CSIZE) | CS8; else - mode->c_cflag = (mode->c_cflag & ~CSIZE) | CS7 | PARODD | PARENB; + mode->c_cflag = (mode->c_cflag & ~CSIZE) | CS7 | PARODD | PARENB; } else if (info == &mode_info[IDX_nl]) { if (reversed) { mode->c_iflag = (mode->c_iflag | ICRNL) & ~INLCR & ~IGNCR; - mode->c_oflag = (mode->c_oflag | ONLCR) & ~OCRNL & ~ONLRET; + mode->c_oflag = (mode->c_oflag | ONLCR) & ~OCRNL & ~ONLRET; } else { mode->c_iflag = mode->c_iflag & ~ICRNL; if (ONLCR) mode->c_oflag = mode->c_oflag & ~ONLCR; diff --git a/coreutils/touch.c b/coreutils/touch.c index 03aac3a..afff36b 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c @@ -97,7 +97,7 @@ int touch_main(int argc UNUSED_PARAM, char **argv) parse_datestr(date_str, &tm_time); /* Correct any day of week and day of year etc. fields */ - tm_time.tm_isdst = -1; /* Be sure to recheck dst */ + tm_time.tm_isdst = -1; /* Be sure to recheck dst */ t = validate_tm_time(date_str, &tm_time); timebuf[1].tv_sec = timebuf[0].tv_sec = t; diff --git a/coreutils/tty.c b/coreutils/tty.c index 4891813..282d968 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c @@ -16,10 +16,10 @@ int tty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int tty_main(int argc UNUSED_PARAM, char **argv) { const char *s; - IF_INCLUDE_SUSv2(int silent;) /* Note: No longer relevant in SUSv3. */ + IF_INCLUDE_SUSv2(int silent;) /* Note: No longer relevant in SUSv3. */ int retval; - xfunc_error_retval = 2; /* SUSv3 requires > 1 for error. */ + xfunc_error_retval = 2; /* SUSv3 requires > 1 for error. */ IF_INCLUDE_SUSv2(silent = getopt32(argv, "s");) IF_INCLUDE_SUSv2(argv += optind;) diff --git a/coreutils/uniq.c b/coreutils/uniq.c index 358de78..decf7e4 100644 --- a/coreutils/uniq.c +++ b/coreutils/uniq.c @@ -86,7 +86,7 @@ int uniq_main(int argc UNUSED_PARAM, char **argv) } free(cur_line); - ++dups; /* testing for overflow seems excessive */ + ++dups; /* testing for overflow seems excessive */ } if (old_line) { diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/bitops.c b/e2fsprogs/old_e2fsprogs/ext2fs/bitops.c index 3cf1579..3d08394 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/bitops.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/bitops.c @@ -65,7 +65,7 @@ int ext2fs_test_bit(unsigned int nr, const void * addr) return (mask & *ADDR); } -#endif /* !_EXT2_HAVE_ASM_BITOPS_ */ +#endif /* !_EXT2_HAVE_ASM_BITOPS_ */ void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg, const char *description) diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/flushb.c b/e2fsprogs/old_e2fsprogs/ext2fs/flushb.c index e429826..45ed765 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/flushb.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/flushb.c @@ -23,7 +23,7 @@ #endif #if HAVE_SYS_MOUNT_H #include -#include /* This may define BLKFLSBUF */ +#include /* This may define BLKFLSBUF */ #endif #include "ext2_fs.h" @@ -38,10 +38,10 @@ */ #ifdef __linux__ #ifndef BLKFLSBUF -#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */ +#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */ #endif #ifndef FDFLUSH -#define FDFLUSH _IO(2,0x4b) /* flush floppy disk */ +#define FDFLUSH _IO(2,0x4b) /* flush floppy disk */ #endif #endif diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/inline.c b/e2fsprogs/old_e2fsprogs/ext2fs/inline.c index d328cc9..7457b93 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/inline.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/inline.c @@ -1,8 +1,8 @@ /* vi: set sw=4 ts=4: */ /* * inline.c --- Includes the inlined functions defined in the header - * files as standalone functions, in case the application program - * is compiled with inlining turned off. + * files as standalone functions, in case the application program + * is compiled with inlining turned off. * * Copyright (C) 1993, 1994 Theodore Ts'o. * diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/ismounted.c b/e2fsprogs/old_e2fsprogs/ext2fs/ismounted.c index 7f24f9b..f5f6f31 100644 --- a/e2fsprogs/old_e2fsprogs/ext2fs/ismounted.c +++ b/e2fsprogs/old_e2fsprogs/ext2fs/ismounted.c @@ -59,7 +59,7 @@ static errcode_t check_mntent_file(const char *mtab_file, const char *file, if (S_ISBLK(st_buf.st_mode)) { #ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */ file_rdev = st_buf.st_rdev; -#endif /* __GNU__ */ +#endif /* __GNU__ */ } else { file_dev = st_buf.st_dev; file_ino = st_buf.st_ino; @@ -73,7 +73,7 @@ static errcode_t check_mntent_file(const char *mtab_file, const char *file, #ifndef __GNU__ if (file_rdev && (file_rdev == st_buf.st_rdev)) break; -#endif /* __GNU__ */ +#endif /* __GNU__ */ } else { if (file_dev && ((file_dev == st_buf.st_dev) && (file_ino == st_buf.st_ino))) @@ -99,7 +99,7 @@ static errcode_t check_mntent_file(const char *mtab_file, const char *file, goto is_root; } } -#endif /* __GNU__ */ +#endif /* __GNU__ */ goto errout; } #ifndef __GNU__ /* The GNU hurd is deficient; what else is new? */ @@ -247,7 +247,7 @@ static int is_swap_device(const char *file) if ((stat(file, &st_buf) == 0) && S_ISBLK(st_buf.st_mode)) file_dev = st_buf.st_rdev; -#endif /* __GNU__ */ +#endif /* __GNU__ */ if (!(f = fopen_for_read("/proc/swaps"))) return 0; @@ -271,7 +271,7 @@ static int is_swap_device(const char *file) ret++; break; } -#endif /* __GNU__ */ +#endif /* __GNU__ */ } fclose(f); return ret; diff --git a/e2fsprogs/old_e2fsprogs/lsattr.c b/e2fsprogs/old_e2fsprogs/lsattr.c index 294bf2f..9e0e4cb 100644 --- a/e2fsprogs/old_e2fsprogs/lsattr.c +++ b/e2fsprogs/old_e2fsprogs/lsattr.c @@ -12,10 +12,10 @@ /* * History: - * 93/10/30 - Creation - * 93/11/13 - Replace stat() calls by lstat() to avoid loops - * 94/02/27 - Integrated in Ted's distribution - * 98/12/29 - Display version info only when -V specified (G M Sipe) + * 93/10/30 - Creation + * 93/11/13 - Replace stat() calls by lstat() to avoid loops + * 94/02/27 - Integrated in Ted's distribution + * 98/12/29 - Display version info only when -V specified (G M Sipe) */ #include diff --git a/e2fsprogs/tune2fs.c b/e2fsprogs/tune2fs.c index 75e4f6b..9daec54 100644 --- a/e2fsprogs/tune2fs.c +++ b/e2fsprogs/tune2fs.c @@ -43,7 +43,7 @@ do { \ //usage: "Adjust filesystem options on ext[23] filesystems" enum { - OPT_L = 1 << 0, // label + OPT_L = 1 << 0, // label OPT_c = 1 << 1, // max mount count OPT_i = 1 << 2, // check interval }; diff --git a/include/dump.h b/include/dump.h index 925270d..4c237ef 100644 --- a/include/dump.h +++ b/include/dump.h @@ -45,7 +45,7 @@ typedef struct FS { /* format strings */ typedef struct dumper_t { off_t dump_skip; /* bytes to skip */ int dump_length; /* max bytes to read */ - smallint dump_vflag; /*enum dump_vflag_t*/ + smallint dump_vflag; /*enum dump_vflag_t*/ FS *fshead; } dumper_t; diff --git a/include/libbb.h b/include/libbb.h index 587a5f9..7c1db3f 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -220,11 +220,11 @@ typedef unsigned long uoff_t; /* Macros for min/max. */ #ifndef MIN -#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MIN(a,b) (((a)<(b))?(a):(b)) #endif #ifndef MAX -#define MAX(a,b) (((a)>(b))?(a):(b)) +#define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* buffer allocation schemes */ diff --git a/include/platform.h b/include/platform.h index 6563276..855cb28 100644 --- a/include/platform.h +++ b/include/platform.h @@ -4,7 +4,7 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ -#ifndef BB_PLATFORM_H +#ifndef BB_PLATFORM_H #define BB_PLATFORM_H 1 /* Assume all these functions exist by default. Platforms where it is not diff --git a/init/mesg.c b/init/mesg.c index b560df2..b6fd070 100644 --- a/init/mesg.c +++ b/init/mesg.c @@ -28,9 +28,9 @@ #include "libbb.h" #ifdef USE_TTY_GROUP -#define S_IWGRP_OR_S_IWOTH S_IWGRP +#define S_IWGRP_OR_S_IWOTH S_IWGRP #else -#define S_IWGRP_OR_S_IWOTH (S_IWGRP | S_IWOTH) +#define S_IWGRP_OR_S_IWOTH (S_IWGRP | S_IWOTH) #endif int mesg_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; diff --git a/libbb/dump.c b/libbb/dump.c index 4db3f06..1b1d03a 100644 --- a/libbb/dump.c +++ b/libbb/dump.c @@ -4,7 +4,7 @@ * based on code from util-linux v 2.11l * * Copyright (c) 1989 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * Licensed under GPLv2 or later, see file LICENSE in this source tree. * @@ -208,7 +208,7 @@ static NOINLINE void rewrite(priv_dumper_t *dumper, FS *fs) pr->bcnt = fu->bcnt; } else if (sokay == USEPREC) { pr->bcnt = prec; - } else { /* NOTOKAY */ + } else { /* NOTOKAY */ bb_error_msg_and_die("%%s requires a precision or a byte count"); } } else if (*p1 == '_') { @@ -467,7 +467,7 @@ static void bpad(PR *pr) static const char conv_str[] ALIGN1 = "\0\\0\0" - "\007\\a\0" /* \a */ + "\007\\a\0" /* \a */ "\b\\b\0" "\f\\b\0" "\n\\n\0" diff --git a/libbb/full_write.c b/libbb/full_write.c index a2abaee..777fbd9 100644 --- a/libbb/full_write.c +++ b/libbb/full_write.c @@ -30,7 +30,7 @@ ssize_t FAST_FUNC full_write(int fd, const void *buf, size_t len) /* user can do another write to know the error code */ return total; } - return cc; /* write() returns -1 on failure. */ + return cc; /* write() returns -1 on failure. */ } total += cc; diff --git a/libbb/human_readable.c b/libbb/human_readable.c index 50cbe41..8b22b0c 100644 --- a/libbb/human_readable.c +++ b/libbb/human_readable.c @@ -53,8 +53,8 @@ const char* FAST_FUNC make_human_readable_str(unsigned long long val, u = unit_chars; if (display_unit) { - val += display_unit/2; /* Deal with rounding */ - val /= display_unit; /* Don't combine with the line above! */ + val += display_unit/2; /* Deal with rounding */ + val /= display_unit; /* Don't combine with the line above! */ /* will just print it as ulonglong (below) */ } else { while ((val >= 1024) diff --git a/libbb/inet_common.c b/libbb/inet_common.c index e031ddf..6f585eb 100644 --- a/libbb/inet_common.c +++ b/libbb/inet_common.c @@ -218,4 +218,4 @@ char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) return xstrdup(name); } -#endif /* CONFIG_FEATURE_IPV6 */ +#endif /* CONFIG_FEATURE_IPV6 */ diff --git a/libbb/inode_hash.c b/libbb/inode_hash.c index 2aea08b..715535e 100644 --- a/libbb/inode_hash.c +++ b/libbb/inode_hash.c @@ -17,8 +17,8 @@ typedef struct ino_dev_hash_bucket_struct { char name[1]; } ino_dev_hashtable_bucket_t; -#define HASH_SIZE 311 /* Should be prime */ -#define hash_inode(i) ((i) % HASH_SIZE) +#define HASH_SIZE 311 /* Should be prime */ +#define hash_inode(i) ((i) % HASH_SIZE) /* array of [HASH_SIZE] elements */ static ino_dev_hashtable_bucket_t **ino_dev_hashtable; diff --git a/libbb/login.c b/libbb/login.c index aa2e171..8a82c6a 100644 --- a/libbb/login.c +++ b/libbb/login.c @@ -30,7 +30,7 @@ void FAST_FUNC print_login_issue(const char *issue_file, const char *tty) time(&t); uname(&uts); - puts("\r"); /* start a new line */ + puts("\r"); /* start a new line */ fp = fopen_for_read(issue_file); if (!fp) diff --git a/libbb/make_directory.c b/libbb/make_directory.c index 1350e8b..72303e7 100644 --- a/libbb/make_directory.c +++ b/libbb/make_directory.c @@ -44,7 +44,7 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags) while (1) { c = '\0'; - if (flags & FILEUTILS_RECUR) { /* Get the parent */ + if (flags & FILEUTILS_RECUR) { /* Get the parent */ /* Bypass leading non-'/'s and then subsequent '/'s */ while (*s) { if (*s == '/') { diff --git a/libbb/parse_config.c b/libbb/parse_config.c index 9dbfaf5..d471edb 100644 --- a/libbb/parse_config.c +++ b/libbb/parse_config.c @@ -45,7 +45,7 @@ int parse_main(int argc UNUSED_PARAM, char **argv) Typical usage: ----- CUT ----- - char *t[3]; // tokens placeholder + char *t[3]; // tokens placeholder parser_t *p = config_open(filename); if (p) { // parse line-by-line diff --git a/libbb/parse_mode.c b/libbb/parse_mode.c index 8ea8916..5a4e1c5 100644 --- a/libbb/parse_mode.c +++ b/libbb/parse_mode.c @@ -57,8 +57,8 @@ int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode) /* Note: we allow empty clauses, and hence empty modes. * We treat an empty mode as no change to perms. */ - while (*s) { /* Process clauses. */ - if (*s == ',') { /* We allow empty clauses. */ + while (*s) { /* Process clauses. */ + if (*s == ',') { /* We allow empty clauses. */ ++s; continue; } @@ -77,7 +77,7 @@ int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode) } } while (*++p); - do { /* Process action list. */ + do { /* Process action list. */ if ((*s != '+') && (*s != '-')) { if (*s != '=') { return 0; @@ -93,7 +93,7 @@ int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode) op = *s++; /* Check for permcopy. */ - p = who_chars + 1; /* Skip 'a' entry. */ + p = who_chars + 1; /* Skip 'a' entry. */ do { if (*p == *s) { int i = 0; @@ -128,7 +128,7 @@ int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode) } } while (*++p); GOT_ACTION: - if (permlist) { /* The permlist was nonempty. */ + if (permlist) { /* The permlist was nonempty. */ mode_t tmp = wholist; if (!wholist) { mode_t u_mask = umask(0); diff --git a/libbb/progress.c b/libbb/progress.c index f532713..4c2763c 100644 --- a/libbb/progress.c +++ b/libbb/progress.c @@ -7,7 +7,7 @@ */ /*- * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -18,8 +18,8 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * 3. + * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change + * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change * * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software diff --git a/libbb/speed_table.c b/libbb/speed_table.c index 6f95c54..45159f1 100644 --- a/libbb/speed_table.c +++ b/libbb/speed_table.c @@ -29,12 +29,12 @@ static const struct speed_map speeds[] = { {B2400, 2400}, {B4800, 4800}, {B9600, 9600}, -#ifdef B19200 +#ifdef B19200 {B19200, 19200}, #elif defined(EXTA) {EXTA, 19200}, #endif -#ifdef B38400 +#ifdef B38400 {B38400, 38400/256 + 0x8000U}, #elif defined(EXTB) {EXTB, 38400/256 + 0x8000U}, diff --git a/libbb/update_passwd.c b/libbb/update_passwd.c index a2be0f1..dc50292 100644 --- a/libbb/update_passwd.c +++ b/libbb/update_passwd.c @@ -22,7 +22,7 @@ static void check_selinux_update_passwd(const char *username) char *seuser; if (getuid() != (uid_t)0 || is_selinux_enabled() == 0) - return; /* No need to check */ + return; /* No need to check */ if (getprevcon_raw(&context) < 0) bb_perror_msg_and_die("getprevcon failed"); diff --git a/libbb/wfopen_input.c b/libbb/wfopen_input.c index 422a58e..d8b1c4a 100644 --- a/libbb/wfopen_input.c +++ b/libbb/wfopen_input.c @@ -31,7 +31,7 @@ FILE* FAST_FUNC xfopen_stdin(const char *filename) FILE *fp = fopen_or_warn_stdin(filename); if (fp) return fp; - xfunc_die(); /* We already output an error message. */ + xfunc_die(); /* We already output an error message. */ } int FAST_FUNC open_or_warn_stdin(const char *filename) @@ -52,5 +52,5 @@ int FAST_FUNC xopen_stdin(const char *filename) int fd = open_or_warn_stdin(filename); if (fd >= 0) return fd; - xfunc_die(); /* We already output an error message. */ + xfunc_die(); /* We already output an error message. */ } diff --git a/libbb/xatonum_template.c b/libbb/xatonum_template.c index f67b507..029f662 100644 --- a/libbb/xatonum_template.c +++ b/libbb/xatonum_template.c @@ -41,7 +41,7 @@ unsigned type FAST_FUNC xstrtou(_range_sfx)(const char *numstr, int base, if (errno || numstr == e) goto inval; /* error / no digits / illegal trailing chars */ - errno = old_errno; /* Ok. So restore errno. */ + errno = old_errno; /* Ok. So restore errno. */ /* Do optional suffix parsing. Allow 'empty' suffix tables. * Note that we also allow nul suffixes with associated multipliers, diff --git a/libbb/xgetcwd.c b/libbb/xgetcwd.c index 9736721..71720d3 100644 --- a/libbb/xgetcwd.c +++ b/libbb/xgetcwd.c @@ -24,7 +24,7 @@ xrealloc_getcwd_or_warn(char *cwd) char *ret; unsigned path_max; - path_max = 128; /* 128 + 64 should be enough for 99% of cases */ + path_max = 128; /* 128 + 64 should be enough for 99% of cases */ while (1) { path_max += PATH_INCR; diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c index 06f3607..abb6f18 100644 --- a/libpwdgrp/pwd_grp.c +++ b/libpwdgrp/pwd_grp.c @@ -21,13 +21,13 @@ #include #ifndef _PATH_SHADOW -#define _PATH_SHADOW "/etc/shadow" +#define _PATH_SHADOW "/etc/shadow" #endif #ifndef _PATH_PASSWD -#define _PATH_PASSWD "/etc/passwd" +#define _PATH_PASSWD "/etc/passwd" #endif #ifndef _PATH_GROUP -#define _PATH_GROUP "/etc/group" +#define _PATH_GROUP "/etc/group" #endif /**********************************************************************/ diff --git a/loginutils/chpasswd.c b/loginutils/chpasswd.c index 101920c..48cf9b1 100644 --- a/loginutils/chpasswd.c +++ b/loginutils/chpasswd.c @@ -14,8 +14,8 @@ static const char chpasswd_longopts[] ALIGN1 = ; #endif -#define OPT_ENC 1 -#define OPT_MD5 2 +#define OPT_ENC 1 +#define OPT_MD5 2 int chpasswd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int chpasswd_main(int argc UNUSED_PARAM, char **argv) diff --git a/loginutils/cryptpw.c b/loginutils/cryptpw.c index f32cbce..6c801f9 100644 --- a/loginutils/cryptpw.c +++ b/loginutils/cryptpw.c @@ -104,7 +104,7 @@ int cryptpw_main(int argc UNUSED_PARAM, char **argv) xmove_fd(fd, STDIN_FILENO); puts(pw_encrypt( - argv[0] ? argv[0] : ( + argv[0] ? argv[0] : ( /* Only mkpasswd, and only from tty, prompts. * Otherwise it is a plain read. */ (isatty(STDIN_FILENO) && applet_name[0] == 'm') diff --git a/loginutils/getty.c b/loginutils/getty.c index ab55ea4..76b0de4 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c @@ -387,7 +387,7 @@ static char *get_logname(char *logname, unsigned size_logname, struct options *op, struct chardata *cp) { char *bp; - char c; /* input character, full eight bits */ + char c; /* input character, full eight bits */ char ascval; /* low 7 bits of input character */ int bits; /* # of "1" bits per character */ int mask; /* mask with 1 bit up */ @@ -580,7 +580,7 @@ int getty_main(int argc UNUSED_PARAM, char **argv) chardata = init_chardata; memset(&options, 0, sizeof(options)); - options.login = _PATH_LOGIN; /* default login program */ + options.login = _PATH_LOGIN; /* default login program */ options.tty = "tty1"; /* default tty line */ options.initstring = ""; /* modem init string */ #ifdef ISSUE diff --git a/loginutils/login.c b/loginutils/login.c index 3065eaa..9a624df 100644 --- a/loginutils/login.c +++ b/loginutils/login.c @@ -124,7 +124,7 @@ static void run_login_script(struct passwd *pw, char *full_tty) xsetenv("LOGIN_UID", utoa(pw->pw_uid)); xsetenv("LOGIN_GID", utoa(pw->pw_gid)); xsetenv("LOGIN_SHELL", pw->pw_shell); - spawn_and_wait(t_argv); /* NOMMU-friendly */ + spawn_and_wait(t_argv); /* NOMMU-friendly */ unsetenv("LOGIN_TTY"); unsetenv("LOGIN_USER"); unsetenv("LOGIN_UID"); @@ -245,7 +245,7 @@ int login_main(int argc UNUSED_PARAM, char **argv) /* Let's find out and memorize our tty */ if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO) || !isatty(STDERR_FILENO)) - return EXIT_FAILURE; /* Must be a terminal */ + return EXIT_FAILURE; /* Must be a terminal */ full_tty = xmalloc_ttyname(STDIN_FILENO); if (!full_tty) full_tty = xstrdup("UNKNOWN"); diff --git a/miscutils/chat.c b/miscutils/chat.c index 2040c3f..8b151fd 100644 --- a/miscutils/chat.c +++ b/miscutils/chat.c @@ -10,7 +10,7 @@ #include "libbb.h" // default timeout: 45 sec -#define DEFAULT_CHAT_TIMEOUT 45*1000 +#define DEFAULT_CHAT_TIMEOUT 45*1000 // max length of "abort string", // i.e. device reply which causes termination #define MAX_ABORT_LEN 50 diff --git a/miscutils/crond.c b/miscutils/crond.c index 7f2d54c..5bf0536 100644 --- a/miscutils/crond.c +++ b/miscutils/crond.c @@ -35,7 +35,7 @@ # define CRONUPDATE "cron.update" #endif #ifndef MAXLINES -# define MAXLINES 256 /* max lines in non-root crontabs */ +# define MAXLINES 256 /* max lines in non-root crontabs */ #endif @@ -170,7 +170,7 @@ static void ParseField(char *user, char *ary, int modvalue, int off, /* Handle numeric digit or symbol or '*' */ if (*ptr == '*') { - n1 = 0; /* everything will be filled */ + n1 = 0; /* everything will be filled */ n2 = modvalue - 1; skip = 1; ++ptr; diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index 8f19288..35e4319 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c @@ -75,7 +75,7 @@ /* Various defines taken from linux/devfs_fs.h */ #define DEVFSD_PROTOCOL_REVISION_KERNEL 5 -#define DEVFSD_IOCTL_BASE 'd' +#define DEVFSD_IOCTL_BASE 'd' /* These are the various ioctls */ #define DEVFSDIOC_GET_PROTO_REV _IOR(DEVFSD_IOCTL_BASE, 0, int) #define DEVFSDIOC_SET_EVENT_MASK _IOW(DEVFSD_IOCTL_BASE, 2, int) diff --git a/miscutils/flash_eraseall.c b/miscutils/flash_eraseall.c index b832cc1..68596e1 100644 --- a/miscutils/flash_eraseall.c +++ b/miscutils/flash_eraseall.c @@ -14,10 +14,10 @@ #include #include -#define OPTION_J (1 << 0) -#define OPTION_Q (1 << 1) -#define IS_NAND (1 << 2) -#define BBTEST (1 << 3) +#define OPTION_J (1 << 0) +#define OPTION_Q (1 << 1) +#define IS_NAND (1 << 2) +#define BBTEST (1 << 3) /* mtd/jffs2-user.h used to have this atrocity: extern int target_endian; diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index d946c71..38b265d 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c @@ -1745,7 +1745,7 @@ static void process_dev(char *devname) if (-1 == read(fd, buf, sizeof(buf))) bb_perror_msg("read of 512 bytes failed"); } -#endif /* HDIO_DRIVE_CMD */ +#endif /* HDIO_DRIVE_CMD */ if (getset_mult || get_identity) { multcount = -1; if (ioctl(fd, HDIO_GET_MULTCOUNT, &multcount)) { diff --git a/miscutils/last.c b/miscutils/last.c index 888a0a3..fec5b70 100644 --- a/miscutils/last.c +++ b/miscutils/last.c @@ -46,14 +46,14 @@ int last_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) static const char _ut_lin[] ALIGN1 = "~\0" "{\0" "|\0" /* "LOGIN\0" "date\0" */; enum { - TYPE_RUN_LVL = RUN_LVL, /* 1 */ - TYPE_BOOT_TIME = BOOT_TIME, /* 2 */ + TYPE_RUN_LVL = RUN_LVL, /* 1 */ + TYPE_BOOT_TIME = BOOT_TIME, /* 2 */ TYPE_SHUTDOWN_TIME = SHUTDOWN_TIME }; enum { - _TILDE = EMPTY, /* 0 */ - TYPE_NEW_TIME, /* NEW_TIME, 3 */ - TYPE_OLD_TIME /* OLD_TIME, 4 */ + _TILDE = EMPTY, /* 0 */ + TYPE_NEW_TIME, /* NEW_TIME, 3 */ + TYPE_OLD_TIME /* OLD_TIME, 4 */ }; if (argv[1]) { diff --git a/miscutils/less.c b/miscutils/less.c index d737e4c..500059d 100644 --- a/miscutils/less.c +++ b/miscutils/less.c @@ -21,7 +21,7 @@ * redirected input has been read from stdin */ -#include /* sched_yield() */ +#include /* sched_yield() */ #include "libbb.h" #if ENABLE_FEATURE_LESS_REGEXP @@ -477,7 +477,7 @@ static void m_status_print(void) { int percentage; - if (less_gets_pos >= 0) /* don't touch statusline while input is done! */ + if (less_gets_pos >= 0) /* don't touch statusline while input is done! */ return; clear_line(); @@ -503,7 +503,7 @@ static void status_print(void) { const char *p; - if (less_gets_pos >= 0) /* don't touch statusline while input is done! */ + if (less_gets_pos >= 0) /* don't touch statusline while input is done! */ return; /* Change the status if flags have been set */ diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c index bba7fa6..e74c47c 100644 --- a/miscutils/makedevs.c +++ b/miscutils/makedevs.c @@ -121,7 +121,7 @@ int makedevs_main(int argc UNUSED_PARAM, char **argv) if ((2 > sscanf(line, "%40s %c %o %40s %40s %u %u %u %u %u", name, &type, &mode, user, group, - &major, &minor, &start, &increment, &count)) + &major, &minor, &start, &increment, &count)) || ((unsigned)(major | minor | start | count | increment) > 255) ) { bb_error_msg("invalid line %d: '%s'", linenum, line); diff --git a/miscutils/mt.c b/miscutils/mt.c index d19866a..142901b 100644 --- a/miscutils/mt.c +++ b/miscutils/mt.c @@ -108,7 +108,7 @@ int mt_main(int argc UNUSED_PARAM, char **argv) if (argv[2]) op.mt_count = xatoi_positive(argv[2]); else - op.mt_count = 1; /* One, not zero, right? */ + op.mt_count = 1; /* One, not zero, right? */ switch (opcode_value[idx]) { case MTWEOF: diff --git a/miscutils/nandwrite.c b/miscutils/nandwrite.c index de30a0c..831d2f7 100644 --- a/miscutils/nandwrite.c +++ b/miscutils/nandwrite.c @@ -53,12 +53,12 @@ #define IS_NANDDUMP (ENABLE_NANDDUMP && (!ENABLE_NANDWRITE || (applet_name[4] == 'd'))) #define IS_NANDWRITE (ENABLE_NANDWRITE && (!ENABLE_NANDDUMP || (applet_name[4] != 'd'))) -#define OPT_p (1 << 0) /* nandwrite only */ -#define OPT_o (1 << 0) /* nanddump only */ -#define OPT_s (1 << 1) -#define OPT_b (1 << 2) -#define OPT_f (1 << 3) -#define OPT_l (1 << 4) +#define OPT_p (1 << 0) /* nandwrite only */ +#define OPT_o (1 << 0) /* nanddump only */ +#define OPT_s (1 << 1) +#define OPT_b (1 << 2) +#define OPT_f (1 << 3) +#define OPT_l (1 << 4) /* helper for writing out 0xff for bad blocks pad */ static void dump_bad(struct mtd_info_user *meminfo, unsigned len, int oob) diff --git a/miscutils/runlevel.c b/miscutils/runlevel.c index 608e87f..363e450 100644 --- a/miscutils/runlevel.c +++ b/miscutils/runlevel.c @@ -1,11 +1,11 @@ /* vi: set sw=4 ts=4: */ /* - * runlevel Prints out the previous and the current runlevel. + * Prints out the previous and the current runlevel. * - * Version: @(#)runlevel 1.20 16-Apr-1997 MvS + * Version: @(#)runlevel 1.20 16-Apr-1997 MvS * - * This file is part of the sysvinit suite, - * Copyright 1991-1997 Miquel van Smoorenburg. + * This file is part of the sysvinit suite, + * Copyright 1991-1997 Miquel van Smoorenburg. * * Licensed under GPLv2 or later, see file LICENSE in this source tree. * diff --git a/miscutils/strings.c b/miscutils/strings.c index 40478de..7ab0e22 100644 --- a/miscutils/strings.c +++ b/miscutils/strings.c @@ -9,10 +9,10 @@ #include "libbb.h" -#define WHOLE_FILE 1 -#define PRINT_NAME 2 -#define PRINT_OFFSET 4 -#define SIZE 8 +#define WHOLE_FILE 1 +#define PRINT_NAME 2 +#define PRINT_OFFSET 4 +#define SIZE 8 int strings_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int strings_main(int argc UNUSED_PARAM, char **argv) diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index 3325396..36902a2 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c @@ -21,7 +21,7 @@ static void watchdog_shutdown(int sig UNUSED_PARAM) { static const char V = 'V'; - write(3, &V, 1); /* Magic, see watchdog-api.txt in kernel */ + write(3, &V, 1); /* Magic, see watchdog-api.txt in kernel */ if (ENABLE_FEATURE_CLEAN_UP) close(3); exit(EXIT_SUCCESS); diff --git a/networking/brctl.c b/networking/brctl.c index 0defce4..c0b094e 100644 --- a/networking/brctl.c +++ b/networking/brctl.c @@ -184,7 +184,7 @@ int brctl_main(int argc UNUSED_PARAM, char **argv) tabs = 1; printf("\t\t%s\n", ifname); } - if (!tabs) /* bridge has no interfaces */ + if (!tabs) /* bridge has no interfaces */ bb_putchar('\n'); } goto done; diff --git a/networking/ether-wake.c b/networking/ether-wake.c index 121f153..8f1479c 100644 --- a/networking/ether-wake.c +++ b/networking/ether-wake.c @@ -189,12 +189,12 @@ int ether_wake_main(int argc UNUSED_PARAM, char **argv) unsigned flags; unsigned char wol_passwd[6]; int wol_passwd_sz = 0; - int s; /* Raw socket */ + int s; /* Raw socket */ int pktsize; unsigned char outpack[1000]; struct ether_addr eaddr; - struct whereto_t whereto; /* who to wake up */ + struct whereto_t whereto; /* who to wake up */ /* handle misc user options */ opt_complementary = "=1"; diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 864fc2a..3cb1ec8 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -644,7 +644,7 @@ static const struct address_family_t addr_inet = { methods }; -#endif /* if ENABLE_FEATURE_IFUPDOWN_IPV4 */ +#endif /* if ENABLE_FEATURE_IFUPDOWN_IPV4 */ /* Returns pointer to the next word, or NULL. * In 1st case, advances *buf to the word after this one. diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c index f9421fc..c5ba294 100644 --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c @@ -21,7 +21,7 @@ #endif /* taken from linux/sockios.h */ -#define SIOCSIFNAME 0x8923 /* set interface name */ +#define SIOCSIFNAME 0x8923 /* set interface name */ /* Exits on error */ static int get_ctl_fd(void) diff --git a/networking/ping.c b/networking/ping.c index e18d88e..3aba490 100644 --- a/networking/ping.c +++ b/networking/ping.c @@ -297,11 +297,11 @@ void BUG_ping_globals_too_big(void); } while (0) -#define A(bit) rcvd_tbl[(bit)>>3] /* identify byte in array */ -#define B(bit) (1 << ((bit) & 0x07)) /* identify bit in byte */ -#define SET(bit) (A(bit) |= B(bit)) -#define CLR(bit) (A(bit) &= (~B(bit))) -#define TST(bit) (A(bit) & B(bit)) +#define A(bit) rcvd_tbl[(bit)>>3] /* identify byte in array */ +#define B(bit) (1 << ((bit) & 0x07)) /* identify bit in byte */ +#define SET(bit) (A(bit) |= B(bit)) +#define CLR(bit) (A(bit) &= (~B(bit))) +#define TST(bit) (A(bit) & B(bit)) /**************************************************************************/ diff --git a/networking/tc.c b/networking/tc.c index 48d1642..9242741 100644 --- a/networking/tc.c +++ b/networking/tc.c @@ -1,10 +1,10 @@ /* vi: set sw=4 ts=4: */ /* - * tc.c "tc" utility frontend. + * "tc" utility frontend. * * Licensed under GPLv2 or later, see file LICENSE in this source tree. * - * Authors: Alexey Kuznetsov, + * Authors: Alexey Kuznetsov, * * Bernhard Reutner-Fischer adjusted for busybox */ diff --git a/networking/tftp.c b/networking/tftp.c index 0269a93..04c8f0e 100644 --- a/networking/tftp.c +++ b/networking/tftp.c @@ -447,7 +447,7 @@ static int tftp_protocol( /* NB: send_len value is preserved in code below * for potential resend */ - retries = TFTP_NUM_RETRIES; /* re-initialize */ + retries = TFTP_NUM_RETRIES; /* re-initialize */ waittime_ms = TFTP_TIMEOUT_MS; send_again: diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index f087865..a015cf0 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c @@ -413,7 +413,7 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv) case SIGTERM: bb_info_msg("Received SIGTERM"); goto ret0; - case 0: /* no signal: read a packet */ + case 0: /* no signal: read a packet */ break; default: /* signal or error (probably EINTR): back to select */ continue; diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c index 46610fc..a15e409 100644 --- a/networking/udhcp/dumpleases.c +++ b/networking/udhcp/dumpleases.c @@ -18,9 +18,9 @@ int dumpleases_main(int argc UNUSED_PARAM, char **argv) struct in_addr addr; enum { - OPT_a = 0x1, // -a - OPT_r = 0x2, // -r - OPT_f = 0x4, // -f + OPT_a = 0x1, // -a + OPT_r = 0x2, // -r + OPT_f = 0x4, // -f }; #if ENABLE_LONG_OPTS static const char dumpleases_longopts[] ALIGN1 = diff --git a/procps/powertop.c b/procps/powertop.c index 5e028f0..250da81 100644 --- a/procps/powertop.c +++ b/procps/powertop.c @@ -39,7 +39,7 @@ /* Frequency of the ACPI timer */ #define FREQ_ACPI 3579.545 -#define FREQ_ACPI_1000 3579545 +#define FREQ_ACPI_1000 3579545 /* Max filename length of entry in /sys/devices subsystem */ #define BIG_SYSNAME_LEN 16 @@ -115,8 +115,8 @@ static int write_str_to_file(const char *fname, const char *str) } /* Make it more readable */ -#define start_timer() write_str_to_file("/proc/timer_stats", "1\n") -#define stop_timer() write_str_to_file("/proc/timer_stats", "0\n") +#define start_timer() write_str_to_file("/proc/timer_stats", "1\n") +#define stop_timer() write_str_to_file("/proc/timer_stats", "0\n") static NOINLINE void clear_lines(void) { @@ -362,7 +362,7 @@ static void process_irq_counts(void) } /* 0: 143646045 153901007 IO-APIC-edge timer * NMI: 1 2 Non-maskable interrupts - * ^ + * ^ */ if (nr < 20000) { /* Skip to the interrupt name, e.g. 'timer' */ @@ -539,9 +539,9 @@ static void cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx, } #endif +#ifdef __i386__ static NOINLINE void print_intel_cstates(void) { -#ifdef __i386__ int bios_table[8] = { 0 }; int nbios = 0; DIR *cpudir; @@ -628,13 +628,15 @@ static NOINLINE void print_intel_cstates(void) /* Print BIOS C-States */ printf("Your BIOS reports the following C-states: "); - for (i = 0; i < 8; i++) + for (i = 0; i < ARRAY_SIZE(bios_table); i++) if (bios_table[i]) printf("C%u ", i); bb_putchar('\n'); -#endif } +#else +# define print_intel_cstates(void) ((void)0) +#endif static void show_timerstats(void) { @@ -817,7 +819,7 @@ int powertop_main(int UNUSED_PARAM argc, char UNUSED_PARAM **argv) sprintf(cstate_lines[0], "Cn\t\t Avg residency\n"); percentage = newticks * 100.0 / (G.total_cpus * DEFAULT_SLEEP * FREQ_ACPI_1000); - sprintf(cstate_lines[1], "C0 (cpu running) (%4.1f%%)\n", percentage); + sprintf(cstate_lines[1], "C0 (cpu running) (%4.1f%%)\n", percentage); /* Compute values for individual C-states */ for (i = 0; i < MAX_CSTATE_COUNT; i++) { diff --git a/procps/renice.c b/procps/renice.c index 0a73cbe..59194b5 100644 --- a/procps/renice.c +++ b/procps/renice.c @@ -32,7 +32,7 @@ int renice_main(int argc UNUSED_PARAM, char **argv) static const char Xetpriority_msg[] ALIGN1 = "%cetpriority"; int retval = EXIT_SUCCESS; - int which = PRIO_PROCESS; /* Default 'which' value. */ + int which = PRIO_PROCESS; /* Default 'which' value. */ int use_relative = 0; int adjustment, new_priority; unsigned who; @@ -57,7 +57,7 @@ int renice_main(int argc UNUSED_PARAM, char **argv) arg += 2; } - if (!arg) { /* No args? Then show usage. */ + if (!arg) { /* No args? Then show usage. */ bb_show_usage(); } @@ -100,7 +100,7 @@ int renice_main(int argc UNUSED_PARAM, char **argv) if (use_relative) { int old_priority; - errno = 0; /* Needed for getpriority error detection. */ + errno = 0; /* Needed for getpriority error detection. */ old_priority = getpriority(which, who); if (errno) { bb_perror_msg(Xetpriority_msg, 'g'); diff --git a/runit/chpst.c b/runit/chpst.c index b08d423..dc8a26a 100644 --- a/runit/chpst.c +++ b/runit/chpst.c @@ -122,10 +122,10 @@ static NOINLINE void edir(const char *directory_name) if ((errno == EISDIR) && directory_name) { if (option_mask32 & OPT_v) bb_perror_msg("warning: %s/%s is a directory", - directory_name, d->d_name); + directory_name, d->d_name); continue; - } else - bb_perror_msg_and_die("open %s/%s", + } + bb_perror_msg_and_die("open %s/%s", directory_name, d->d_name); } size = full_read(fd, buf, sizeof(buf)-1); diff --git a/runit/svlogd.c b/runit/svlogd.c index 052806c..c3ff4e9 100644 --- a/runit/svlogd.c +++ b/runit/svlogd.c @@ -1114,7 +1114,8 @@ int svlogd_main(int argc, char **argv) /* Search for '\n' (in fact, np already holds the result) */ linelen = stdin_cnt; if (np) { - print_to_nl: /* NB: starting from here lineptr may point + print_to_nl: + /* NB: starting from here lineptr may point * farther out into line[] */ linelen = np - lineptr + 1; } diff --git a/shell/ash.c b/shell/ash.c index fbf3efc..5ef7efb 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -7623,7 +7623,7 @@ hashcd(void) for (cmdp = *pp; cmdp; cmdp = cmdp->next) { if (cmdp->cmdtype == CMDNORMAL || (cmdp->cmdtype == CMDBUILTIN - && !IS_BUILTIN_REGULAR(cmdp->param.cmd) + && !IS_BUILTIN_REGULAR(cmdp->param.cmd) && builtinloc > 0) ) { cmdp->rehash = 1; @@ -12325,7 +12325,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) } if ((act & DO_NOFUNC) || !prefix(pathopt, "func") - ) { /* ignore unimplemented options */ + ) { /* ignore unimplemented options */ continue; } } diff --git a/shell/hush.c b/shell/hush.c index 75083dc..9dd30c4 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -2765,7 +2765,7 @@ static const struct reserved_combo* match_reserved_word(o_string *word) }; const struct reserved_combo *r; - for (r = reserved_list; r < reserved_list + ARRAY_SIZE(reserved_list); r++) { + for (r = reserved_list; r < reserved_list + ARRAY_SIZE(reserved_list); r++) { if (strcmp(word->data, r->literal) == 0) return r; } @@ -4660,7 +4660,7 @@ static NOINLINE const char *expand_one_var(char **to_be_freed_pp, char *arg, cha char *exp_exp_word; char *loc; unsigned scan_flags = pick_scan(exp_op, *exp_word); - if (exp_op == *exp_word) /* ## or %% */ + if (exp_op == *exp_word) /* ## or %% */ exp_word++; exp_exp_word = encode_then_expand_string(exp_word, /*process_bkslash:*/ 1, /*unbackslash:*/ 1); if (exp_exp_word) diff --git a/sysklogd/logger.c b/sysklogd/logger.c index ff15191..120f6a7 100644 --- a/sysklogd/logger.c +++ b/sysklogd/logger.c @@ -121,7 +121,7 @@ int logger_main(int argc UNUSED_PARAM, char **argv) /*- * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * This is the original license statement for the decode and pencode functions. * @@ -134,8 +134,8 @@ int logger_main(int argc UNUSED_PARAM, char **argv) * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * 3. + * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change + * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change * * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software diff --git a/util-linux/acpid.c b/util-linux/acpid.c index 5a3bd5a..0b227a8 100644 --- a/util-linux/acpid.c +++ b/util-linux/acpid.c @@ -52,7 +52,7 @@ struct globals { int n_evt; } FIX_ALIASING; #define G (*ptr_to_globals) -#define act_tab (G.act_tab) +#define act_tab (G.act_tab) #define n_act (G.n_act ) #define evt_tab (G.evt_tab) #define n_evt (G.n_evt ) diff --git a/util-linux/fdformat.c b/util-linux/fdformat.c index f5c386c..57e9c26 100644 --- a/util-linux/fdformat.c +++ b/util-linux/fdformat.c @@ -36,7 +36,7 @@ struct format_descr { unsigned int device,head,track; }; #define FDFMTBEG _IO(2,0x47) -#define FDFMTTRK _IOW(2,0x48, struct format_descr) +#define FDFMTTRK _IOW(2,0x48, struct format_descr) #define FDFMTEND _IO(2,0x49) #define FDGETPRM _IOR(2, 0x04, struct floppy_struct) #define FD_FILL_BYTE 0xF6 /* format fill byte. */ diff --git a/util-linux/fdisk_gpt.c b/util-linux/fdisk_gpt.c index 1ab1293..d43d9c7 100644 --- a/util-linux/fdisk_gpt.c +++ b/util-linux/fdisk_gpt.c @@ -7,7 +7,7 @@ #define GPT_MAGIC 0x5452415020494645ULL enum { - LEGACY_GPT_TYPE = 0xee, + LEGACY_GPT_TYPE = 0xee, GPT_MAX_PARTS = 256, GPT_MAX_PART_ENTRY_LEN = 4096, GUID_LEN = 16, diff --git a/util-linux/fdisk_sun.c b/util-linux/fdisk_sun.c index 6b7940c..e7fcc06 100644 --- a/util-linux/fdisk_sun.c +++ b/util-linux/fdisk_sun.c @@ -654,7 +654,7 @@ sun_list_table(int xtra) uint32_t start = SUN_SSWAP32(sunlabel->partitions[i].start_cylinder) * g_heads * g_sectors; uint32_t len = SUN_SSWAP32(sunlabel->partitions[i].num_sectors); printf("%s %c%c %9lu %9lu %9lu%c %2x %s\n", - partname(disk_device, i+1, w), /* device */ + partname(disk_device, i+1, w), /* device */ (sunlabel->infos[i].flags & 0x01) ? 'u' : ' ', /* flags */ (sunlabel->infos[i].flags & 0x10) ? 'r' : ' ', (long) scround(start), /* start */ diff --git a/util-linux/ipcrm.c b/util-linux/ipcrm.c index 6360c70..731216c 100644 --- a/util-linux/ipcrm.c +++ b/util-linux/ipcrm.c @@ -43,7 +43,6 @@ typedef enum type_id { static int remove_ids(type_id type, int argc, char **argv) { unsigned long id; - int ret = 0; /* silence gcc */ int nb_errors = 0; union semun arg; @@ -55,6 +54,7 @@ static int remove_ids(type_id type, int argc, char **argv) bb_error_msg("invalid id: %s", argv[0]); nb_errors++; } else { + int ret = 0; if (type == SEM) ret = semctl(id, 0, IPC_RMID, arg); else if (type == MSG) @@ -92,14 +92,13 @@ int ipcrm_main(int argc, char **argv) type_id what = 0; /* silence gcc */ char w; - w=argv[1][0]; + w = argv[1][0]; if ( ((w == 'm' && argv[1][1] == 's' && argv[1][2] == 'g') || (argv[1][0] == 's' - && ((w=argv[1][1]) == 'h' || w == 'e') + && ((w = argv[1][1]) == 'h' || w == 'e') && argv[1][2] == 'm') ) && argv[1][3] == '\0' ) { - if (argc < 3) bb_show_usage(); diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c index 6dccd3a..871ec83 100644 --- a/util-linux/mkfs_ext2.c +++ b/util-linux/mkfs_ext2.c @@ -11,8 +11,8 @@ #include #include -#define ENABLE_FEATURE_MKFS_EXT2_RESERVED_GDT 0 -#define ENABLE_FEATURE_MKFS_EXT2_DIR_INDEX 1 +#define ENABLE_FEATURE_MKFS_EXT2_RESERVED_GDT 0 +#define ENABLE_FEATURE_MKFS_EXT2_DIR_INDEX 1 // from e2fsprogs #define s_reserved_gdt_blocks s_padding1 diff --git a/util-linux/mkfs_vfat.c b/util-linux/mkfs_vfat.c index 45760f7..bb5b59c 100644 --- a/util-linux/mkfs_vfat.c +++ b/util-linux/mkfs_vfat.c @@ -28,7 +28,7 @@ #define ATTR_VOLUME 8 -#define NUM_FATS 2 +#define NUM_FATS 2 /* FAT32 filesystem looks like this: * sector -nn...-1: "hidden" sectors, all sectors before this partition diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c index 00b3382..f8a6e0c 100644 --- a/util-linux/readprofile.c +++ b/util-linux/readprofile.c @@ -97,7 +97,7 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) */ to_write = sizeof(int); if (!optMult) - to_write = 1; /* sth different from sizeof(int) */ + to_write = 1; /* sth different from sizeof(int) */ fd = xopen(defaultpro, O_WRONLY); xwrite(fd, &multiplier, to_write); @@ -179,7 +179,7 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) if (*mode != 'T' && *mode != 't' && *mode != 'W' && *mode != 'w' ) { - break; /* only text is profiled */ + break; /* only text is profiled */ } if (indx >= len / sizeof(*buf)) diff --git a/util-linux/rtcwake.c b/util-linux/rtcwake.c index 26e5b47..06ed7ea 100644 --- a/util-linux/rtcwake.c +++ b/util-linux/rtcwake.c @@ -50,7 +50,7 @@ static NOINLINE bool may_wakeup(const char *rtcname) static NOINLINE void setup_alarm(int fd, time_t *wakeup, time_t rtc_time) { struct tm *ptm; - struct linux_rtc_wkalrm wake; + struct linux_rtc_wkalrm wake; /* The wakeup time is in POSIX time (more or less UTC). * Ideally RTCs use that same time; but PCs can't do that diff --git a/util-linux/script.c b/util-linux/script.c index 0860bb0..b9317fc 100644 --- a/util-linux/script.c +++ b/util-linux/script.c @@ -6,7 +6,7 @@ * * Based on code from util-linux v 2.12r * Copyright (c) 1980 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ -- cgit v1.1