diff options
author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-02-05 17:50:03 +0000 |
---|---|---|
committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-02-05 17:50:03 +0000 |
commit | 43ee50fbeaed8c5c07474c1665a47791b42663f4 (patch) | |
tree | bf64d8b5c0592b0276d5c1c5471df27e7c88607b | |
parent | 6c46934844ef3bfc149c82afa64884389ca783b6 (diff) | |
download | busybox-w32-43ee50fbeaed8c5c07474c1665a47791b42663f4.tar.gz busybox-w32-43ee50fbeaed8c5c07474c1665a47791b42663f4.tar.bz2 busybox-w32-43ee50fbeaed8c5c07474c1665a47791b42663f4.zip |
Make suffix_mult structures const. Thanks to Vladimir N. Oleynik.
git-svn-id: svn://busybox.net/trunk/busybox@1751 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | busybox.h | 3 | ||||
-rw-r--r-- | coreutils/dd.c | 2 | ||||
-rw-r--r-- | coreutils/tail.c | 4 | ||||
-rw-r--r-- | dd.c | 2 | ||||
-rw-r--r-- | include/busybox.h | 3 | ||||
-rw-r--r-- | tail.c | 4 | ||||
-rw-r--r-- | utility.c | 5 |
7 files changed, 13 insertions, 10 deletions
@@ -167,7 +167,8 @@ struct suffix_mult { | |||
167 | int mult; | 167 | int mult; |
168 | }; | 168 | }; |
169 | 169 | ||
170 | extern unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes); | 170 | extern unsigned long parse_number(const char *numstr, |
171 | const struct suffix_mult *suffixes); | ||
171 | 172 | ||
172 | 173 | ||
173 | /* These parse entries in /etc/passwd and /etc/group. This is desirable | 174 | /* These parse entries in /etc/passwd and /etc/group. This is desirable |
diff --git a/coreutils/dd.c b/coreutils/dd.c index 582310681..75bbfbac2 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <string.h> | 30 | #include <string.h> |
31 | #include <fcntl.h> | 31 | #include <fcntl.h> |
32 | 32 | ||
33 | static struct suffix_mult dd_suffixes[] = { | 33 | static const struct suffix_mult dd_suffixes[] = { |
34 | { "c", 1 }, | 34 | { "c", 1 }, |
35 | { "w", 2 }, | 35 | { "w", 2 }, |
36 | { "b", 512 }, | 36 | { "b", 512 }, |
diff --git a/coreutils/tail.c b/coreutils/tail.c index 40511aa7b..d45b29c4c 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <unistd.h> | 30 | #include <unistd.h> |
31 | #include <sys/types.h> | 31 | #include <sys/types.h> |
32 | 32 | ||
33 | static struct suffix_mult tail_suffixes[] = { | 33 | static const struct suffix_mult tail_suffixes[] = { |
34 | { "b", 512 }, | 34 | { "b", 512 }, |
35 | { "k", 1024 }, | 35 | { "k", 1024 }, |
36 | { "m", 1048576 }, | 36 | { "m", 1048576 }, |
@@ -38,7 +38,7 @@ static struct suffix_mult tail_suffixes[] = { | |||
38 | }; | 38 | }; |
39 | 39 | ||
40 | #ifndef BB_FEATURE_SIMPLE_TAIL | 40 | #ifndef BB_FEATURE_SIMPLE_TAIL |
41 | static struct suffix_mult null_suffixes[] = { | 41 | static const struct suffix_mult null_suffixes[] = { |
42 | { NULL, 0 } | 42 | { NULL, 0 } |
43 | }; | 43 | }; |
44 | #endif | 44 | #endif |
@@ -30,7 +30,7 @@ | |||
30 | #include <string.h> | 30 | #include <string.h> |
31 | #include <fcntl.h> | 31 | #include <fcntl.h> |
32 | 32 | ||
33 | static struct suffix_mult dd_suffixes[] = { | 33 | static const struct suffix_mult dd_suffixes[] = { |
34 | { "c", 1 }, | 34 | { "c", 1 }, |
35 | { "w", 2 }, | 35 | { "w", 2 }, |
36 | { "b", 512 }, | 36 | { "b", 512 }, |
diff --git a/include/busybox.h b/include/busybox.h index fc5e8d874..2fc0cc7e0 100644 --- a/include/busybox.h +++ b/include/busybox.h | |||
@@ -167,7 +167,8 @@ struct suffix_mult { | |||
167 | int mult; | 167 | int mult; |
168 | }; | 168 | }; |
169 | 169 | ||
170 | extern unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes); | 170 | extern unsigned long parse_number(const char *numstr, |
171 | const struct suffix_mult *suffixes); | ||
171 | 172 | ||
172 | 173 | ||
173 | /* These parse entries in /etc/passwd and /etc/group. This is desirable | 174 | /* These parse entries in /etc/passwd and /etc/group. This is desirable |
@@ -30,7 +30,7 @@ | |||
30 | #include <unistd.h> | 30 | #include <unistd.h> |
31 | #include <sys/types.h> | 31 | #include <sys/types.h> |
32 | 32 | ||
33 | static struct suffix_mult tail_suffixes[] = { | 33 | static const struct suffix_mult tail_suffixes[] = { |
34 | { "b", 512 }, | 34 | { "b", 512 }, |
35 | { "k", 1024 }, | 35 | { "k", 1024 }, |
36 | { "m", 1048576 }, | 36 | { "m", 1048576 }, |
@@ -38,7 +38,7 @@ static struct suffix_mult tail_suffixes[] = { | |||
38 | }; | 38 | }; |
39 | 39 | ||
40 | #ifndef BB_FEATURE_SIMPLE_TAIL | 40 | #ifndef BB_FEATURE_SIMPLE_TAIL |
41 | static struct suffix_mult null_suffixes[] = { | 41 | static const struct suffix_mult null_suffixes[] = { |
42 | { NULL, 0 } | 42 | { NULL, 0 } |
43 | }; | 43 | }; |
44 | #endif | 44 | #endif |
@@ -1696,9 +1696,10 @@ struct BB_applet *find_applet_by_name(const char *name) | |||
1696 | } | 1696 | } |
1697 | 1697 | ||
1698 | #if defined BB_DD || defined BB_TAIL | 1698 | #if defined BB_DD || defined BB_TAIL |
1699 | unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes) | 1699 | unsigned long parse_number(const char *numstr, |
1700 | const struct suffix_mult *suffixes) | ||
1700 | { | 1701 | { |
1701 | struct suffix_mult *sm; | 1702 | const struct suffix_mult *sm; |
1702 | unsigned long int ret; | 1703 | unsigned long int ret; |
1703 | int len; | 1704 | int len; |
1704 | char *end; | 1705 | char *end; |