Make suffix_mult structures const. Thanks to Vladimir N. Oleynik.
This commit is contained in:
parent
925edb828d
commit
a164c647ac
@ -167,7 +167,8 @@ struct suffix_mult {
|
|||||||
int mult;
|
int mult;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes);
|
extern unsigned long parse_number(const char *numstr,
|
||||||
|
const struct suffix_mult *suffixes);
|
||||||
|
|
||||||
|
|
||||||
/* These parse entries in /etc/passwd and /etc/group. This is desirable
|
/* These parse entries in /etc/passwd and /etc/group. This is desirable
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
static struct suffix_mult dd_suffixes[] = {
|
static const struct suffix_mult dd_suffixes[] = {
|
||||||
{ "c", 1 },
|
{ "c", 1 },
|
||||||
{ "w", 2 },
|
{ "w", 2 },
|
||||||
{ "b", 512 },
|
{ "b", 512 },
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
static struct suffix_mult tail_suffixes[] = {
|
static const struct suffix_mult tail_suffixes[] = {
|
||||||
{ "b", 512 },
|
{ "b", 512 },
|
||||||
{ "k", 1024 },
|
{ "k", 1024 },
|
||||||
{ "m", 1048576 },
|
{ "m", 1048576 },
|
||||||
@ -38,7 +38,7 @@ static struct suffix_mult tail_suffixes[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#ifndef BB_FEATURE_SIMPLE_TAIL
|
#ifndef BB_FEATURE_SIMPLE_TAIL
|
||||||
static struct suffix_mult null_suffixes[] = {
|
static const struct suffix_mult null_suffixes[] = {
|
||||||
{ NULL, 0 }
|
{ NULL, 0 }
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
2
dd.c
2
dd.c
@ -30,7 +30,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
static struct suffix_mult dd_suffixes[] = {
|
static const struct suffix_mult dd_suffixes[] = {
|
||||||
{ "c", 1 },
|
{ "c", 1 },
|
||||||
{ "w", 2 },
|
{ "w", 2 },
|
||||||
{ "b", 512 },
|
{ "b", 512 },
|
||||||
|
@ -167,7 +167,8 @@ struct suffix_mult {
|
|||||||
int mult;
|
int mult;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes);
|
extern unsigned long parse_number(const char *numstr,
|
||||||
|
const struct suffix_mult *suffixes);
|
||||||
|
|
||||||
|
|
||||||
/* These parse entries in /etc/passwd and /etc/group. This is desirable
|
/* These parse entries in /etc/passwd and /etc/group. This is desirable
|
||||||
|
4
tail.c
4
tail.c
@ -30,7 +30,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
static struct suffix_mult tail_suffixes[] = {
|
static const struct suffix_mult tail_suffixes[] = {
|
||||||
{ "b", 512 },
|
{ "b", 512 },
|
||||||
{ "k", 1024 },
|
{ "k", 1024 },
|
||||||
{ "m", 1048576 },
|
{ "m", 1048576 },
|
||||||
@ -38,7 +38,7 @@ static struct suffix_mult tail_suffixes[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#ifndef BB_FEATURE_SIMPLE_TAIL
|
#ifndef BB_FEATURE_SIMPLE_TAIL
|
||||||
static struct suffix_mult null_suffixes[] = {
|
static const struct suffix_mult null_suffixes[] = {
|
||||||
{ NULL, 0 }
|
{ NULL, 0 }
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -1696,9 +1696,10 @@ struct BB_applet *find_applet_by_name(const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined BB_DD || defined BB_TAIL
|
#if defined BB_DD || defined BB_TAIL
|
||||||
unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes)
|
unsigned long parse_number(const char *numstr,
|
||||||
|
const struct suffix_mult *suffixes)
|
||||||
{
|
{
|
||||||
struct suffix_mult *sm;
|
const struct suffix_mult *sm;
|
||||||
unsigned long int ret;
|
unsigned long int ret;
|
||||||
int len;
|
int len;
|
||||||
char *end;
|
char *end;
|
||||||
|
Loading…
Reference in New Issue
Block a user