Skip to content

Commit

Permalink
whitespace cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Denys Vlasenko <[email protected]>
  • Loading branch information
dvlasenk committed Oct 29, 2010
1 parent 66cb7be commit fb132e4
Show file tree
Hide file tree
Showing 69 changed files with 231 additions and 268 deletions.
16 changes: 8 additions & 8 deletions archival/ar.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,17 @@ static void FAST_FUNC header_verbose_list_ar(const file_header_t *file_header)
);
}

#define AR_OPT_VERBOSE (1 << 0)
#define AR_OPT_PRESERVE_DATE (1 << 1)
#define AR_OPT_VERBOSE (1 << 0)
#define AR_OPT_PRESERVE_DATE (1 << 1)
/* "ar r" implies create, but warns about it. c suppresses warning.
* bbox accepts but ignores it: */
#define AR_OPT_CREATE (1 << 2)
#define AR_OPT_CREATE (1 << 2)

#define AR_CMD_PRINT (1 << 3)
#define FIRST_CMD AR_CMD_PRINT
#define AR_CMD_LIST (1 << 4)
#define AR_CMD_EXTRACT (1 << 5)
#define AR_CMD_INSERT (1 << 6)
#define AR_CMD_PRINT (1 << 3)
#define FIRST_CMD AR_CMD_PRINT
#define AR_CMD_LIST (1 << 4)
#define AR_CMD_EXTRACT (1 << 5)
#define AR_CMD_INSERT (1 << 6)

int ar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int ar_main(int argc UNUSED_PARAM, char **argv)
Expand Down
2 changes: 1 addition & 1 deletion archival/bz/bzlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ in the file LICENSE.
* 0.9.0a/b -- no changes in this file.
* 0.9.0c -- made zero-length BZ_FLUSH work correctly in bzCompress().
* fixed bzWrite/bzRead to ignore zero-length requests.
* fixed bzread to correctly handle read requests after EOF.
* fixed bzread to correctly handle read requests after EOF.
* wrong parameter order in call to bzDecompressInit in
* bzBuffToBuffDecompress. Fixed.
*/
Expand Down
9 changes: 4 additions & 5 deletions archival/bz/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,14 @@ void generateMTFValues(EState* s)
* holds the original block data.
*
* The first thing to do is generate the MTF values,
* and put them in
* ((uint16_t*)s->arr1)[0 .. s->nblock-1].
* and put them in ((uint16_t*)s->arr1)[0 .. s->nblock-1].
*
* Because there are strictly fewer or equal MTF values
* than block values, ptr values in this area are overwritten
* with MTF values only when they are no longer needed.
*
* The final compressed bitstream is generated into the
* area starting at
* &((uint8_t*)s->arr2)[s->nblock]
* area starting at &((uint8_t*)s->arr2)[s->nblock]
*
* These storage aliases are set up in bzCompressInit(),
* except for the last one, which is arranged in
Expand Down Expand Up @@ -459,7 +458,7 @@ void sendMTFValues(EState* s)
}

AssertH(nGroups < 8, 3002);
AssertH(nSelectors < 32768 && nSelectors <= (2 + (900000 / BZ_G_SIZE)), 3003);
AssertH(nSelectors < 32768 && nSelectors <= (2 + (900000 / BZ_G_SIZE)), 3003);

