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 /modutils | |
| 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 'modutils')
| -rw-r--r-- | modutils/insmod.c | 39 | ||||
| -rw-r--r-- | modutils/lsmod.c | 24 |
2 files changed, 35 insertions, 28 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c index 8b112787f..26dd9783b 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
| @@ -343,7 +343,7 @@ extern int insmod_ng_main( int argc, char **argv); | |||
| 343 | 343 | ||
| 344 | 344 | ||
| 345 | #ifndef MODUTILS_MODULE_H | 345 | #ifndef MODUTILS_MODULE_H |
| 346 | static const int MODUTILS_MODULE_H = 1; | 346 | /* Why? static const int MODUTILS_MODULE_H = 1;*/ |
| 347 | 347 | ||
| 348 | #ident "$Id: insmod.c,v 1.126 2004/12/26 09:13:32 vapier Exp $" | 348 | #ident "$Id: insmod.c,v 1.126 2004/12/26 09:13:32 vapier Exp $" |
| 349 | 349 | ||
| @@ -364,9 +364,11 @@ static const int MODUTILS_MODULE_H = 1; | |||
| 364 | #undef tgt_sizeof_char_p | 364 | #undef tgt_sizeof_char_p |
| 365 | #undef tgt_sizeof_void_p | 365 | #undef tgt_sizeof_void_p |
| 366 | #undef tgt_long | 366 | #undef tgt_long |
| 367 | static const int tgt_sizeof_long = 8; | 367 | enum { |
| 368 | static const int tgt_sizeof_char_p = 8; | 368 | tgt_sizeof_long = 8, |
| 369 | static const int tgt_sizeof_void_p = 8; | 369 | tgt_sizeof_char_p = 8, |
| 370 | tgt_sizeof_void_p = 8 | ||
| 371 | }; | ||
| 370 | #define tgt_long long long | 372 | #define tgt_long long long |
| 371 | #endif | 373 | #endif |
| 372 | 374 | ||
| @@ -441,23 +443,26 @@ struct new_module_info | |||
| 441 | }; | 443 | }; |
| 442 | 444 | ||
| 443 | /* Bits of module.flags. */ | 445 | /* Bits of module.flags. */ |
| 444 | static const int NEW_MOD_RUNNING = 1; | 446 | enum { |
| 445 | static const int NEW_MOD_DELETED = 2; | 447 | NEW_MOD_RUNNING = 1, |
| 446 | static const int NEW_MOD_AUTOCLEAN = 4; | 448 | NEW_MOD_DELETED = 2, |
| 447 | static const int NEW_MOD_VISITED = 8; | 449 | NEW_MOD_AUTOCLEAN = 4, |
| 448 | static const int NEW_MOD_USED_ONCE = 16; | 450 | NEW_MOD_VISITED = 8, |
| 451 | NEW_MOD_USED_ONCE = 16 | ||
| 452 | }; | ||
| 449 | 453 | ||
| 450 | int init_module(const char *name, const struct new_module *); | 454 | int init_module(const char *name, const struct new_module *); |
| 451 | int query_module(const char *name, int which, void *buf, | 455 | int query_module(const char *name, int which, void *buf, |
| 452 | size_t bufsize, size_t *ret); | 456 | size_t bufsize, size_t *ret); |
| 453 | 457 | ||
| 454 | /* Values for query_module's which. */ | 458 | /* Values for query_module's which. */ |
| 455 | 459 | enum { | |
| 456 | static const int QM_MODULES = 1; | 460 | QM_MODULES = 1, |
| 457 | static const int QM_DEPS = 2; | 461 | QM_DEPS = 2, |
| 458 | static const int QM_REFS = 3; | 462 | QM_REFS = 3, |
| 459 | static const int QM_SYMBOLS = 4; | 463 | QM_SYMBOLS = 4, |
| 460 | static const int QM_INFO = 5; | 464 | QM_INFO = 5 |
| 465 | }; | ||
| 461 | 466 | ||
| 462 | /*======================================================================*/ | 467 | /*======================================================================*/ |
| 463 | /* The system calls unchanged between 2.0 and 2.1. */ | 468 | /* The system calls unchanged between 2.0 and 2.1. */ |
| @@ -501,7 +506,7 @@ int delete_module(const char *); | |||
| 501 | 506 | ||
| 502 | 507 | ||
| 503 | #ifndef MODUTILS_OBJ_H | 508 | #ifndef MODUTILS_OBJ_H |
| 504 | static const int MODUTILS_OBJ_H = 1; | 509 | /* Why? static const int MODUTILS_OBJ_H = 1; */ |
| 505 | 510 | ||
| 506 | #ident "$Id: insmod.c,v 1.126 2004/12/26 09:13:32 vapier Exp $" | 511 | #ident "$Id: insmod.c,v 1.126 2004/12/26 09:13:32 vapier Exp $" |
| 507 | 512 | ||
| @@ -700,7 +705,7 @@ static int obj_gpl_license(struct obj_file *f, const char **license); | |||
| 700 | 705 | ||
| 701 | 706 | ||
| 702 | #define _PATH_MODULES "/lib/modules" | 707 | #define _PATH_MODULES "/lib/modules" |
| 703 | static const int STRVERSIONLEN = 32; | 708 | enum { STRVERSIONLEN = 32 }; |
| 704 | 709 | ||
| 705 | /*======================================================================*/ | 710 | /*======================================================================*/ |
| 706 | 711 | ||
diff --git a/modutils/lsmod.c b/modutils/lsmod.c index 82136dd0f..3bbf89e58 100644 --- a/modutils/lsmod.c +++ b/modutils/lsmod.c | |||
| @@ -82,20 +82,22 @@ struct module_info | |||
| 82 | 82 | ||
| 83 | int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret); | 83 | int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret); |
| 84 | 84 | ||
| 85 | enum { | ||
| 85 | /* Values for query_module's which. */ | 86 | /* Values for query_module's which. */ |
| 86 | static const int QM_MODULES = 1; | 87 | QM_MODULES = 1, |
| 87 | static const int QM_DEPS = 2; | 88 | QM_DEPS = 2, |
| 88 | static const int QM_REFS = 3; | 89 | QM_REFS = 3, |
| 89 | static const int QM_SYMBOLS = 4; | 90 | QM_SYMBOLS = 4, |
| 90 | static const int QM_INFO = 5; | 91 | QM_INFO = 5, |
| 91 | 92 | ||
| 92 | /* Bits of module.flags. */ | 93 | /* Bits of module.flags. */ |
| 93 | static const int NEW_MOD_RUNNING = 1; | 94 | NEW_MOD_RUNNING = 1, |
| 94 | static const int NEW_MOD_DELETED = 2; | 95 | NEW_MOD_DELETED = 2, |
| 95 | static const int NEW_MOD_AUTOCLEAN = 4; | 96 | NEW_MOD_AUTOCLEAN = 4, |
| 96 | static const int NEW_MOD_VISITED = 8; | 97 | NEW_MOD_VISITED = 8, |
| 97 | static const int NEW_MOD_USED_ONCE = 16; | 98 | NEW_MOD_USED_ONCE = 16, |
| 98 | static const int NEW_MOD_INITIALIZING = 64; | 99 | NEW_MOD_INITIALIZING = 64 |
| 100 | }; | ||
| 99 | 101 | ||
| 100 | int lsmod_main(int argc, char **argv) | 102 | int lsmod_main(int argc, char **argv) |
| 101 | { | 103 | { |
