diff options
author | Rob Landley <rob@landley.net> | 2006-03-10 19:22:06 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-03-10 19:22:06 +0000 |
commit | bc68cd14ccaebc17e7e03a08e51fddfb91007624 (patch) | |
tree | beb32cedafc6232bf8a49fe90f0769d471ea6791 /util-linux/getopt.c | |
parent | dae6aa28598cb2353291f18ca52e768c3259165a (diff) | |
download | busybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.tar.gz busybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.tar.bz2 busybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.zip |
Patch from Denis Vlasenko turning static const int (which gets emitted into
the busybox binary) into enums (which don't).
Diffstat (limited to 'util-linux/getopt.c')
-rw-r--r-- | util-linux/getopt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/util-linux/getopt.c b/util-linux/getopt.c index 16dcbbca0..9e33b79bf 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c | |||
@@ -53,9 +53,11 @@ | |||
53 | 53 | ||
54 | /* NON_OPT is the code that is returned when a non-option is found in '+' | 54 | /* NON_OPT is the code that is returned when a non-option is found in '+' |
55 | mode */ | 55 | mode */ |
56 | static const int NON_OPT = 1; | 56 | enum { |
57 | NON_OPT = 1, | ||
57 | /* LONG_OPT is the code that is returned when a long option is found. */ | 58 | /* LONG_OPT is the code that is returned when a long option is found. */ |
58 | static const int LONG_OPT = 2; | 59 | LONG_OPT = 2 |
60 | }; | ||
59 | 61 | ||
60 | /* The shells recognized. */ | 62 | /* The shells recognized. */ |
61 | typedef enum {BASH,TCSH} shell_t; | 63 | typedef enum {BASH,TCSH} shell_t; |
@@ -195,7 +197,7 @@ int generate_output(char * argv[],int argc,const char *optstr, | |||
195 | static struct option *long_options; | 197 | static struct option *long_options; |
196 | static int long_options_length; /* Length of array */ | 198 | static int long_options_length; /* Length of array */ |
197 | static int long_options_nr; /* Nr of used elements in array */ | 199 | static int long_options_nr; /* Nr of used elements in array */ |
198 | static const int LONG_OPTIONS_INCR = 10; | 200 | enum { LONG_OPTIONS_INCR = 10 }; |
199 | #define init_longopt() add_longopt(NULL,0) | 201 | #define init_longopt() add_longopt(NULL,0) |
200 | 202 | ||
201 | /* Register a long option. The contents of name is copied. */ | 203 | /* Register a long option. The contents of name is copied. */ |