aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-02-05 17:50:03 +0000
committerkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-02-05 17:50:03 +0000
commit43ee50fbeaed8c5c07474c1665a47791b42663f4 (patch)
treebf64d8b5c0592b0276d5c1c5471df27e7c88607b
parent6c46934844ef3bfc149c82afa64884389ca783b6 (diff)
downloadbusybox-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.h3
-rw-r--r--coreutils/dd.c2
-rw-r--r--coreutils/tail.c4
-rw-r--r--dd.c2
-rw-r--r--include/busybox.h3
-rw-r--r--tail.c4
-rw-r--r--utility.c5
7 files changed, 13 insertions, 10 deletions
diff --git a/busybox.h b/busybox.h
index fc5e8d874..2fc0cc7e0 100644
--- a/busybox.h
+++ b/busybox.h
@@ -167,7 +167,8 @@ struct suffix_mult {
167 int mult; 167 int mult;
168}; 168};
169 169
170extern unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes); 170extern 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
33static struct suffix_mult dd_suffixes[] = { 33static 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
33static struct suffix_mult tail_suffixes[] = { 33static 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
41static struct suffix_mult null_suffixes[] = { 41static const struct suffix_mult null_suffixes[] = {
42 { NULL, 0 } 42 { NULL, 0 }
43}; 43};
44#endif 44#endif
diff --git a/dd.c b/dd.c
index 582310681..75bbfbac2 100644
--- a/dd.c
+++ b/dd.c
@@ -30,7 +30,7 @@
30#include <string.h> 30#include <string.h>
31#include <fcntl.h> 31#include <fcntl.h>
32 32
33static struct suffix_mult dd_suffixes[] = { 33static 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
170extern unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes); 170extern 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/tail.c b/tail.c
index 40511aa7b..d45b29c4c 100644
--- a/tail.c
+++ b/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
33static struct suffix_mult tail_suffixes[] = { 33static 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
41static struct suffix_mult null_suffixes[] = { 41static const struct suffix_mult null_suffixes[] = {
42 { NULL, 0 } 42 { NULL, 0 }
43}; 43};
44#endif 44#endif
diff --git a/utility.c b/utility.c
index f99c613a1..aa1fa943b 100644
--- a/utility.c
+++ b/utility.c
@@ -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
1699unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes) 1699unsigned 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;