From bc68cd14ccaebc17e7e03a08e51fddfb91007624 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 10 Mar 2006 19:22:06 +0000 Subject: Patch from Denis Vlasenko turning static const int (which gets emitted into the busybox binary) into enums (which don't). --- util-linux/fbset.c | 28 ++++++++++++---------- util-linux/fsck_minix.c | 51 ++++++++++++++++++++------------------- util-linux/getopt.c | 8 ++++--- util-linux/mkswap.c | 2 +- util-linux/nfsmount.c | 64 +++++++++++++++++++++++++++---------------------- 5 files changed, 84 insertions(+), 69 deletions(-) (limited to 'util-linux') diff --git a/util-linux/fbset.c b/util-linux/fbset.c index 2e895be8d..d2667cf84 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c @@ -38,11 +38,11 @@ #define DEFAULTFBDEV FB_0 #define DEFAULTFBMODE "/etc/fb.modes" -static const int OPT_CHANGE = (1 << 0); -static const int OPT_INFO = (1 << 1); -static const int OPT_READMODE = (1 << 2); - enum { + OPT_CHANGE = (1 << 0), + OPT_INFO = (1 << 1), + OPT_READMODE = (1 << 2), + CMD_FB = 1, CMD_DB = 2, CMD_GEOMETRY = 3, @@ -84,8 +84,10 @@ enum { static unsigned int g_options = 0; /* Stuff stolen from the kernel's fb.h */ -static const int FBIOGET_VSCREENINFO = 0x4600; -static const int FBIOPUT_VSCREENINFO = 0x4601; +enum { + FBIOGET_VSCREENINFO = 0x4600, + FBIOPUT_VSCREENINFO = 0x4601 +}; struct fb_bitfield { uint32_t offset; /* beginning of bitfield */ uint32_t length; /* length of bitfield */ @@ -179,12 +181,14 @@ static const struct cmdoptions_t { #ifdef CONFIG_FEATURE_FBSET_READMODE /* taken from linux/fb.h */ -static const int FB_VMODE_INTERLACED = 1; /* interlaced */ -static const int FB_VMODE_DOUBLE = 2; /* double scan */ -static const int FB_SYNC_HOR_HIGH_ACT = 1; /* horizontal sync high active */ -static const int FB_SYNC_VERT_HIGH_ACT = 2; /* vertical sync high active */ -static const int FB_SYNC_EXT = 4; /* external sync */ -static const int FB_SYNC_COMP_HIGH_ACT = 8; /* composite sync high active */ +enum { + FB_VMODE_INTERLACED = 1, /* interlaced */ + FB_VMODE_DOUBLE = 2, /* double scan */ + FB_SYNC_HOR_HIGH_ACT = 1, /* horizontal sync high active */ + FB_SYNC_VERT_HIGH_ACT = 2, /* vertical sync high active */ + FB_SYNC_EXT = 4, /* external sync */ + FB_SYNC_COMP_HIGH_ACT = 8 /* composite sync high active */ +}; #endif static int readmode(struct fb_var_screeninfo *base, const char *fn, const char *mode) diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index 1d3e90aa8..d7d81f130 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c @@ -98,26 +98,8 @@ #include #include "busybox.h" -static const int MINIX_ROOT_INO = 1; -static const int MINIX_LINK_MAX = 250; -static const int MINIX2_LINK_MAX = 65530; - -static const int MINIX_I_MAP_SLOTS = 8; -static const int MINIX_Z_MAP_SLOTS = 64; -static const int MINIX_SUPER_MAGIC = 0x137F; /* original minix fs */ -static const int MINIX_SUPER_MAGIC2 = 0x138F; /* minix fs, 30 char names */ -static const int MINIX2_SUPER_MAGIC = 0x2468; /* minix V2 fs */ -static const int MINIX2_SUPER_MAGIC2 = 0x2478; /* minix V2 fs, 30 char names */ -static const int MINIX_VALID_FS = 0x0001; /* Clean fs. */ -static const int MINIX_ERROR_FS = 0x0002; /* fs has errors. */ - -#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) -#define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode))) - -static const int MINIX_V1 = 0x0001; /* original minix fs */ -static const int MINIX_V2 = 0x0002; /* minix V2 fs */ - -#define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version +#define BLOCK_SIZE_BITS 10 +#define BLOCK_SIZE (1<i_sb->u.minix_sb.s_version + /* * minix super-block data on disk */ @@ -172,8 +177,6 @@ struct minix_dir_entry { char name[0]; }; -#define BLOCK_SIZE_BITS 10 -#define BLOCK_SIZE (1<= 4) ? 3 : 2) -static const int EX_FAIL = 32; /* mount failure */ -static const int EX_BG = 256; /* retry in background (internal only) */ +enum { + EX_FAIL = 32, /* mount failure */ + EX_BG = 256 /* retry in background (internal only) */ +}; /* -- cgit v1.2.3