/*--- Compute MTF values for the selectors. ---*/
{
Expand Down
11 changes: 6 additions & 5 deletions archival/dpkg.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,8 +939,8 @@ static int package_satisfies_dependency(int package, int depend_type)
return 0;

switch (depend_type) {
case EDGE_PRE_DEPENDS: return get_status(status_num, 3) == search_name_hashtable("installed");
case EDGE_DEPENDS: return get_status(status_num, 1) == search_name_hashtable("install");
case EDGE_PRE_DEPENDS: return get_status(status_num, 3) == search_name_hashtable("installed");
case EDGE_DEPENDS: return get_status(status_num, 1) == search_name_hashtable("install");
}
return 0;
}
Expand All @@ -967,7 +967,7 @@ static int check_deps(deb_file_t **deb_file, int deb_start /*, int dep_max_count
conflicts[conflicts_num] = package_num;
conflicts_num++;
/* add provides to conflicts list */
for (j = 0; j < package_hashtable[package_num]->num_of_edges; j++) {
for (j = 0; j < package_hashtable[package_num]->num_of_edges; j++) {
if (package_hashtable[package_num]->edge[j]->type == EDGE_PROVIDES) {
const int conflicts_package_num = search_package_hashtable(
package_hashtable[package_num]->edge[j]->name,
Expand Down Expand Up @@ -1067,12 +1067,13 @@ static int check_deps(deb_file_t **deb_file, int deb_start /*, int dep_max_count

if (package_edge->type == EDGE_OR_PRE_DEPENDS
|| package_edge->type == EDGE_OR_DEPENDS
) { /* start an EDGE_OR_ list */
) {
/* start an EDGE_OR_ list */
number_of_alternatives = package_edge->version;
root_of_alternatives = package_edge;
continue;
}
if (number_of_alternatives == 0) { /* not in the middle of an EDGE_OR_ list */
if (number_of_alternatives == 0) { /* not in the middle of an EDGE_OR_ list */
number_of_alternatives = 1;
root_of_alternatives = NULL;
}
Expand Down
10 changes: 5 additions & 5 deletions archival/dpkg_deb.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#include "libbb.h"
#include "unarchive.h"

#define DPKG_DEB_OPT_CONTENTS 1
#define DPKG_DEB_OPT_CONTROL 2
#define DPKG_DEB_OPT_FIELD 4
#define DPKG_DEB_OPT_EXTRACT 8
#define DPKG_DEB_OPT_EXTRACT_VERBOSE 16
#define DPKG_DEB_OPT_CONTENTS 1
#define DPKG_DEB_OPT_CONTROL 2
#define DPKG_DEB_OPT_FIELD 4
#define DPKG_DEB_OPT_EXTRACT 8
#define DPKG_DEB_OPT_EXTRACT_VERBOSE 16

int dpkg_deb_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int dpkg_deb_main(int argc, char **argv)
Expand Down
4 changes: 2 additions & 2 deletions archival/libunarchive/decompress_bunzip2.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ struct bunzip_data {

/* Big things go last (register-relative addressing can be larger for big offsets) */
uint32_t crc32Table[256];
unsigned char selectors[32768]; /* nSelectors=15 bits */
struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */
unsigned char selectors[32768]; /* nSelectors=15 bits */
struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */
};
/* typedef struct bunzip_data bunzip_data; -- done in .h file */

Expand Down
4 changes: 2 additions & 2 deletions console-tools/kbd_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ int kbd_mode_main(int argc UNUSED_PARAM, char **argv)
{
enum {
SCANCODE = (1 << 0),
ASCII = (1 << 1),
ASCII = (1 << 1),
MEDIUMRAW = (1 << 2),
UNICODE = (1 << 3),
UNICODE = (1 << 3),
};
int fd;
unsigned opt;
Expand Down
8 changes: 4 additions & 4 deletions console-tools/loadfont.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static void do_loadfont(int fd, unsigned char *inbuf, int height, int width, int
* Example:
* At the font position for a capital A-ring glyph, we
* may have:
* 00C5,212B,FFFE,0041,030A,FFFF
* 00C5,212B,FFFE,0041,030A,FFFF
* Some font positions may be described by sequences only,
* namely when there is no precomposed Unicode value for the glyph.
*/
Expand All @@ -159,7 +159,7 @@ static void do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize,
int glyph;
uint16_t unicode;

maxct = tailsz; /* more than enough */
maxct = tailsz; /* more than enough */
up = xmalloc(maxct * sizeof(*up));

for (glyph = 0; glyph < fontsize; glyph++) {
Expand Down Expand Up @@ -255,10 +255,10 @@ static void do_load(int fd, unsigned char *buffer, size_t len)
} else
#endif
#if ENABLE_FEATURE_LOADFONT_RAW
if (len == 9780) { /* file with three code pages? */
if (len == 9780) { /* file with three code pages? */
charsize = height = 16;
font += 40;
} else if ((len & 0377) == 0) { /* bare font */
} else if ((len & 0377) == 0) { /* bare font */
charsize = height = len / 256;
} else
#endif
Expand Down
12 changes: 6 additions & 6 deletions console-tools/showkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ struct globals {
struct termios tio, tio0;
};
#define G (*ptr_to_globals)
#define kbmode (G.kbmode)
#define tio (G.tio)
#define tio0 (G.tio0)
#define kbmode (G.kbmode)
#define tio (G.tio)
#define tio0 (G.tio0)
#define INIT_G() do { \
SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
} while (0)
Expand Down Expand Up @@ -46,9 +46,9 @@ int showkey_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int showkey_main(int argc UNUSED_PARAM, char **argv)
{
enum {
OPT_a = (1<<0), // display the decimal/octal/hex values of the keys
OPT_k = (1<<1), // display only the interpreted keycodes (default)
OPT_s = (1<<2), // display only the raw scan-codes
OPT_a = (1<<0), // display the decimal/octal/hex values of the keys
OPT_k = (1<<1), // display only the interpreted keycodes (default)
OPT_s = (1<<2), // display only the raw scan-codes
};

INIT_G();
Expand Down
2 changes: 1 addition & 1 deletion coreutils/date.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ int date_main(int argc UNUSED_PARAM, char **argv)
}

/* 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 */
ts.tv_sec = validate_tm_time(date_str, &tm_time);

maybe_set_utc(opt);
Expand Down
2 changes: 1 addition & 1 deletion coreutils/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static const struct suffix_mult dd_suffixes[] = {
{ "b", 512 },
{ "kD", 1000 },
{ "k", 1024 },
{ "K", 1024 }, /* compat with coreutils dd */
{ "K", 1024 }, /* compat with coreutils dd */
{ "MD", 1000000 },
{ "M", 1048576 },
{ "GD", 1000000000 },
Expand Down
2 changes: 1 addition & 1 deletion coreutils/mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int mv_main(int argc, char **argv)
|| (flags & OPT_FILEUTILS_INTERACTIVE))
) {
if (fprintf(stderr, "mv: overwrite '%s'? ", dest) < 0) {
goto RET_1; /* Ouch! fprintf failed! */
goto RET_1; /* Ouch! fprintf failed! */
}
if (!bb_ask_confirmation()) {
goto RET_0;
Expand Down
6 changes: 3 additions & 3 deletions coreutils/nice.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ int nice_main(int argc, char **argv)

old_priority = getpriority(PRIO_PROCESS, 0);

if (!*++argv) { /* No args, so (GNU) output current nice value. */
if (!*++argv) { /* No args, so (GNU) output current nice value. */
printf("%d\n", old_priority);
fflush_stdout_and_exit(EXIT_SUCCESS);
}

adjustment = 10; /* Set default adjustment. */
adjustment = 10; /* Set default adjustment. */

if (argv[0][0] == '-') {
if (argv[0][1] == 'n') { /* -n */
Expand All @@ -32,7 +32,7 @@ int nice_main(int argc, char **argv)
} else { /* -NNN (NNN may be negative) == -n NNN */
argv[0] += 1; argv--; argc++;
}
if (argc < 4) { /* Missing priority and/or utility! */
if (argc < 4) { /* Missing priority and/or utility! */
bb_show_usage();
}
adjustment = xatoi_range(argv[1], INT_MIN/2, INT_MAX/2);
Expand Down
4 changes: 2 additions & 2 deletions coreutils/od.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Based on code from util-linux v 2.11l
*
* Copyright (c) 1990
* 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.
*
Expand Down Expand Up @@ -174,7 +174,7 @@ int od_main(int argc, char **argv)
bb_dump_add(dumper, "\" \"");
}
bb_dump_add(dumper, add_strings[(int)od_o2si[(p - od_opts)]]);
} else { /* P, p, s, w, or other unhandled */
} else { /* P, p, s, w, or other unhandled */
bb_show_usage();
}
}
Expand Down
4 changes: 2 additions & 2 deletions coreutils/sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ enum {
static char key_separator;

static struct sort_key {
struct sort_key *next_key; /* linked list */
unsigned range[4]; /* start word, start char, end word, end char */
struct sort_key *next_key; /* linked list */
unsigned range[4]; /* start word, start char, end word, end char */
unsigned flags;
} *key_list;

Expand Down
6 changes: 3 additions & 3 deletions coreutils/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
* state. */

/* test(1) accepts the following grammar:
oexpr ::= aexpr | aexpr "-o" oexpr ;
aexpr ::= nexpr | nexpr "-a" aexpr ;
nexpr ::= primary | "!" primary
oexpr ::= aexpr | aexpr "-o" oexpr ;
aexpr ::= nexpr | nexpr "-a" aexpr ;
nexpr ::= primary | "!" primary
primary ::= unary-operator operand
| operand binary-operator operand
| operand
Expand Down
8 changes: 4 additions & 4 deletions coreutils/tr.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static unsigned expand(const char *arg, char **buffer_p)
buffer[pos++] = *arg; /* copy CHAR */
if (!arg[0] || arg[1] != '=' || arg[2] != ']')
bb_show_usage();
arg += 3; /* skip CHAR=] */
arg += 3; /* skip CHAR=] */
continue;
}
/* The rest of "[xyz..." cases is treated as normal
Expand Down Expand Up @@ -258,9 +258,9 @@ int tr_main(int argc UNUSED_PARAM, char **argv)
char *invec = vector + ASCII;
char *outvec = vector + ASCII * 2;

#define TR_OPT_complement (3 << 0)
#define TR_OPT_delete (1 << 2)
#define TR_OPT_squeeze_reps (1 << 3)
#define TR_OPT_complement (3 << 0)
#define TR_OPT_delete (1 << 2)
#define TR_OPT_squeeze_reps (1 << 3)

for (i = 0; i < ASCII; i++) {
vector[i] = i;
Expand Down
6 changes: 3 additions & 3 deletions coreutils/wc.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
bb_simple_perror_msg(arg);
status = EXIT_FAILURE;
}
goto DO_EOF; /* Treat an EOF as '\r'. */
goto DO_EOF; /* Treat an EOF as '\r'. */
}

/* Cater for -c and -m */
Expand All @@ -179,7 +179,7 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
*/
if (c == '\t') {
linepos = (linepos | 7) + 1;
} else { /* '\n', '\r', '\f', or '\v' */
} else { /* '\n', '\r', '\f', or '\v' */
DO_EOF:
if (linepos > counts[WC_LENGTH]) {
counts[WC_LENGTH] = linepos;
Expand Down Expand Up @@ -230,7 +230,7 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
* effect of trashing the totals array after outputting it, but that's
* irrelavent since we no longer need it. */
if (num_files > 1) {
num_files = 0; /* Make sure we don't get here again. */
num_files = 0; /* Make sure we don't get here again. */
arg = "total";
pcounts = totals;
--argv;
Expand Down
2 changes: 1 addition & 1 deletion e2fsprogs/old_e2fsprogs/e2fsck.h
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ struct e2fsck_struct {
};


#define tid_gt(x, y) ((x - y) > 0)
#define tid_gt(x, y) ((x - y) > 0)

static inline int tid_geq(tid_t x, tid_t y)
{
Expand Down
14 changes: 7 additions & 7 deletions editors/awk.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ enum {

/* tokens and their corresponding info values */

#define NTC "\377" /* switch to next token class (tc<<1) */
#define NTCC '\377'
#define NTC "\377" /* switch to next token class (tc<<1) */
#define NTCC '\377'

#define OC_B OC_BUILTIN
#define OC_B OC_BUILTIN

static const char tokenlist[] ALIGN1 =
"\1(" NTC
Expand Down Expand Up @@ -368,7 +368,7 @@ static const uint32_t tokeninfo[] = {
OC_B|B_ss|P(0x8f), OC_FBLTIN|F_ti, OC_B|B_ti|P(0x0b), OC_B|B_mt|P(0x0b),
OC_B|B_lo|P(0x49), OC_B|B_up|P(0x49),
OC_GETLINE|SV|P(0),
0, 0,
0, 0,
0,
0 /* END */
};
Expand All @@ -380,7 +380,7 @@ enum {
ORS, RS, RT, FILENAME,
SUBSEP, F0, ARGIND, ARGC,
ARGV, ERRNO, FNR, NR,
NF, IGNORECASE, ENVIRON, NUM_INTERNAL_VARS
NF, IGNORECASE, ENVIRON, NUM_INTERNAL_VARS
};

static const char vNames[] ALIGN1 =
Expand Down Expand Up @@ -2335,7 +2335,7 @@ static var *evaluate(node *op, var *res)
#define fnargs (G.evaluate__fnargs)
/* seed is initialized to 1 */
#define seed (G.evaluate__seed)
#define sreg (G.evaluate__sreg)
#define sreg (G.evaluate__sreg)

var *v1;

Expand Down Expand Up @@ -2611,7 +2611,7 @@ static var *evaluate(node *op, var *res)
rsm->F = popen(L.s, "r");
rsm->is_pipe = TRUE;
} else {
rsm->F = fopen_for_read(L.s); /* not xfopen! */
rsm->F = fopen_for_read(L.s); /* not xfopen! */
}
}
} else {
Expand Down
Loading

0 comments on commit fb132e4

Please sign in to comment.