whitespace fixes. no code changes

This commit is contained in:
Denis Vlasenko 2008-06-25 09:53:17 +00:00
parent f26e3d2e41
commit 7049ff8696
23 changed files with 62 additions and 75 deletions

View File

@ -169,12 +169,12 @@ enum {
#endif #endif
#define current_time_t (G.current_time_t) #define current_time_t (G.current_time_t)
/* memset: we have to zero it out because of NOEXEC */ /* memset: we have to zero it out because of NOEXEC */
#define INIT_G() { \ #define INIT_G() do { \
memset(&G, 0, sizeof(G)); \ memset(&G, 0, sizeof(G)); \
USE_FEATURE_AUTOWIDTH(tabstops = COLUMN_GAP;) \ USE_FEATURE_AUTOWIDTH(tabstops = COLUMN_GAP;) \
USE_FEATURE_AUTOWIDTH(terminal_width = TERMINAL_WIDTH;) \ USE_FEATURE_AUTOWIDTH(terminal_width = TERMINAL_WIDTH;) \
USE_FEATURE_LS_TIMESTAMPS(time(&current_time_t);) \ USE_FEATURE_LS_TIMESTAMPS(time(&current_time_t);) \
} } while (0)
#if ENABLE_FEATURE_ASSUME_UNICODE #if ENABLE_FEATURE_ASSUME_UNICODE

View File

@ -627,11 +627,10 @@ struct globals {
char buf[10]; char buf[10];
}; };
#define G (*(struct globals*)&bb_common_bufsiz1) #define G (*(struct globals*)&bb_common_bufsiz1)
#define INIT_G() \ #define INIT_G() do { \
do { \ G.device_name = bb_msg_standard_input; \
G.device_name = bb_msg_standard_input; \ G.max_col = 80; \
G.max_col = 80; \ } while (0)
} while (0)
/* Return a string that is the printable representation of character CH */ /* Return a string that is the printable representation of character CH */

View File

@ -105,11 +105,10 @@ struct globals {
#define pidfile (G.pidfile ) #define pidfile (G.pidfile )
#define user_id (G.user_id ) #define user_id (G.user_id )
#define signal_nr (G.signal_nr ) #define signal_nr (G.signal_nr )
#define INIT_G() \ #define INIT_G() do { \
do { \ user_id = -1; \
user_id = -1; \ signal_nr = 15; \
signal_nr = 15; \ } while (0)
} while (0)
#ifdef OLDER_VERSION_OF_X #ifdef OLDER_VERSION_OF_X
/* -x,--exec EXECUTABLE /* -x,--exec EXECUTABLE

View File

@ -103,12 +103,11 @@ struct globals {
const char *cur_file; /* the current file we are reading */ const char *cur_file; /* the current file we are reading */
}; };
#define G (*(struct globals*)&bb_common_bufsiz1) #define G (*(struct globals*)&bb_common_bufsiz1)
#define INIT_G() \ #define INIT_G() do { \
do { \ struct G_sizecheck { \
struct G_sizecheck { \ char G_sizecheck[sizeof(G) > COMMON_BUFSIZE ? -1 : 1]; \
char G_sizecheck[sizeof(G) > COMMON_BUFSIZE ? -1 : 1]; \ }; \
}; \ } while (0)
} while (0)
#define max_matches (G.max_matches ) #define max_matches (G.max_matches )
#define reflags (G.reflags ) #define reflags (G.reflags )
#define invert_search (G.invert_search ) #define invert_search (G.invert_search )

View File

@ -19,8 +19,7 @@ enum { STACK_SIZE = (COMMON_BUFSIZE - offsetof(struct globals, stack)) / sizeof(
#define pointer (G.pointer ) #define pointer (G.pointer )
#define base (G.base ) #define base (G.base )
#define stack (G.stack ) #define stack (G.stack )
#define INIT_G() do { \ #define INIT_G() do { } while (0)
} while (0)
static void push(double a) static void push(double a)

View File

@ -50,10 +50,9 @@ struct globals {
struct fb_fix_screeninfo scr_fix; struct fb_fix_screeninfo scr_fix;
}; };
#define G (*ptr_to_globals) #define G (*ptr_to_globals)
#define INIT_G() \ #define INIT_G() do { \
do { \ SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ } while (0)
} while (0)
#if DEBUG #if DEBUG

View File

