svn commit: trunk/busybox: archival archival/libunarchive console-t etc...

landley at busybox.net landley at busybox.net
Fri Mar 10 19:22:22 UTC 2006


Author: landley
Date: 2006-03-10 11:22:06 -0800 (Fri, 10 Mar 2006)
New Revision: 14513

Log:
Patch from Denis Vlasenko turning static const int (which gets emitted into
the busybox binary) into enums (which don't).


Modified:
   trunk/busybox/archival/gzip.c
   trunk/busybox/archival/libunarchive/decompress_unzip.c
   trunk/busybox/console-tools/chvt.c
   trunk/busybox/console-tools/deallocvt.c
   trunk/busybox/console-tools/loadfont.c
   trunk/busybox/console-tools/setkeycodes.c
   trunk/busybox/coreutils/cut.c
   trunk/busybox/coreutils/stty.c
   trunk/busybox/editors/awk.c
   trunk/busybox/editors/vi.c
   trunk/busybox/init/init.c
   trunk/busybox/libbb/get_console.c
   trunk/busybox/libbb/speed_table.c
   trunk/busybox/libbb/xreadlink.c
   trunk/busybox/modutils/insmod.c
   trunk/busybox/modutils/lsmod.c
   trunk/busybox/networking/dnsd.c
   trunk/busybox/networking/fakeidentd.c
   trunk/busybox/networking/ping.c
   trunk/busybox/networking/ping6.c
   trunk/busybox/networking/telnet.c
   trunk/busybox/networking/zcip.c
   trunk/busybox/shell/lash.c
   trunk/busybox/util-linux/fbset.c
   trunk/busybox/util-linux/fsck_minix.c
   trunk/busybox/util-linux/getopt.c
   trunk/busybox/util-linux/mkswap.c
   trunk/busybox/util-linux/nfsmount.c


Changeset:
Modified: trunk/busybox/archival/gzip.c
===================================================================
--- trunk/busybox/archival/gzip.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/archival/gzip.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -732,25 +732,26 @@
 static int eofile;		/* flag set at end of input file */
 static unsigned lookahead;	/* number of valid bytes ahead in window */
 
-static const unsigned max_chain_length = 4096;
+enum {
+	max_chain_length = 4096,
 
 /* To speed up deflation, hash chains are never searched beyond this length.
  * A higher limit improves compression ratio but degrades the speed.
  */
 
-static const unsigned int max_lazy_match = 258;
+	max_lazy_match = 258,
 
 /* Attempt to find a better match only when the current match is strictly
  * smaller than this value. This mechanism is used only for compression
  * levels >= 4.
  */
-#define max_insert_length  max_lazy_match
+	max_insert_length = max_lazy_match,
 /* Insert new strings in the hash table only if the match length
  * is not greater than this length. This saves time but degrades compression.
  * max_insert_length is used only for compression levels <= 3.
  */
 
-static const unsigned good_match = 32;
+	good_match = 32,
 
 /* Use a faster search when the previous match is longer than this */
 
@@ -761,12 +762,13 @@
  * found for specific files.
  */
 
-static const int nice_match = 258;	/* Stop searching when current match exceeds this */
+	nice_match = 258	/* Stop searching when current match exceeds this */
 
 /* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
  * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
  * meaning.
  */
+};
 
 #define EQUAL 0
 /* result of memcmp for equal strings */

Modified: trunk/busybox/archival/libunarchive/decompress_unzip.c
===================================================================
--- trunk/busybox/archival/libunarchive/decompress_unzip.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/archival/libunarchive/decompress_unzip.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -92,7 +92,7 @@
 
 /* gunzip_window size--must be a power of two, and
  *  at least 32K for zip's deflate method */
-static const unsigned int gunzip_wsize = 0x8000;
+enum { gunzip_wsize = 0x8000 };
 static unsigned char *gunzip_window;
 
 static unsigned int *gunzip_crc_table;

Modified: trunk/busybox/console-tools/chvt.c
===================================================================
--- trunk/busybox/console-tools/chvt.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/console-tools/chvt.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -29,8 +29,10 @@
 #include "busybox.h"
 
 /* From <linux/vt.h> */
-static const int VT_ACTIVATE = 0x5606;  /* make vt active */
-static const int VT_WAITACTIVE = 0x5607;  /* wait for vt active */
+enum {
+	VT_ACTIVATE = 0x5606,   /* make vt active */
+	VT_WAITACTIVE = 0x5607  /* wait for vt active */
+};
 
 int chvt_main(int argc, char **argv)
 {

Modified: trunk/busybox/console-tools/deallocvt.c
===================================================================
--- trunk/busybox/console-tools/deallocvt.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/console-tools/deallocvt.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -30,7 +30,7 @@
 #include "busybox.h"
 
 /* From <linux/vt.h> */
-static const int VT_DISALLOCATE = 0x5608;  /* free memory associated to vt */
+enum { VT_DISALLOCATE = 0x5608 }; /* free memory associated to vt */
 
 int deallocvt_main(int argc, char *argv[])
 {

Modified: trunk/busybox/console-tools/loadfont.c
===================================================================
--- trunk/busybox/console-tools/loadfont.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/console-tools/loadfont.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -21,13 +21,15 @@
 #include <endian.h>
 #include "busybox.h"
 
-static const int PSF_MAGIC1 = 0x36;
-static const int PSF_MAGIC2 = 0x04;
+enum{
+	PSF_MAGIC1 = 0x36,
+	PSF_MAGIC2 = 0x04,
 
-static const int PSF_MODE512 = 0x01;
-static const int PSF_MODEHASTAB = 0x02;
-static const int PSF_MAXMODE = 0x03;
-static const int PSF_SEPARATOR = 0xFFFF;
+	PSF_MODE512 = 0x01,
+	PSF_MODEHASTAB = 0x02,
+	PSF_MAXMODE = 0x03,
+	PSF_SEPARATOR = 0xFFFF
+};
 
 struct psf_header {
 	unsigned char magic1, magic2;	/* Magic number */

Modified: trunk/busybox/console-tools/setkeycodes.c
===================================================================
--- trunk/busybox/console-tools/setkeycodes.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/console-tools/setkeycodes.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -33,7 +33,9 @@
 struct kbkeycode {
 	unsigned int scancode, keycode;
 };
-static const int KDSETKEYCODE = 0x4B4D;  /* write kernel keycode table entry */
+enum {
+	KDSETKEYCODE = 0x4B4D  /* write kernel keycode table entry */
+};
 
 extern int
 setkeycodes_main(int argc, char** argv)

Modified: trunk/busybox/coreutils/cut.c
===================================================================
--- trunk/busybox/coreutils/cut.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/coreutils/cut.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -45,9 +45,11 @@
 	int endpos;
 };
 
-static const int BOL = 0;
-static const int EOL = INT_MAX;
-static const int NON_RANGE = -1;
+enum {
+	BOL = 0,
+	EOL = INT_MAX,
+	NON_RANGE = -1
+};
 
 static struct cut_list *cut_lists = NULL; /* growable array holding a series of lists */
 static unsigned int nlists = 0; /* number of elements in above list */

Modified: trunk/busybox/coreutils/stty.c
===================================================================
--- trunk/busybox/coreutils/stty.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/coreutils/stty.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -343,10 +343,11 @@
 	MI_ENTRY(stty_dec,   combination, OMIT,              0,          0 ),
 };
 
-static const int NUM_mode_info =
+enum {
+	NUM_mode_info =
+	(sizeof(mode_info) / sizeof(struct mode_info))
+};
 
-	(sizeof(mode_info) / sizeof(struct mode_info));
-
 /* Control character settings.  */
 struct control_info {
 	const char *name;                       /* Name given on command line.  */
@@ -395,8 +396,10 @@
 	{stty_time,  0,       VTIME},
 };
 
-static const int NUM_control_info =
-	(sizeof(control_info) / sizeof(struct control_info));
+enum {
+	NUM_control_info =
+	(sizeof(control_info) / sizeof(struct control_info))
+};
 
 #define EMT(t) ((enum mode_type)(t))
 

Modified: trunk/busybox/editors/awk.c
===================================================================
--- trunk/busybox/editors/awk.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/editors/awk.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -392,7 +392,7 @@
 /* hash size may grow to these values */
 #define FIRST_PRIME 61;
 static const unsigned int PRIMES[] = { 251, 1021, 4093, 16381, 65521 };
-static const unsigned int NPRIMES = sizeof(PRIMES) / sizeof(unsigned int);
+enum { NPRIMES = sizeof(PRIMES) / sizeof(unsigned int) };
 
 /* globals */
 

Modified: trunk/busybox/editors/vi.c
===================================================================
--- trunk/busybox/editors/vi.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/editors/vi.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -138,18 +138,20 @@
 static const char CMdown[] = "\n";
 
 
-static const int YANKONLY = FALSE;
-static const int YANKDEL = TRUE;
-static const int FORWARD = 1;	// code depends on "1"  for array index
-static const int BACK = -1;	// code depends on "-1" for array index
-static const int LIMITED = 0;	// how much of text[] in char_search
-static const int FULL = 1;	// how much of text[] in char_search
+enum {
+	YANKONLY = FALSE,
+	YANKDEL = TRUE,
+	FORWARD = 1,	// code depends on "1"  for array index
+	BACK = -1,	// code depends on "-1" for array index
+	LIMITED = 0,	// how much of text[] in char_search
+	FULL = 1,	// how much of text[] in char_search
 
-static const int S_BEFORE_WS = 1;	// used in skip_thing() for moving "dot"
-static const int S_TO_WS = 2;		// used in skip_thing() for moving "dot"
-static const int S_OVER_WS = 3;		// used in skip_thing() for moving "dot"
-static const int S_END_PUNCT = 4;	// used in skip_thing() for moving "dot"
-static const int S_END_ALNUM = 5;	// used in skip_thing() for moving "dot"
+	S_BEFORE_WS = 1,	// used in skip_thing() for moving "dot"
+	S_TO_WS = 2,		// used in skip_thing() for moving "dot"
+	S_OVER_WS = 3,		// used in skip_thing() for moving "dot"
+	S_END_PUNCT = 4,	// used in skip_thing() for moving "dot"
+	S_END_ALNUM = 5 	// used in skip_thing() for moving "dot"
+};
 
 typedef unsigned char Byte;
 

Modified: trunk/busybox/init/init.c
===================================================================
--- trunk/busybox/init/init.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/init/init.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -47,7 +47,7 @@
 	unsigned short v_signal;	/* signal to send */
 	unsigned short v_state;	/* vt bitmask */
 };
-static const int VT_GETSTATE = 0x5603;	/* get global vt state info */
+enum { VT_GETSTATE = 0x5603 };	/* get global vt state info */
 
 /* From <linux/serial.h> */
 struct serial_struct {
@@ -145,22 +145,25 @@
 static char *log_console = VC_5;
 #endif
 static sig_atomic_t got_cont = 0;
-static const int LOG = 0x1;
-static const int CONSOLE = 0x2;
 
+enum {
+	LOG = 0x1,
+	CONSOLE = 0x2,
+
 #if defined CONFIG_FEATURE_EXTRA_QUIET
-static const int MAYBE_CONSOLE = 0x0;
+	MAYBE_CONSOLE = 0x0,
 #else
-#define MAYBE_CONSOLE	CONSOLE
+	MAYBE_CONSOLE = CONSOLE,
 #endif
+
 #ifndef RB_HALT_SYSTEM
-static const int RB_HALT_SYSTEM = 0xcdef0123;
-static const int RB_ENABLE_CAD = 0x89abcdef;
-static const int RB_DISABLE_CAD = 0;
-
-#define RB_POWER_OFF    0x4321fedc
-static const int RB_AUTOBOOT = 0x01234567;
+	RB_HALT_SYSTEM = 0xcdef0123,
+	RB_ENABLE_CAD = 0x89abcdef,
+	RB_DISABLE_CAD = 0,
+	RB_POWER_OFF = 0x4321fedc,
+	RB_AUTOBOOT = 0x01234567,
 #endif
+};
 
 static const char * const environment[] = {
 	"HOME=/",

Modified: trunk/busybox/libbb/get_console.c
===================================================================
--- trunk/busybox/libbb/get_console.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/libbb/get_console.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -30,7 +30,7 @@
 
 
 /* From <linux/kd.h> */
-static const int KDGKBTYPE = 0x4B33;  /* get keyboard type */
+enum { KDGKBTYPE = 0x4B33 };  /* get keyboard type */
 
 
 static int open_a_console(const char *fnam)

Modified: trunk/busybox/libbb/speed_table.c
===================================================================
--- trunk/busybox/libbb/speed_table.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/libbb/speed_table.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -67,7 +67,7 @@
 #endif
 };
 
-static const int NUM_SPEEDS = (sizeof(speeds) / sizeof(struct speed_map));
+enum { NUM_SPEEDS = (sizeof(speeds) / sizeof(struct speed_map)) };
 
 unsigned long bb_baud_to_value(speed_t speed)
 {

Modified: trunk/busybox/libbb/xreadlink.c
===================================================================
--- trunk/busybox/libbb/xreadlink.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/libbb/xreadlink.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -15,7 +15,7 @@
 
 char *xreadlink(const char *path)
 {
-	static const int GROWBY = 80; /* how large we will grow strings by */
+	enum { GROWBY = 80 }; /* how large we will grow strings by */
 
 	char *buf = NULL;
 	int bufsize = 0, readsize = 0;

Modified: trunk/busybox/modutils/insmod.c
===================================================================
--- trunk/busybox/modutils/insmod.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/modutils/insmod.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -343,7 +343,7 @@
 
 
 #ifndef MODUTILS_MODULE_H
-static const int MODUTILS_MODULE_H = 1;
+/* Why? static const int MODUTILS_MODULE_H = 1;*/
 
 #ident "$Id: insmod.c,v 1.126 2004/12/26 09:13:32 vapier Exp $"
 
@@ -364,9 +364,11 @@
 #undef tgt_sizeof_char_p
 #undef tgt_sizeof_void_p
 #undef tgt_long
-static const int tgt_sizeof_long = 8;
-static const int tgt_sizeof_char_p = 8;
-static const int tgt_sizeof_void_p = 8;
+enum {
+	tgt_sizeof_long = 8,
+	tgt_sizeof_char_p = 8,
+	tgt_sizeof_void_p = 8
+};
 #define tgt_long		long long
 #endif
 
@@ -441,24 +443,27 @@
 };
 
 /* Bits of module.flags.  */
-static const int NEW_MOD_RUNNING = 1;
-static const int NEW_MOD_DELETED = 2;
-static const int NEW_MOD_AUTOCLEAN = 4;
-static const int NEW_MOD_VISITED = 8;
-static const int NEW_MOD_USED_ONCE = 16;
+enum {
+	NEW_MOD_RUNNING = 1,
+	NEW_MOD_DELETED = 2,
+	NEW_MOD_AUTOCLEAN = 4,
+	NEW_MOD_VISITED = 8,
+	NEW_MOD_USED_ONCE = 16
+};
 
 int init_module(const char *name, const struct new_module *);
 int query_module(const char *name, int which, void *buf,
 		size_t bufsize, size_t *ret);
 
 /* Values for query_module's which.  */
+enum {
+	QM_MODULES = 1,
+	QM_DEPS = 2,
+	QM_REFS = 3,
+	QM_SYMBOLS = 4,
+	QM_INFO = 5
+};
 
-static const int QM_MODULES = 1;
-static const int QM_DEPS = 2;
-static const int QM_REFS = 3;
-static const int QM_SYMBOLS = 4;
-static const int QM_INFO = 5;
-
 /*======================================================================*/
 /* The system calls unchanged between 2.0 and 2.1.  */
 
@@ -501,7 +506,7 @@
 
 
 #ifndef MODUTILS_OBJ_H
-static const int MODUTILS_OBJ_H = 1;
+/* Why? static const int MODUTILS_OBJ_H = 1; */
 
 #ident "$Id: insmod.c,v 1.126 2004/12/26 09:13:32 vapier Exp $"
 
@@ -700,7 +705,7 @@
 
 
 #define _PATH_MODULES	"/lib/modules"
-static const int STRVERSIONLEN = 32;
+enum { STRVERSIONLEN = 32 };
 
 /*======================================================================*/
 

Modified: trunk/busybox/modutils/lsmod.c
===================================================================
--- trunk/busybox/modutils/lsmod.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/modutils/lsmod.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -82,20 +82,22 @@
 
 int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret);
 
+enum {
 /* Values for query_module's which.  */
-static const int QM_MODULES = 1;
-static const int QM_DEPS = 2;
-static const int QM_REFS = 3;
-static const int QM_SYMBOLS = 4;
-static const int QM_INFO = 5;
+	QM_MODULES = 1,
+	QM_DEPS = 2,
+	QM_REFS = 3,
+	QM_SYMBOLS = 4,
+	QM_INFO = 5,
 
 /* Bits of module.flags.  */
-static const int NEW_MOD_RUNNING = 1;
-static const int NEW_MOD_DELETED = 2;
-static const int NEW_MOD_AUTOCLEAN = 4;
-static const int NEW_MOD_VISITED = 8;
-static const int NEW_MOD_USED_ONCE = 16;
-static const int NEW_MOD_INITIALIZING = 64;
+	NEW_MOD_RUNNING = 1,
+	NEW_MOD_DELETED = 2,
+	NEW_MOD_AUTOCLEAN = 4,
+	NEW_MOD_VISITED = 8,
+	NEW_MOD_USED_ONCE = 16,
+	NEW_MOD_INITIALIZING = 64
+};
 
 int lsmod_main(int argc, char **argv)
 {

Modified: trunk/busybox/networking/dnsd.c
===================================================================
--- trunk/busybox/networking/dnsd.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/networking/dnsd.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -27,11 +27,12 @@
 #define LOCK_FILE       "/var/run/dnsd.lock"
 #define LOG_FILE        "/var/log/dnsd.log"
 
-#define  MAX_HOST_LEN 16        // longest host name allowed is 15
-#define IP_STRING_LEN 18        // .xxx.xxx.xxx.xxx\0
+enum {
+	MAX_HOST_LEN = 16,      // longest host name allowed is 15
+	IP_STRING_LEN = 18,     // .xxx.xxx.xxx.xxx\0
 
 //must be strlen('.in-addr.arpa') larger than IP_STRING_LEN
-static const int MAX_NAME_LEN = (IP_STRING_LEN + 13);
+	MAX_NAME_LEN = (IP_STRING_LEN + 13),
 
 /* Cannot get bigger packets than 512 per RFC1035
    In practice this can be set considerably smaller:
@@ -39,12 +40,13 @@
    ttl(4B) + rlen(2B) + r (MAX_NAME_LEN =21B) +
    2*querystring (2 MAX_NAME_LEN= 42B), all together 90 Byte
 */
-static const int MAX_PACK_LEN = 512 + 1;
+	MAX_PACK_LEN = 512 + 1,
 
-#define  DEFAULT_TTL 30;        // increase this when not testing?
+	DEFAULT_TTL = 30,       // increase this when not testing?
 
-static const int REQ_A = 1;
-static const int REQ_PTR = 12;
+	REQ_A = 1,
+	REQ_PTR = 12
+};
 
 struct dns_repl {		// resource record, add 0 or 1 to accepted dns_msg in resp
 	uint16_t rlen;

Modified: trunk/busybox/networking/fakeidentd.c
===================================================================
--- trunk/busybox/networking/fakeidentd.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/networking/fakeidentd.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -51,7 +51,7 @@
 #define MAXIDLETIME 45
 
 static const char ident_substr[] = " : USERID : UNIX : ";
-static const int ident_substr_len = sizeof(ident_substr) - 1;
+enum { ident_substr_len = sizeof(ident_substr) - 1 };
 #define PIDFILE "/var/run/identd.pid"
 
 /*

Modified: trunk/busybox/networking/ping.c
===================================================================
--- trunk/busybox/networking/ping.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/networking/ping.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -33,13 +33,15 @@
 #include "busybox.h"
 
 
-static const int DEFDATALEN = 56;
-static const int MAXIPLEN = 60;
-static const int MAXICMPLEN = 76;
-static const int MAXPACKET = 65468;
-#define	MAX_DUP_CHK	(8 * 128)
-static const int MAXWAIT = 10;
-static const int PINGINTERVAL = 1;		/* second */
+enum {
+	DEFDATALEN = 56,
+	MAXIPLEN = 60,
+	MAXICMPLEN = 76,
+	MAXPACKET = 65468,
+	MAX_DUP_CHK = (8 * 128),
+	MAXWAIT = 10,
+	PINGINTERVAL = 1		/* second */
+};
 
 #define O_QUIET         (1 << 0)
 

Modified: trunk/busybox/networking/ping6.c
===================================================================
--- trunk/busybox/networking/ping6.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/networking/ping6.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -56,13 +56,15 @@
 #include <stddef.h>				/* offsetof */
 #include "busybox.h"
 
-static const int DEFDATALEN = 56;
-static const int MAXIPLEN = 60;
-static const int MAXICMPLEN = 76;
-static const int MAXPACKET = 65468;
-#define	MAX_DUP_CHK	(8 * 128)
-static const int MAXWAIT = 10;
-static const int PINGINTERVAL = 1;		/* second */
+enum {
+	DEFDATALEN = 56,
+	MAXIPLEN = 60,
+	MAXICMPLEN = 76,
+	MAXPACKET = 65468,
+	MAX_DUP_CHK = (8 * 128),
+	MAXWAIT = 10,
+	PINGINTERVAL = 1		/* second */
+};
 
 #define O_QUIET         (1 << 0)
 #define O_VERBOSE       (1 << 1)

Modified: trunk/busybox/networking/telnet.c
===================================================================
--- trunk/busybox/networking/telnet.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/networking/telnet.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -35,7 +35,7 @@
 #include "busybox.h"
 
 #if 0
-static const int DOTRACE = 1;
+enum { DOTRACE = 1 };
 #endif
 
 #ifdef DOTRACE
@@ -55,14 +55,14 @@
 #define DATABUFSIZE  128
 #define IACBUFSIZE   128
 
-static const int CHM_TRY = 0;
-static const int CHM_ON = 1;
-static const int CHM_OFF = 2;
+enum {
+	CHM_TRY = 0,
+	CHM_ON = 1,
+	CHM_OFF = 2,
 
-static const int UF_ECHO = 0x01;
-static const int UF_SGA = 0x02;
+	UF_ECHO = 0x01,
+	UF_SGA = 0x02,
 
-enum {
 	TS_0 = 1,
 	TS_IAC = 2,
 	TS_OPT = 3,

Modified: trunk/busybox/networking/zcip.c
===================================================================
--- trunk/busybox/networking/zcip.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/networking/zcip.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -62,20 +62,22 @@
 	struct in_addr target_ip;
 } ATTRIBUTE_PACKED;
 
+enum {
 /* 169.254.0.0 */
-static const uint32_t LINKLOCAL_ADDR = 0xa9fe0000;
+	LINKLOCAL_ADDR = 0xa9fe0000,
 
 /* protocol timeout parameters, specified in seconds */
-static const unsigned PROBE_WAIT = 1;
-static const unsigned PROBE_MIN = 1;
-static const unsigned PROBE_MAX = 2;
-static const unsigned PROBE_NUM = 3;
-static const unsigned MAX_CONFLICTS = 10;
-static const unsigned RATE_LIMIT_INTERVAL = 60;
-static const unsigned ANNOUNCE_WAIT = 2;
-static const unsigned ANNOUNCE_NUM = 2;
-static const unsigned ANNOUNCE_INTERVAL = 2;
-static const time_t DEFEND_INTERVAL = 10;
+	PROBE_WAIT = 1,
+	PROBE_MIN = 1,
+	PROBE_MAX = 2,
+	PROBE_NUM = 3,
+	MAX_CONFLICTS = 10,
+	RATE_LIMIT_INTERVAL = 60,
+	ANNOUNCE_WAIT = 2,
+	ANNOUNCE_NUM = 2,
+	ANNOUNCE_INTERVAL = 2,
+	DEFEND_INTERVAL = 10
+};
 
 static const unsigned char ZCIP_VERSION[] = "0.75 (18 April 2005)";
 static char *prog;

Modified: trunk/busybox/shell/lash.c
===================================================================
--- trunk/busybox/shell/lash.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/shell/lash.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -57,11 +57,13 @@
 };
 #endif
 
-static const unsigned int DEFAULT_CONTEXT=0x1;
-static const unsigned int IF_TRUE_CONTEXT=0x2;
-static const unsigned int IF_FALSE_CONTEXT=0x4;
-static const unsigned int THEN_EXP_CONTEXT=0x8;
-static const unsigned int ELSE_EXP_CONTEXT=0x10;
+enum {
+	DEFAULT_CONTEXT = 0x1,
+	IF_TRUE_CONTEXT = 0x2,
+	IF_FALSE_CONTEXT = 0x4,
+	THEN_EXP_CONTEXT = 0x8,
+	ELSE_EXP_CONTEXT = 0x10
+};
 
 #ifdef CONFIG_LASH_PIPE_N_REDIRECTS
 struct redir_struct {

Modified: trunk/busybox/util-linux/fbset.c
===================================================================
--- trunk/busybox/util-linux/fbset.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/util-linux/fbset.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -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),
 
-enum {
 	CMD_FB = 1,
 	CMD_DB = 2,
 	CMD_GEOMETRY = 3,
@@ -84,8 +84,10 @@
 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 @@
 
 #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)

Modified: trunk/busybox/util-linux/fsck_minix.c
===================================================================
--- trunk/busybox/util-linux/fsck_minix.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/util-linux/fsck_minix.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -98,27 +98,9 @@
 #include <sys/param.h>
 #include "busybox.h"
 
-static const int MINIX_ROOT_INO = 1;
-static const int MINIX_LINK_MAX = 250;
-static const int MINIX2_LINK_MAX = 65530;
+#define BLOCK_SIZE_BITS 10
+#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
 
-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
-
 /*
  * This is the original minix inode layout on disk.
  * Note the 8-bit gid and atime and ctime.
@@ -151,6 +133,29 @@
 	uint32_t i_zone[10];
 };
 
+enum {
+	MINIX_ROOT_INO = 1,
+	MINIX_LINK_MAX = 250,
+	MINIX2_LINK_MAX = 65530,
+
+	MINIX_I_MAP_SLOTS = 8,
+	MINIX_Z_MAP_SLOTS = 64,
+	MINIX_SUPER_MAGIC = 0x137F,		/* original minix fs */
+	MINIX_SUPER_MAGIC2 = 0x138F,		/* minix fs, 30 char names */
+	MINIX2_SUPER_MAGIC = 0x2468,		/* minix V2 fs */
+	MINIX2_SUPER_MAGIC2 = 0x2478,		/* minix V2 fs, 30 char names */
+	MINIX_VALID_FS = 0x0001,		/* Clean fs. */
+	MINIX_ERROR_FS = 0x0002,		/* fs has errors. */
+
+	MINIX_INODES_PER_BLOCK = ((BLOCK_SIZE)/(sizeof (struct minix_inode))),
+	MINIX2_INODES_PER_BLOCK = ((BLOCK_SIZE)/(sizeof (struct minix2_inode))),
+
+	MINIX_V1 = 0x0001,		/* original minix fs */
+	MINIX_V2 = 0x0002 		/* minix V2 fs */
+};
+
+#define INODE_VERSION(inode)	inode->i_sb->u.minix_sb.s_version
+
 /*
  * minix super-block data on disk
  */
@@ -172,8 +177,6 @@
 	char name[0];
 };
 
-#define BLOCK_SIZE_BITS 10
-#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
 
 #define NAME_MAX         255   /* # chars in a file name */
 
@@ -187,7 +190,7 @@
 #define volatile
 #endif
 
-static const int ROOT_INO = 1;
+enum { ROOT_INO = 1 };
 
 #define UPPER(size,n) ((size+((n)-1))/(n))
 #define INODE_SIZE (sizeof(struct minix_inode))
@@ -219,7 +222,7 @@
 static int termios_set = 0;
 
 /* File-name data */
-static const int MAX_DEPTH = 32;
+enum { MAX_DEPTH = 32 };
 static int name_depth = 0;
 // static char name_list[MAX_DEPTH][BUFSIZ + 1];
 static char **name_list = NULL;

Modified: trunk/busybox/util-linux/getopt.c
===================================================================
--- trunk/busybox/util-linux/getopt.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/util-linux/getopt.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -53,9 +53,11 @@
 
 /* NON_OPT is the code that is returned when a non-option is found in '+'
    mode */
-static const int NON_OPT = 1;
+enum {
+	NON_OPT = 1,
 /* LONG_OPT is the code that is returned when a long option is found. */
-static const int LONG_OPT = 2;
+	LONG_OPT = 2
+};
 
 /* The shells recognized. */
 typedef enum {BASH,TCSH} shell_t;
@@ -195,7 +197,7 @@
 static struct option *long_options;
 static int long_options_length; /* Length of array */
 static int long_options_nr; /* Nr of used elements in array */
-static const int LONG_OPTIONS_INCR = 10;
+enum { LONG_OPTIONS_INCR = 10 };
 #define init_longopt() add_longopt(NULL,0)
 
 /* Register a long option. The contents of name is copied. */

Modified: trunk/busybox/util-linux/mkswap.c
===================================================================
--- trunk/busybox/util-linux/mkswap.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/util-linux/mkswap.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -48,7 +48,7 @@
 
 #ifndef _IO
 /* pre-1.3.45 */
-static const int BLKGETSIZE = 0x1260;
+enum { BLKGETSIZE = 0x1260 };
 #else
 /* same on i386, m68k, arm; different on alpha, mips, sparc, ppc */
 #define BLKGETSIZE _IO(0x12,96)

Modified: trunk/busybox/util-linux/nfsmount.c
===================================================================
--- trunk/busybox/util-linux/nfsmount.c	2006-03-10 16:20:23 UTC (rev 14512)
+++ trunk/busybox/util-linux/nfsmount.c	2006-03-10 19:22:06 UTC (rev 14513)
@@ -105,13 +105,14 @@
 #define NFS_PROGRAM	100003
 
 
-
+enum {
 #ifndef NFS_FHSIZE
-static const int NFS_FHSIZE = 32;
+	NFS_FHSIZE = 32,
 #endif
 #ifndef NFS_PORT
-static const int NFS_PORT = 2049;
+	NFS_PORT = 2049
 #endif
+};
 
 /* Disable the nls stuff */
 # undef bindtextdomain
@@ -119,19 +120,21 @@
 # undef textdomain
 # define textdomain(Domain) /* empty */
 
-static const int MS_MGC_VAL = 0xc0ed0000; /* Magic number indicatng "new" flags */
-static const int MS_RDONLY = 1;      /* Mount read-only */
-static const int MS_NOSUID = 2;      /* Ignore suid and sgid bits */
-static const int MS_NODEV = 4;      /* Disallow access to device special files */
-static const int MS_NOEXEC = 8;      /* Disallow program execution */
-static const int MS_SYNCHRONOUS = 16;      /* Writes are synced at once */
-static const int MS_REMOUNT = 32;      /* Alter flags of a mounted FS */
-static const int MS_MANDLOCK = 64;      /* Allow mandatory locks on an FS */
-static const int S_QUOTA = 128;     /* Quota initialized for file/directory/symlink */
-static const int S_APPEND = 256;     /* Append-only file */
-static const int S_IMMUTABLE = 512;     /* Immutable file */
-static const int MS_NOATIME = 1024;    /* Do not update access times. */
-static const int MS_NODIRATIME = 2048;    /* Do not update directory access times */
+enum {
+	MS_MGC_VAL = 0xc0ed0000, /* Magic number indicatng "new" flags */
+	MS_RDONLY = 1,      /* Mount read-only */
+	MS_NOSUID = 2,      /* Ignore suid and sgid bits */
+	MS_NODEV = 4,      /* Disallow access to device special files */
+	MS_NOEXEC = 8,      /* Disallow program execution */
+	MS_SYNCHRONOUS = 16,      /* Writes are synced at once */
+	MS_REMOUNT = 32,      /* Alter flags of a mounted FS */
+	MS_MANDLOCK = 64,      /* Allow mandatory locks on an FS */
+	S_QUOTA = 128,     /* Quota initialized for file/directory/symlink */
+	S_APPEND = 256,     /* Append-only file */
+	S_IMMUTABLE = 512,     /* Immutable file */
+	MS_NOATIME = 1024,    /* Do not update access times. */
+	MS_NODIRATIME = 2048    /* Do not update directory access times */
+};
 
 
 /*
@@ -177,19 +180,20 @@
 };
 
 /* bits in the flags field */
+enum {
+	NFS_MOUNT_SOFT = 0x0001,	/* 1 */
+	NFS_MOUNT_INTR = 0x0002,	/* 1 */
+	NFS_MOUNT_SECURE = 0x0004,	/* 1 */
+	NFS_MOUNT_POSIX = 0x0008,	/* 1 */
+	NFS_MOUNT_NOCTO = 0x0010,	/* 1 */
+	NFS_MOUNT_NOAC = 0x0020,	/* 1 */
+	NFS_MOUNT_TCP = 0x0040,		/* 2 */
+	NFS_MOUNT_VER3 = 0x0080,	/* 3 */
+	NFS_MOUNT_KERBEROS = 0x0100,	/* 3 */
+	NFS_MOUNT_NONLM = 0x0200	/* 3 */
+};
 
-static const int NFS_MOUNT_SOFT = 0x0001;	/* 1 */
-static const int NFS_MOUNT_INTR = 0x0002;	/* 1 */
-static const int NFS_MOUNT_SECURE = 0x0004;	/* 1 */
-static const int NFS_MOUNT_POSIX = 0x0008;	/* 1 */
-static const int NFS_MOUNT_NOCTO = 0x0010;	/* 1 */
-static const int NFS_MOUNT_NOAC = 0x0020;	/* 1 */
-static const int NFS_MOUNT_TCP = 0x0040;	/* 2 */
-static const int NFS_MOUNT_VER3 = 0x0080;	/* 3 */
-static const int NFS_MOUNT_KERBEROS = 0x0100;	/* 3 */
-static const int NFS_MOUNT_NONLM = 0x0200;	/* 3 */
 
-
 #define UTIL_LINUX_VERSION "2.10m"
 #define util_linux_version "util-linux-2.10m"
 
@@ -213,8 +217,10 @@
 #define MAKE_VERSION(p,q,r)	(65536*(p) + 256*(q) + (r))
 #define MAX_NFSPROT ((nfs_mount_version >= 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) */
+};
 
 
 /*




More information about the busybox-cvs mailing list