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). --- editors/awk.c | 2 +- editors/vi.c | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'editors') diff --git a/editors/awk.c b/editors/awk.c index 65856aa55..cce3b562a 100644 --- a/editors/awk.c +++ b/editors/awk.c @@ -392,7 +392,7 @@ static char * vValues = /* 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 */ diff --git a/editors/vi.c b/editors/vi.c index 4dcef68f9..3bf9ac3f9 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -138,18 +138,20 @@ static const char CMup[] = "\033[A"; 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 - -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" +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 + + 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; -- cgit v1.2.3