@ -1251,7 +1251,7 @@ static void dump_identity(const struct hd_driveid *id)
.masks = { 0x100, 0x001, 0x200, 0x002, 0x400, 0x004 }, .masks = { 0x100, 0x001, 0x200, 0x002, 0x400, 0x004 },
.labels = "*\0""udma0 \0""*\0""udma1 \0""*\0""udma2 \0", .labels = "*\0""udma0 \0""*\0""udma1 \0""*\0""udma2 \0",
}; };
printf("\n UDMA modes: "); printf("\n UDMA modes: ");
print_flags(&ultra_modes1, id->dma_ultra); print_flags(&ultra_modes1, id->dma_ultra);
#ifdef __NEW_HD_DRIVE_ID #ifdef __NEW_HD_DRIVE_ID

View File

@ -174,7 +174,7 @@ int depmod_main(int ATTRIBUTE_UNUSED argc, char **argv)
/* Fixup the module names in the depends list */ /* Fixup the module names in the depends list */
while (mods) { while (mods) {
llist_t *deps = NULL, *old_deps = mods->dependencies; llist_t *deps = NULL, *old_deps = mods->dependencies;
while (old_deps) { while (old_deps) {
dep_lst_t *all = G.lst; dep_lst_t *all = G.lst;
char *longname = NULL; char *longname = NULL;
@ -262,7 +262,7 @@ int depmod_main(int ATTRIBUTE_UNUSED argc, char **argv)
char *tmp = strrstr(shortname, ".ko"); char *tmp = strrstr(shortname, ".ko");
*tmp = '\0'; *tmp = '\0';
while (mods->aliases) { while (mods->aliases) {
fprintf(filedes, "alias %s %s\n", fprintf(filedes, "alias %s %s\n",
(char*)llist_pop(&mods->aliases), (char*)llist_pop(&mods->aliases),

View File

@ -61,10 +61,9 @@ struct globals {
#define received (G.received ) #define received (G.received )
#define brd_recv (G.brd_recv ) #define brd_recv (G.brd_recv )
#define req_recv (G.req_recv ) #define req_recv (G.req_recv )
#define INIT_G() \ #define INIT_G() do { \
do { \ count = -1; \
count = -1; \ } while (0)
} while (0)
// If GNUisms are not available... // If GNUisms are not available...
//static void *mempcpy(void *_dst, const void *_src, int n) //static void *mempcpy(void *_dst, const void *_src, int n)

View File

@ -27,7 +27,7 @@ struct globals {
#define G (*(struct globals*)&bb_common_bufsiz1) #define G (*(struct globals*)&bb_common_bufsiz1)
enum { BUFSZ = COMMON_BUFSIZE - offsetof(struct globals, buf) }; enum { BUFSZ = COMMON_BUFSIZE - offsetof(struct globals, buf) };
struct BUG_G_too_big { struct BUG_G_too_big {
char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1]; char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
}; };
#define user (G.user ) #define user (G.user )
#define password (G.password ) #define password (G.password )
@ -36,8 +36,7 @@ struct BUG_G_too_big {
#define verbose_flag (G.verbose_flag ) #define verbose_flag (G.verbose_flag )
#define do_continue (G.do_continue ) #define do_continue (G.do_continue )
#define buf (G.buf ) #define buf (G.buf )
#define INIT_G() do { \ #define INIT_G() do { } while (0)
} while (0)
static void ftp_die(const char *msg) ATTRIBUTE_NORETURN; static void ftp_die(const char *msg) ATTRIBUTE_NORETURN;

View File

@ -147,7 +147,7 @@ static int ioctl_on_skfd(unsigned request, struct ifreq *ifr)
static int set_ifrname_and_do_ioctl(unsigned request, struct ifreq *ifr, const char *ifname) static int set_ifrname_and_do_ioctl(unsigned request, struct ifreq *ifr, const char *ifname)
{ {
strncpy_IFNAMSIZ(ifr->ifr_name, ifname); strncpy_IFNAMSIZ(ifr->ifr_name, ifname);
return ioctl_on_skfd(request, ifr); return ioctl_on_skfd(request, ifr);
} }

View File

@ -582,7 +582,7 @@ static int iproute_list_or_flush(char **argv, int flush)
if (rtnl_rttable_a2n(&tid, *argv)) if (rtnl_rttable_a2n(&tid, *argv))
invarg(*argv, "table"); invarg(*argv, "table");
filter.tb = tid; filter.tb = tid;
#else #else
invarg(*argv, "table"); invarg(*argv, "table");
#endif #endif
} }

View File

@ -25,7 +25,7 @@ struct globals {
#define handle (G.handle ) #define handle (G.handle )
#define saved_disc (G.saved_disc ) #define saved_disc (G.saved_disc )
#define saved_state (G.saved_state ) #define saved_state (G.saved_state )
#define INIT_G() do {} while (0) #define INIT_G() do { } while (0)
/* /*

View File

@ -59,11 +59,10 @@ struct globals {
#define cmax (G.cmax ) #define cmax (G.cmax )
#define env_cur (G.env_cur ) #define env_cur (G.env_cur )
#define env_var (G.env_var ) #define env_var (G.env_var )
#define INIT_G() \ #define INIT_G() do { \
do { \ cmax = 30; \
cmax = 30; \ env_cur = &env_var[0]; \
env_cur = &env_var[0]; \ } while (0)
} while (0)
/* We have to be careful about leaking memory in repeated setenv's */ /* We have to be careful about leaking memory in repeated setenv's */

View File

@ -92,9 +92,7 @@ struct globals {
#define block_buf (G.block_buf ) #define block_buf (G.block_buf )
#define user_opt (G.user_opt ) #define user_opt (G.user_opt )
#define error_pkt (G.error_pkt ) #define error_pkt (G.error_pkt )
#define INIT_G() \ #define INIT_G() do { } while (0)
do { \
} while (0)
#define error_pkt_reason (error_pkt[3]) #define error_pkt_reason (error_pkt[3])
#define error_pkt_str (error_pkt + 4) #define error_pkt_str (error_pkt + 4)

View File

@ -64,7 +64,7 @@ static void add_param_req_option(struct dhcpMessage *packet)
for (i = 0; (c = dhcp_options[i].code) != 0; i++) { for (i = 0; (c = dhcp_options[i].code) != 0; i++) {
if (((dhcp_options[i].flags & OPTION_REQ) if (((dhcp_options[i].flags & OPTION_REQ)
&& !client_config.no_default_options) && !client_config.no_default_options)
|| (client_config.opt_mask[c >> 3] & (1 << (c & 7))) || (client_config.opt_mask[c >> 3] & (1 << (c & 7)))
) { ) {
packet->options[end + OPT_DATA + len] = c; packet->options[end + OPT_DATA + len] = c;

View File

@ -89,12 +89,11 @@ struct globals {
enum { LINE_BUF_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line_buf) }; enum { LINE_BUF_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line_buf) };
#define G (*(struct globals*)&bb_common_bufsiz1) #define G (*(struct globals*)&bb_common_bufsiz1)
#define INIT_G() \ #define INIT_G() do { \
do { \ struct G_sizecheck { \
struct G_sizecheck { \ char G_sizecheck[sizeof(G) > COMMON_BUFSIZE ? -1 : 1]; \
char G_sizecheck[sizeof(G) > COMMON_BUFSIZE ? -1 : 1]; \ }; \
}; \ } while (0)
} while (0)
#define top (G.top ) #define top (G.top )
#define ntop (G.ntop ) #define ntop (G.ntop )
#define sort_field (G.sort_field ) #define sort_field (G.sort_field )

View File

@ -103,10 +103,9 @@ struct globals {
#define logpipe (G.logpipe ) #define logpipe (G.logpipe )
#define dir (G.dir ) #define dir (G.dir )
#define svd (G.svd ) #define svd (G.svd )
#define INIT_G() \ #define INIT_G() do { \
do { \ pidchanged = 1; \
pidchanged = 1; \ } while (0)
} while (0)
static void fatal2_cannot(const char *m1, const char *m2) static void fatal2_cannot(const char *m1, const char *m2)
{ {

View File

@ -1063,7 +1063,7 @@ static int o_save_ptr_helper(o_string *o, int n)
/* list[n] points to string_start, make space for 16 more pointers */ /* list[n] points to string_start, make space for 16 more pointers */
o->maxlen += 0x10 * sizeof(list[0]); o->maxlen += 0x10 * sizeof(list[0]);
o->data = xrealloc(o->data, o->maxlen + 1); o->data = xrealloc(o->data, o->maxlen + 1);
list = (char**)o->data; list = (char**)o->data;
memmove(list + n + 0x10, list + n, string_len); memmove(list + n + 0x10, list + n, string_len);
o->length += 0x10 * sizeof(list[0]); o->length += 0x10 * sizeof(list[0]);
} else } else
@ -3018,7 +3018,7 @@ static void done_pipe(struct p_context *ctx, pipe_style type)
/* Create the memory for child, roughly: /* Create the memory for child, roughly:
* ctx->pipe->progs = new struct child_prog; * ctx->pipe->progs = new struct child_prog;
* ctx->pipe->progs[0].family = ctx->pipe; * ctx->pipe->progs[0].family = ctx->pipe;
* ctx->child = &ctx->pipe->progs[0]; * ctx->child = &ctx->pipe->progs[0];
*/ */
done_command(ctx); done_command(ctx);
} }

View File

@ -39,10 +39,9 @@ struct globals {
#define SMrup (G.SMrup) #define SMrup (G.SMrup)
#define SMrdn (G.SMrdn) #define SMrdn (G.SMrdn)
#define shbuf (G.shbuf) #define shbuf (G.shbuf)
#define INIT_G() \ #define INIT_G() do { \
do { \ memcpy(SMrup, init_sem, sizeof(init_sem)); \
memcpy(SMrup, init_sem, sizeof(init_sem)); \ } while (0)
} while (0)
static void error_exit(const char *str) ATTRIBUTE_NORETURN; static void error_exit(const char *str) ATTRIBUTE_NORETURN;
static void error_exit(const char *str) static void error_exit(const char *str)

View File

@ -244,15 +244,15 @@ static ALWAYS_INLINE unsigned div_roundup(unsigned size, unsigned n)
return (size + n-1) / n; return (size + n-1) / n;
} }
#if ENABLE_FEATURE_MINIX2 #if !ENABLE_FEATURE_MINIX2
#define INODE_BLOCKS div_roundup(INODES, (version2 ? MINIX2_INODES_PER_BLOCK \ #define INODE_BLOCKS div_roundup(INODES, MINIX1_INODES_PER_BLOCK)
: MINIX1_INODES_PER_BLOCK))
#else #else
#define INODE_BLOCKS div_roundup(INODES, MINIX1_INODES_PER_BLOCK) #define INODE_BLOCKS div_roundup(INODES, \
(version2 ? MINIX2_INODES_PER_BLOCK : MINIX1_INODES_PER_BLOCK))
#endif #endif
#define INODE_BUFFER_SIZE (INODE_BLOCKS * BLOCK_SIZE) #define INODE_BUFFER_SIZE (INODE_BLOCKS * BLOCK_SIZE)
#define NORM_FIRSTZONE (2 + IMAPS + ZMAPS + INODE_BLOCKS) #define NORM_FIRSTZONE (2 + IMAPS + ZMAPS + INODE_BLOCKS)
/* Before you ask "where they come from?": */ /* Before you ask "where they come from?": */
/* setbit/clrbit are supplied by sys/param.h */ /* setbit/clrbit are supplied by sys/param.h */

View File

@ -300,9 +300,9 @@ static void make_device(char *path, int delete)
/* File callback for /sys/ traversal */ /* File callback for /sys/ traversal */
static int fileAction(const char *fileName, static int fileAction(const char *fileName,
struct stat *statbuf ATTRIBUTE_UNUSED, struct stat *statbuf ATTRIBUTE_UNUSED,
void *userData, void *userData,
int depth ATTRIBUTE_UNUSED) int depth ATTRIBUTE_UNUSED)
{ {
size_t len = strlen(fileName) - 4; /* can't underflow */ size_t len = strlen(fileName) - 4; /* can't underflow */
char *scratch = userData; char *scratch = userData;
@ -320,9 +320,9 @@ static int fileAction(const char *fileName,
/* Directory callback for /sys/ traversal */ /* Directory callback for /sys/ traversal */
static int dirAction(const char *fileName ATTRIBUTE_UNUSED, static int dirAction(const char *fileName ATTRIBUTE_UNUSED,
struct stat *statbuf ATTRIBUTE_UNUSED, struct stat *statbuf ATTRIBUTE_UNUSED,
void *userData ATTRIBUTE_UNUSED, void *userData ATTRIBUTE_UNUSED,
int depth) int depth)
{ {
return (depth >= MAX_SYSFS_DEPTH ? SKIP : TRUE); return (depth >= MAX_SYSFS_DEPTH ? SKIP : TRUE);
} }

View File

@ -149,7 +149,7 @@ static ALWAYS_INLINE unsigned div_roundup(unsigned size, unsigned n)
#else #else
# define SB_ZONES (version2 ? SB.s_zones : SB.s_nzones) # define SB_ZONES (version2 ? SB.s_zones : SB.s_nzones)
# define INODE_BLOCKS div_roundup(SB_INODES, \ # define INODE_BLOCKS div_roundup(SB_INODES, \
version2 ? MINIX2_INODES_PER_BLOCK : MINIX1_INODES_PER_BLOCK) (version2 ? MINIX2_INODES_PER_BLOCK : MINIX1_INODES_PER_BLOCK))
#endif #endif
#define INODE_BUFFER_SIZE (INODE_BLOCKS * BLOCK_SIZE) #define INODE_BUFFER_SIZE (INODE_BLOCKS * BLOCK_SIZE)