trylink: produce even more info about final link stage

trylink: explain how to modify link and drastically decrease amount
  of padding (unfortunately, needs hand editing ATM).
*: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts

size saving: 0.5k
This commit is contained in:
Denis Vlasenko 2007-08-12 20:58:27 +00:00
parent 4185548984
commit 6ca409e0e4
119 changed files with 491 additions and 444 deletions

View file

@ -569,7 +569,7 @@ busybox-all := $(core-y) $(libs-y)
# May be overridden by arch/$(ARCH)/Makefile # May be overridden by arch/$(ARCH)/Makefile
quiet_cmd_busybox__ ?= LINK $@ quiet_cmd_busybox__ ?= LINK $@
cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(LDFLAGS) \ cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(LDFLAGS) \
-o $@ -Wl,-M \ -o $@ -Wl,-Map -Wl,$@.map \
-Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \
-Wl,--start-group $(busybox-all) -Wl,--end-group \ -Wl,--start-group $(busybox-all) -Wl,--end-group \
$(LDLIBS) $(LDLIBS)

View file

@ -20,6 +20,6 @@ quiet_cmd_gen_usage_compressed = GEN include/usage_compressed.h
HOSTCFLAGS_usage.o = -I$(srctree)/include HOSTCFLAGS_usage.o = -I$(srctree)/include
applets/applets.o: include/usage_compressed.h applets/applets.o: include/usage_compressed.h
applets/usage: .config applets/usage: .config $(srctree)/applets/usage_compressed
include/usage_compressed.h: applets/usage include/usage_compressed.h: applets/usage $(srctree)/applets/usage_compressed
$(call cmd,gen_usage_compressed) $(call cmd,gen_usage_compressed)

View file

@ -34,7 +34,7 @@
#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE #if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE
/* Define usage_messages[] */ /* Define usage_messages[] */
static const char usage_messages[] = "" static const char usage_messages[] ALIGN1 = ""
#define MAKE_USAGE #define MAKE_USAGE
#include "usage.h" #include "usage.h"
#include "applets.h" #include "applets.h"
@ -108,12 +108,12 @@ static char *get_trimmed_slice(char *s, char *e)
} }
/* Don't depend on the tools to combine strings. */ /* Don't depend on the tools to combine strings. */
static const char config_file[] = "/etc/busybox.conf"; static const char config_file[] ALIGN1 = "/etc/busybox.conf";
/* We don't supply a value for the nul, so an index adjustment is /* We don't supply a value for the nul, so an index adjustment is
* necessary below. Also, we use unsigned short here to save some * necessary below. Also, we use unsigned short here to save some
* space even though these are really mode_t values. */ * space even though these are really mode_t values. */
static const unsigned short mode_mask[] = { static const unsigned short mode_mask[] ALIGN2 = {
/* SST sst xxx --- */ /* SST sst xxx --- */
S_ISUID, S_ISUID|S_IXUSR, S_IXUSR, 0, /* user */ S_ISUID, S_ISUID|S_IXUSR, S_IXUSR, 0, /* user */
S_ISGID, S_ISGID|S_IXGRP, S_IXGRP, 0, /* group */ S_ISGID, S_ISGID|S_IXGRP, S_IXGRP, 0, /* group */
@ -255,7 +255,7 @@ static void parse_config_file(void)
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
/* There are 4 chars + 1 nul for each of user/group/other. */ /* There are 4 chars + 1 nul for each of user/group/other. */
static const char mode_chars[] = "Ssx-\0" "Ssx-\0" "Ttx-"; static const char mode_chars[] ALIGN1 = "Ssx-\0" "Ssx-\0" "Ttx-";
const char *q; const char *q;
q = strchrnul(mode_chars + 5*i, *e++); q = strchrnul(mode_chars + 5*i, *e++);
@ -499,8 +499,8 @@ static void install_links(const char *busybox, int use_symbolic_links)
/* directory table /* directory table
* this should be consistent w/ the enum, * this should be consistent w/ the enum,
* busybox.h::bb_install_loc_t, or else... */ * busybox.h::bb_install_loc_t, or else... */
static const char usr_bin [] = "/usr/bin"; static const char usr_bin [] ALIGN1 = "/usr/bin";
static const char usr_sbin[] = "/usr/sbin"; static const char usr_sbin[] ALIGN1 = "/usr/sbin";
static const char *const install_dir[] = { static const char *const install_dir[] = {
&usr_bin [8], /* "", equivalent to "/" for concat_path_file() */ &usr_bin [8], /* "", equivalent to "/" for concat_path_file() */
&usr_bin [4], /* "/bin" */ &usr_bin [4], /* "/bin" */

View file

@ -12,7 +12,7 @@ sz=`"$loc/usage" | wc -c` || exit 1
exec >"$target" exec >"$target"
echo 'static const char packed_usage[] = ' echo 'static const char packed_usage[] ALIGN1 = '
"$loc/usage" | bzip2 -1 | od -v -t x1 \ "$loc/usage" | bzip2 -1 | od -v -t x1 \
| $SED -e 's/^[^ ]*//' -e 's/ *\(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/' | $SED -e 's/^[^ ]*//' -e 's/ *\(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/'
echo ';' echo ';'

View file

@ -41,10 +41,11 @@ static void header_verbose_list_ar(const file_header_t *file_header)
int ar_main(int argc, char **argv); int ar_main(int argc, char **argv);
int ar_main(int argc, char **argv) int ar_main(int argc, char **argv)
{ {
static const char msg_unsupported_err[] ALIGN1 =
"archive %s is not supported";
archive_handle_t *archive_handle; archive_handle_t *archive_handle;
unsigned opt; unsigned opt;
static const char msg_unsupported_err[] =
"Archive %s not supported. Install binutils 'ar'.";
char magic[8]; char magic[8];
archive_handle = init_handle(); archive_handle = init_handle();
@ -88,7 +89,8 @@ int ar_main(int argc, char **argv)
} }
archive_handle->offset += 7; archive_handle->offset += 7;
while (get_header_ar(archive_handle) == EXIT_SUCCESS) /* repeat */; while (get_header_ar(archive_handle) == EXIT_SUCCESS)
continue;
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View file

@ -582,7 +582,8 @@ static int read_package_field(const char *package_buffer, char **field_name, cha
static unsigned fill_package_struct(char *control_buffer) static unsigned fill_package_struct(char *control_buffer)
{ {
static const char field_names[] = "Package\0""Version\0" static const char field_names[] ALIGN1 =
"Package\0""Version\0"
"Pre-Depends\0""Depends\0""Replaces\0""Provides\0" "Pre-Depends\0""Depends\0""Replaces\0""Provides\0"
"Conflicts\0""Suggests\0""Recommends\0""Enhances\0"; "Conflicts\0""Suggests\0""Recommends\0""Enhances\0";
@ -1226,7 +1227,7 @@ static int run_package_script(const char *package_name, const char *script_type)
return result; return result;
} }
static const char *all_control_files[] = { static const char *const all_control_files[] = {
"preinst", "postinst", "prerm", "postrm", "preinst", "postinst", "prerm", "postrm",
"list", "md5sums", "shlibs", "conffiles", "list", "md5sums", "shlibs", "conffiles",
"config", "templates", NULL "config", "templates", NULL

View file

@ -768,26 +768,24 @@ static void check_match(IPos start, IPos match, int length)
#define BL_CODES 19 #define BL_CODES 19
/* number of codes used to transfer the bit lengths */ /* number of codes used to transfer the bit lengths */
typedef uch extra_bits_t;
/* extra bits for each length code */ /* extra bits for each length code */
static const extra_bits_t extra_lbits[LENGTH_CODES]= { static const uint8_t extra_lbits[LENGTH_CODES] ALIGN1 = {
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4,
4, 4, 5, 5, 5, 5, 0 4, 4, 5, 5, 5, 5, 0
}; };
/* extra bits for each distance code */ /* extra bits for each distance code */
static const extra_bits_t extra_dbits[D_CODES] = { static const uint8_t extra_dbits[D_CODES] ALIGN1 = {
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
10, 10, 11, 11, 12, 12, 13, 13 10, 10, 11, 11, 12, 12, 13, 13
}; };
/* extra bits for each bit length code */ /* extra bits for each bit length code */
static const extra_bits_t extra_blbits[BL_CODES] = { static const uint8_t extra_blbits[BL_CODES] ALIGN1 = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7 }; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7 };
/* number of codes at each bit length for an optimal tree */ /* number of codes at each bit length for an optimal tree */
static const uch bl_order[BL_CODES] = { static const uint8_t bl_order[BL_CODES] ALIGN1 = {
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
#define STORED_BLOCK 0 #define STORED_BLOCK 0
@ -861,7 +859,7 @@ typedef struct ct_data {
typedef struct tree_desc { typedef struct tree_desc {
ct_data *dyn_tree; /* the dynamic tree */ ct_data *dyn_tree; /* the dynamic tree */
ct_data *static_tree; /* corresponding static tree or NULL */ ct_data *static_tree; /* corresponding static tree or NULL */
const extra_bits_t *extra_bits; /* extra bits for each code or NULL */ const uint8_t *extra_bits; /* extra bits for each code or NULL */
int extra_base; /* base index for extra_bits */ int extra_base; /* base index for extra_bits */
int elems; /* max number of elements in the tree */ int elems; /* max number of elements in the tree */
int max_length; /* max bit length for the codes */ int max_length; /* max bit length for the codes */
@ -1064,7 +1062,7 @@ static void pqdownheap(ct_data * tree, int k)
static void gen_bitlen(tree_desc * desc) static void gen_bitlen(tree_desc * desc)
{ {
ct_data *tree = desc->dyn_tree; ct_data *tree = desc->dyn_tree;
const extra_bits_t *extra = desc->extra_bits; const uint8_t *extra = desc->extra_bits;
int base = desc->extra_base; int base = desc->extra_base;
int max_code = desc->max_code; int max_code = desc->max_code;
int max_length = desc->max_length; int max_length = desc->max_length;

View file

@ -182,39 +182,39 @@ static state_t* alloc_state(void)
#endif #endif
static const unsigned short mask_bits[] = { static const unsigned short mask_bits[] ALIGN2 = {
0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
}; };
/* Copy lengths for literal codes 257..285 */ /* Copy lengths for literal codes 257..285 */
static const unsigned short cplens[] = { static const unsigned short cplens[] ALIGN2 = {
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59,
67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
}; };
/* note: see note #13 above about the 258 in this list. */ /* note: see note #13 above about the 258 in this list. */
/* Extra bits for literal codes 257..285 */ /* Extra bits for literal codes 257..285 */
static const unsigned char cplext[] = { static const unsigned char cplext[] ALIGN1 = {
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5,
5, 5, 5, 0, 99, 99 5, 5, 5, 0, 99, 99
}; /* 99 == invalid */ }; /* 99 == invalid */
/* Copy offsets for distance codes 0..29 */ /* Copy offsets for distance codes 0..29 */
static const unsigned short cpdist[] = { static const unsigned short cpdist[] ALIGN2 = {
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513,
769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577
}; };
/* Extra bits for distance codes */ /* Extra bits for distance codes */
static const unsigned char cpdext[] = { static const unsigned char cpdext[] ALIGN1 = {
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10,
11, 11, 12, 12, 13, 13 11, 11, 12, 12, 13, 13
}; };
/* Tables for deflate from PKZIP's appnote.txt. */ /* Tables for deflate from PKZIP's appnote.txt. */
/* Order of the bit length code lengths */ /* Order of the bit length code lengths */
static const unsigned char border[] = { static const unsigned char border[] ALIGN1 = {
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
}; };

View file

@ -715,7 +715,7 @@ enum {
OPT_NOPRESERVE_PERM = 1 << OPTBIT_NOPRESERVE_PERM, // no-same-permissions OPT_NOPRESERVE_PERM = 1 << OPTBIT_NOPRESERVE_PERM, // no-same-permissions
}; };
#if ENABLE_FEATURE_TAR_LONG_OPTIONS #if ENABLE_FEATURE_TAR_LONG_OPTIONS
static const char tar_longopts[] = static const char tar_longopts[] ALIGN1 =
"list\0" No_argument "t" "list\0" No_argument "t"
"extract\0" No_argument "x" "extract\0" No_argument "x"
"directory\0" Required_argument "C" "directory\0" Required_argument "C"

View file

@ -11,7 +11,7 @@
#include "libbb.h" #include "libbb.h"
#if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS #if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS
static const char setconsole_longopts[] = static const char setconsole_longopts[] ALIGN1 =
"reset\0" No_argument "r" "reset\0" No_argument "r"
; ;
#endif #endif

View file

@ -30,11 +30,11 @@
#define MAXDAYS 42 /* max slots in a month array */ #define MAXDAYS 42 /* max slots in a month array */
#define SPACE -1 /* used in day array */ #define SPACE -1 /* used in day array */
static const unsigned char days_in_month[] = { static const unsigned char days_in_month[] ALIGN1 = {
0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
}; };
static const unsigned char sep1752[] = { static const unsigned char sep1752[] ALIGN1 = {
1, 2, 14, 15, 16, 1, 2, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30 24, 25, 26, 27, 28, 29, 30

View file

@ -15,7 +15,7 @@
/* option vars */ /* option vars */
static const char optstring[] = "b:c:f:d:sn"; static const char optstring[] ALIGN1 = "b:c:f:d:sn";
#define CUT_OPT_BYTE_FLGS (1<<0) #define CUT_OPT_BYTE_FLGS (1<<0)
#define CUT_OPT_CHAR_FLGS (1<<1) #define CUT_OPT_CHAR_FLGS (1<<1)
#define CUT_OPT_FIELDS_FLGS (1<<2) #define CUT_OPT_FIELDS_FLGS (1<<2)
@ -163,7 +163,7 @@ static void cut_file(FILE * file)
} }
} }
static const char _op_on_field[] = " only when operating on fields"; static const char _op_on_field[] ALIGN1 = " only when operating on fields";
int cut_main(int argc, char **argv); int cut_main(int argc, char **argv);
int cut_main(int argc, char **argv) int cut_main(int argc, char **argv)

View file

@ -63,8 +63,9 @@ int date_main(int argc, char **argv)
if (!isofmt_arg) { if (!isofmt_arg) {
ifmt = 0; /* default is date */ ifmt = 0; /* default is date */
} else { } else {
static const char * const isoformats[] = static const char *const isoformats[] = {
{ "date", "hours", "minutes", "seconds" }; "date", "hours", "minutes", "seconds"
};
for (ifmt = 0; ifmt < 4; ifmt++) for (ifmt = 0; ifmt < 4; ifmt++)
if (!strcmp(isofmt_arg, isoformats[ifmt])) if (!strcmp(isofmt_arg, isoformats[ifmt]))

View file

@ -46,7 +46,7 @@ static void dd_output_status(int ATTRIBUTE_UNUSED cur_signal)
} }
static ssize_t full_write_or_warn(int fd, const void *buf, size_t len, static ssize_t full_write_or_warn(int fd, const void *buf, size_t len,
const char * const filename) const char *const filename)
{ {
ssize_t n = full_write(fd, buf, len); ssize_t n = full_write(fd, buf, len);
if (n < 0) if (n < 0)
@ -83,7 +83,7 @@ int dd_main(int argc, char **argv)
FLAG_TWOBUFS = 1 << 3, FLAG_TWOBUFS = 1 << 3,
FLAG_COUNT = 1 << 4, FLAG_COUNT = 1 << 4,
}; };
static const char keywords[] = static const char keywords[] ALIGN1 =
"bs=\0""count=\0""seek=\0""skip=\0""if=\0""of=\0" "bs=\0""count=\0""seek=\0""skip=\0""if=\0""of=\0"
#if ENABLE_FEATURE_DD_IBS_OBS #if ENABLE_FEATURE_DD_IBS_OBS
"ibs=\0""obs=\0""conv=\0""notrunc\0""sync\0""noerror\0" "ibs=\0""obs=\0""conv=\0""notrunc\0""sync\0""noerror\0"

View file

@ -42,7 +42,8 @@ int df_main(int argc, char **argv)
FILE *mount_table; FILE *mount_table;
struct mntent *mount_entry; struct mntent *mount_entry;
struct statfs s; struct statfs s;
static const char hdr_1k[] = "1k-blocks"; /* default display is kilobytes */ /* default display is kilobytes */
static const char hdr_1k[] ALIGN1 = "1k-blocks";
const char *disp_units_hdr = hdr_1k; const char *disp_units_hdr = hdr_1k;
#ifdef CONFIG_FEATURE_HUMAN_READABLE #ifdef CONFIG_FEATURE_HUMAN_READABLE

View file

@ -48,7 +48,7 @@ static int one_file_system;
static dev_t dir_dev; static dev_t dir_dev;
static void print(long size, const char * const filename) static void print(long size, const char *const filename)
{ {
/* TODO - May not want to defer error checking here. */ /* TODO - May not want to defer error checking here. */
#if ENABLE_FEATURE_HUMAN_READABLE #if ENABLE_FEATURE_HUMAN_READABLE
@ -64,7 +64,7 @@ static void print(long size, const char * const filename)
} }
/* tiny recursive du */ /* tiny recursive du */
static long du(const char * const filename) static long du(const char *const filename)
{ {
struct stat statbuf; struct stat statbuf;
long sum; long sum;

View file

@ -35,7 +35,7 @@ extern char **environ;
#include "libbb.h" #include "libbb.h"
#if ENABLE_FEATURE_ENV_LONG_OPTIONS #if ENABLE_FEATURE_ENV_LONG_OPTIONS
static const char env_longopts[] = static const char env_longopts[] ALIGN1 =
"ignore-environment\0" No_argument "i" "ignore-environment\0" No_argument "i"
"unset\0" Required_argument "u" "unset\0" Required_argument "u"
; ;

View file

@ -277,7 +277,7 @@ static VALUE *eval7(void)
static VALUE *eval6(void) static VALUE *eval6(void)
{ {
static const char keywords[] = static const char keywords[] ALIGN1 =
"quote\0""length\0""match\0""index\0""substr\0"; "quote\0""length\0""match\0""index\0""substr\0";
VALUE *r, *i1, *i2; VALUE *r, *i1, *i2;

View file

@ -13,7 +13,7 @@
#include "libbb.h" #include "libbb.h"
static const char head_opts[] = static const char head_opts[] ALIGN1 =
"n:" "n:"
#if ENABLE_FEATURE_FANCY_HEAD #if ENABLE_FEATURE_FANCY_HEAD
"c:qv" "c:qv"
@ -29,7 +29,7 @@ static const struct suffix_mult head_suffixes[] = {
}; };
#endif #endif
static const char header_fmt_str[] = "\n==> %s <==\n"; static const char header_fmt_str[] ALIGN1 = "\n==> %s <==\n";
int head_main(int argc, char **argv); int head_main(int argc, char **argv);
int head_main(int argc, char **argv) int head_main(int argc, char **argv)

View file

@ -16,7 +16,7 @@
#include "libcoreutils/coreutils.h" #include "libcoreutils/coreutils.h"
#if ENABLE_FEATURE_INSTALL_LONG_OPTIONS #if ENABLE_FEATURE_INSTALL_LONG_OPTIONS
static const char install_longopts[] = static const char install_longopts[] ALIGN1 =
"directory\0" No_argument "d" "directory\0" No_argument "d"
"preserve-timestamps\0" No_argument "p" "preserve-timestamps\0" No_argument "p"
"strip\0" No_argument "s" "strip\0" No_argument "s"

View file

@ -120,7 +120,7 @@ SPLIT_SUBDIR = 2,
static smallint show_color; static smallint show_color;
/* long option entry used only for --color, which has no short option /* long option entry used only for --color, which has no short option
* equivalent */ * equivalent */
static const char ls_color_opt[] = static const char ls_color_opt[] ALIGN1 =
"color\0" Optional_argument "\xff" /* no short equivalent */ "color\0" Optional_argument "\xff" /* no short equivalent */
; ;
#else #else
@ -710,7 +710,8 @@ static int list_single(struct dnode *dn)
/* "[-]SXvThw", GNU options, busybox optionally supports */ /* "[-]SXvThw", GNU options, busybox optionally supports */
/* "[-]K", SELinux mandated options, busybox optionally supports */ /* "[-]K", SELinux mandated options, busybox optionally supports */
/* "[-]e", I think we made this one up */ /* "[-]e", I think we made this one up */
static const char ls_options[] = "Cadil1gnsxAk" static const char ls_options[] ALIGN1 =
"Cadil1gnsxAk"
USE_FEATURE_LS_TIMESTAMPS("cetu") USE_FEATURE_LS_TIMESTAMPS("cetu")
USE_FEATURE_LS_SORTFILES("SXrv") USE_FEATURE_LS_SORTFILES("SXrv")
USE_FEATURE_LS_FILETYPES("Fp") USE_FEATURE_LS_FILETYPES("Fp")

View file

@ -25,7 +25,7 @@
/* This is a NOFORK applet. Be very careful! */ /* This is a NOFORK applet. Be very careful! */
#if ENABLE_FEATURE_MKDIR_LONG_OPTIONS #if ENABLE_FEATURE_MKDIR_LONG_OPTIONS
static const char mkdir_longopts[] = static const char mkdir_longopts[] ALIGN1 =
"mode\0" Required_argument "m" "mode\0" Required_argument "m"
"parents\0" No_argument "p" "parents\0" No_argument "p"
#if ENABLE_SELINUX #if ENABLE_SELINUX

View file

@ -14,7 +14,7 @@
#include "libbb.h" #include "libbb.h"
#include "libcoreutils/coreutils.h" #include "libcoreutils/coreutils.h"
static const char modes_chars[] = { 'p', 'c', 'u', 'b', 0, 1, 1, 2 }; static const char modes_chars[] ALIGN1 = { 'p', 'c', 'u', 'b', 0, 1, 1, 2 };
static const mode_t modes_cubp[] = { S_IFIFO, S_IFCHR, S_IFBLK }; static const mode_t modes_cubp[] = { S_IFIFO, S_IFCHR, S_IFBLK };
int mknod_main(int argc, char **argv); int mknod_main(int argc, char **argv);

View file

@ -21,7 +21,7 @@
#include "libcoreutils/coreutils.h" #include "libcoreutils/coreutils.h"
#if ENABLE_FEATURE_MV_LONG_OPTIONS #if ENABLE_FEATURE_MV_LONG_OPTIONS
static const char mv_longopts[] = static const char mv_longopts[] ALIGN1 =
"interactive\0" No_argument "i" "interactive\0" No_argument "i"
"force\0" No_argument "f" "force\0" No_argument "f"
; ;
@ -30,7 +30,8 @@ static const char mv_longopts[] =
#define OPT_FILEUTILS_FORCE 1 #define OPT_FILEUTILS_FORCE 1
#define OPT_FILEUTILS_INTERACTIVE 2 #define OPT_FILEUTILS_INTERACTIVE 2
static const char fmt[] = "cannot overwrite %sdirectory with %sdirectory"; static const char fmt[] ALIGN1 =
"cannot overwrite %sdirectory with %sdirectory";
int mv_main(int argc, char **argv); int mv_main(int argc, char **argv);
int mv_main(int argc, char **argv) int mv_main(int argc, char **argv)

View file

@ -131,7 +131,7 @@ odoffset(int argc, char ***argvp)
} }
} }
static const char * const add_strings[] = { static const char *const add_strings[] = {
"16/1 \"%3_u \" \"\\n\"", /* a */ "16/1 \"%3_u \" \"\\n\"", /* a */
"8/2 \" %06o \" \"\\n\"", /* B, o */ "8/2 \" %06o \" \"\\n\"", /* B, o */
"16/1 \"%03o \" \"\\n\"", /* b */ "16/1 \"%03o \" \"\\n\"", /* b */
@ -147,9 +147,9 @@ static const char * const add_strings[] = {
"4/4 \" %011o \" \"\\n\"", /* O */ "4/4 \" %011o \" \"\\n\"", /* O */
}; };
static const char od_opts[] = "aBbcDdeFfHhIiLlOoXxv"; static const char od_opts[] ALIGN1 = "aBbcDdeFfHhIiLlOoXxv";
static const char od_o2si[] = { static const char od_o2si[] ALIGN1 = {
0, 1, 2, 3, 5, 0, 1, 2, 3, 5,
4, 6, 6, 7, 8, 4, 6, 6, 7, 8,
9, 0xa, 0xb, 0xa, 0xa, 9, 0xa, 0xb, 0xa, 0xa,

View file

@ -129,20 +129,20 @@ struct tspec {
10 unsigned decimal 10 unsigned decimal
8 unsigned hexadecimal */ 8 unsigned hexadecimal */
static const uint8_t bytes_to_oct_digits[] = static const uint8_t bytes_to_oct_digits[] ALIGN1 =
{0, 3, 6, 8, 11, 14, 16, 19, 22, 25, 27, 30, 32, 35, 38, 41, 43}; {0, 3, 6, 8, 11, 14, 16, 19, 22, 25, 27, 30, 32, 35, 38, 41, 43};
static const uint8_t bytes_to_signed_dec_digits[] = static const uint8_t bytes_to_signed_dec_digits[] ALIGN1 =
{1, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 28, 30, 33, 35, 37, 40}; {1, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 28, 30, 33, 35, 37, 40};
static const uint8_t bytes_to_unsigned_dec_digits[] = static const uint8_t bytes_to_unsigned_dec_digits[] ALIGN1 =
{0, 3, 5, 8, 10, 13, 15, 17, 20, 22, 25, 27, 29, 32, 34, 37, 39}; {0, 3, 5, 8, 10, 13, 15, 17, 20, 22, 25, 27, 29, 32, 34, 37, 39};
static const uint8_t bytes_to_hex_digits[] = static const uint8_t bytes_to_hex_digits[] ALIGN1 =
{0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32}; {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32};
/* Convert enum size_spec to the size of the named type. */ /* Convert enum size_spec to the size of the named type. */
static const signed char width_bytes[] = { static const signed char width_bytes[] ALIGN1 = {
-1, -1,
sizeof(char), sizeof(char),
sizeof(short), sizeof(short),
@ -212,7 +212,7 @@ static char const *const default_file_list[] = { "-", NULL };
static FILE *in_stream; static FILE *in_stream;
#define MAX_INTEGRAL_TYPE_SIZE sizeof(ulonglong_t) #define MAX_INTEGRAL_TYPE_SIZE sizeof(ulonglong_t)
static unsigned char integral_type_size[MAX_INTEGRAL_TYPE_SIZE + 1] = { static unsigned char integral_type_size[MAX_INTEGRAL_TYPE_SIZE + 1] ALIGN1 = {
[sizeof(char)] = CHAR, [sizeof(char)] = CHAR,
#if USHRT_MAX != UCHAR_MAX #if USHRT_MAX != UCHAR_MAX
[sizeof(short)] = SHORT, [sizeof(short)] = SHORT,
@ -229,11 +229,11 @@ static unsigned char integral_type_size[MAX_INTEGRAL_TYPE_SIZE + 1] = {
}; };
#define MAX_FP_TYPE_SIZE sizeof(longdouble_t) #define MAX_FP_TYPE_SIZE sizeof(longdouble_t)
static unsigned char fp_type_size[MAX_FP_TYPE_SIZE + 1] = { static unsigned char fp_type_size[MAX_FP_TYPE_SIZE + 1] ALIGN1 = {
/* gcc seems to allow repeated indexes. Last one stays */ /* gcc seems to allow repeated indexes. Last one stays */
[sizeof(longdouble_t)] = FLOAT_LONG_DOUBLE, [sizeof(longdouble_t)] = FLOAT_LONG_DOUBLE,
[sizeof(double)] = FLOAT_DOUBLE, [sizeof(double)] = FLOAT_DOUBLE,
[sizeof(float)] = FLOAT_SINGLE, [sizeof(float)] = FLOAT_SINGLE
}; };
@ -383,7 +383,7 @@ print_named_ascii(size_t n_bytes, const char *block,
const char *unused_fmt_string ATTRIBUTE_UNUSED) const char *unused_fmt_string ATTRIBUTE_UNUSED)
{ {
/* Names for some non-printing characters. */ /* Names for some non-printing characters. */
static const char charname[33][3] = { static const char charname[33][3] ALIGN1 = {
"nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel", "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel",
" bs", " ht", " nl", " vt", " ff", " cr", " so", " si", " bs", " ht", " nl", " vt", " ff", " cr", " so", " si",
"dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", "dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb",
@ -560,7 +560,7 @@ decode_one_format(const char *s_orig, const char *s, const char **next,
case 'o': case 'o':
case 'u': case 'u':
case 'x': { case 'x': {
static const char CSIL[] = "CSIL"; static const char CSIL[] ALIGN1 = "CSIL";
c = *s++; c = *s++;
p = strchr(CSIL, *s); p = strchr(CSIL, *s);
@ -596,7 +596,7 @@ decode_one_format(const char *s_orig, const char *s, const char **next,
size_spec = integral_type_size[size]; size_spec = integral_type_size[size];
{ {
static const char doux[] = "doux"; static const char doux[] ALIGN1 = "doux";
static const char doux_fmt_letter[][4] = { static const char doux_fmt_letter[][4] = {
"lld", "llo", "llu", "llx" "lld", "llo", "llu", "llx"
}; };
@ -653,7 +653,7 @@ decode_one_format(const char *s_orig, const char *s, const char **next,
} }
case 'f': { case 'f': {
static const char FDL[] = "FDL"; static const char FDL[] ALIGN1 = "FDL";
fmt = FLOATING_POINT; fmt = FLOATING_POINT;
++s; ++s;
@ -836,7 +836,7 @@ format_address_none(off_t address ATTRIBUTE_UNUSED, char c ATTRIBUTE_UNUSED)
{ {
} }
static char address_fmt[] = "%0n"OFF_FMT"xc"; static char address_fmt[] ALIGN1 = "%0n"OFF_FMT"xc";
/* Corresponds to 'x' above */ /* Corresponds to 'x' above */
#define address_base_char address_fmt[sizeof(address_fmt)-3] #define address_base_char address_fmt[sizeof(address_fmt)-3]
/* Corresponds to 'n' above */ /* Corresponds to 'n' above */
@ -1233,7 +1233,7 @@ int od_main(int argc, char **argv)
OPT_traditional = (1 << 18) * ENABLE_GETOPT_LONG, OPT_traditional = (1 << 18) * ENABLE_GETOPT_LONG,
}; };
#if ENABLE_GETOPT_LONG #if ENABLE_GETOPT_LONG
static const char od_longopts[] = static const char od_longopts[] ALIGN1 =
"skip-bytes\0" Required_argument "j" "skip-bytes\0" Required_argument "j"
"address-radix\0" Required_argument "A" "address-radix\0" Required_argument "A"
"read-bytes\0" Required_argument "N" "read-bytes\0" Required_argument "N"
@ -1268,11 +1268,11 @@ int od_main(int argc, char **argv)
argc -= optind; argc -= optind;
argv += optind; argv += optind;
if (opt & OPT_A) { if (opt & OPT_A) {
static const char doxn[] = "doxn"; static const char doxn[] ALIGN1 = "doxn";
static const char doxn_address_base_char[] = { static const char doxn_address_base_char[] ALIGN1 = {
'u', 'o', 'x', /* '?' fourth one is not important */ 'u', 'o', 'x', /* '?' fourth one is not important */
}; };
static const uint8_t doxn_address_pad_len_char[] = { static const uint8_t doxn_address_pad_len_char[] ALIGN1 = {
'7', '7', '6', /* '?' */ '7', '7', '6', /* '?' */
}; };
char *p; char *p;

View file

@ -23,7 +23,7 @@
*/ */
/* These are sort types */ /* These are sort types */
static const char OPT_STR[] = "ngMucszbrdfimS:T:o:k:t:"; static const char OPT_STR[] ALIGN1 = "ngMucszbrdfimS:T:o:k:t:";
enum { enum {
FLAG_n = 1, /* Numeric sort */ FLAG_n = 1, /* Numeric sort */
FLAG_g = 2, /* Sort using strtod() */ FLAG_g = 2, /* Sort using strtod() */

View file

@ -21,7 +21,7 @@
#define OPT_DEREFERENCE (1<<2) #define OPT_DEREFERENCE (1<<2)
#define OPT_SELINUX (1<<3) #define OPT_SELINUX (1<<3)
static char buf[sizeof("YYYY-MM-DD HH:MM:SS.000000000")]; static char buf[sizeof("YYYY-MM-DD HH:MM:SS.000000000")] ALIGN1;
static char const * file_type(struct stat const *st) static char const * file_type(struct stat const *st)
{ {
@ -70,7 +70,7 @@ static char const *human_fstype(long f_type)
int i; int i;
static const struct types { static const struct types {
long type; long type;
const char * const fs; const char *const fs;
} humantypes[] = { } humantypes[] = {
{ 0xADFF, "affs" }, { 0xADFF, "affs" },
{ 0x1Cd1, "devpts" }, { 0x1Cd1, "devpts" },
@ -118,7 +118,7 @@ static char const *human_fstype(long f_type)
#if ENABLE_FEATURE_STAT_FORMAT #if ENABLE_FEATURE_STAT_FORMAT
/* print statfs info */ /* print statfs info */
static void print_statfs(char *pformat, const size_t buf_len, const char m, static void print_statfs(char *pformat, const size_t buf_len, const char m,
const char * const filename, void const *data const char *const filename, void const *data
USE_SELINUX(, security_context_t scontext)) USE_SELINUX(, security_context_t scontext))
{ {
struct statfs const *statfsbuf = data; struct statfs const *statfsbuf = data;
@ -168,7 +168,7 @@ static void print_statfs(char *pformat, const size_t buf_len, const char m,
/* print stat info */ /* print stat info */
static void print_stat(char *pformat, const size_t buf_len, const char m, static void print_stat(char *pformat, const size_t buf_len, const char m,
const char * const filename, void const *data const char *const filename, void const *data
USE_SELINUX(, security_context_t scontext)) USE_SELINUX(, security_context_t scontext))
{ {
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))

View file

@ -127,28 +127,28 @@ enum {
control, input, output, local, combination control, input, output, local, combination
}; };
static const char evenp [] = "evenp"; static const char evenp [] ALIGN1 = "evenp";
static const char raw [] = "raw"; static const char raw [] ALIGN1 = "raw";
static const char stty_min [] = "min"; static const char stty_min [] ALIGN1 = "min";
static const char stty_time [] = "time"; static const char stty_time [] ALIGN1 = "time";
static const char stty_swtch[] = "swtch"; static const char stty_swtch[] ALIGN1 = "swtch";
static const char stty_eol [] = "eol"; static const char stty_eol [] ALIGN1 = "eol";
static const char stty_eof [] = "eof"; static const char stty_eof [] ALIGN1 = "eof";
static const char parity [] = "parity"; static const char parity [] ALIGN1 = "parity";
static const char stty_oddp [] = "oddp"; static const char stty_oddp [] ALIGN1 = "oddp";
static const char stty_nl [] = "nl"; static const char stty_nl [] ALIGN1 = "nl";
static const char stty_ek [] = "ek"; static const char stty_ek [] ALIGN1 = "ek";
static const char stty_sane [] = "sane"; static const char stty_sane [] ALIGN1 = "sane";
static const char cbreak [] = "cbreak"; static const char cbreak [] ALIGN1 = "cbreak";
static const char stty_pass8[] = "pass8"; static const char stty_pass8[] ALIGN1 = "pass8";
static const char litout [] = "litout"; static const char litout [] ALIGN1 = "litout";
static const char cooked [] = "cooked"; static const char cooked [] ALIGN1 = "cooked";
static const char decctlq [] = "decctlq"; static const char decctlq [] ALIGN1 = "decctlq";
static const char stty_tabs [] = "tabs"; static const char stty_tabs [] ALIGN1 = "tabs";
static const char stty_lcase[] = "lcase"; static const char stty_lcase[] ALIGN1 = "lcase";
static const char stty_LCASE[] = "LCASE"; static const char stty_LCASE[] ALIGN1 = "LCASE";
static const char stty_crt [] = "crt"; static const char stty_crt [] ALIGN1 = "crt";
static const char stty_dec [] = "dec"; static const char stty_dec [] ALIGN1 = "dec";
/* Flags for 'struct mode_info' */ /* Flags for 'struct mode_info' */
#define SANE_SET 1 /* Set in 'sane' mode */ #define SANE_SET 1 /* Set in 'sane' mode */
@ -158,7 +158,7 @@ static const char stty_dec [] = "dec";
/* Each mode */ /* Each mode */
struct mode_info { struct mode_info {
const char * const name; /* Name given on command line */ const char *const name; /* Name given on command line */
const unsigned char type; /* Which structure element to change */ const unsigned char type; /* Which structure element to change */
const unsigned char flags; /* Setting and display options */ const unsigned char flags; /* Setting and display options */
/* were using short here, but ppc32 was unhappy: */ /* were using short here, but ppc32 was unhappy: */
@ -324,7 +324,7 @@ enum {
/* Control character settings */ /* Control character settings */
struct control_info { struct control_info {
const char * const name; /* Name given on command line */ const char *const name; /* Name given on command line */
const unsigned char saneval; /* Value to set for 'stty sane' */ const unsigned char saneval; /* Value to set for 'stty sane' */
const unsigned char offset; /* Offset in c_cc */ const unsigned char offset; /* Offset in c_cc */
}; };
@ -417,11 +417,11 @@ static const char *visible(unsigned ch)
static tcflag_t *mode_type_flag(unsigned type, const struct termios *mode) static tcflag_t *mode_type_flag(unsigned type, const struct termios *mode)
{ {
static const unsigned char tcflag_offsets[] = { static const unsigned char tcflag_offsets[] ALIGN1 = {
offsetof(struct termios, c_cflag), /* control */ offsetof(struct termios, c_cflag), /* control */
offsetof(struct termios, c_iflag), /* input */ offsetof(struct termios, c_iflag), /* input */
offsetof(struct termios, c_oflag), /* output */ offsetof(struct termios, c_oflag), /* output */
offsetof(struct termios, c_lflag), /* local */ offsetof(struct termios, c_lflag) /* local */
}; };
if (type <= local) { if (type <= local) {
@ -430,7 +430,7 @@ static tcflag_t *mode_type_flag(unsigned type, const struct termios *mode)
return NULL; return NULL;
} }
static void set_speed_or_die(enum speed_setting type, const char * const arg, static void set_speed_or_die(enum speed_setting type, const char *const arg,
struct termios * const mode) struct termios * const mode)
{ {
speed_t baud; speed_t baud;
@ -560,9 +560,9 @@ enum {
param_ospeed = 8 | 0x80, param_ospeed = 8 | 0x80,
}; };
static int find_param(const char * const name) static int find_param(const char *const name)
{ {
static const char params[] = static const char params[] ALIGN1 =
"line\0" /* 1 */ "line\0" /* 1 */
"rows\0" /* 2 */ "rows\0" /* 2 */
"cols\0" /* 3 */ "cols\0" /* 3 */

View file

@ -63,7 +63,7 @@ static ssize_t tail_read(int fd, char *buf, size_t count)
return r; return r;
} }
static const char header_fmt[] = "\n==> %s <==\n"; static const char header_fmt[] ALIGN1 = "\n==> %s <==\n";
static unsigned eat_num(const char *p) static unsigned eat_num(const char *p)
{ {

View file

@ -52,7 +52,7 @@ static unsigned int expand(const char *arg, char *buffer)
unsigned i; /* XXX: FIXME: use unsigned char? */ unsigned i; /* XXX: FIXME: use unsigned char? */
unsigned char ac; unsigned char ac;
#define CLO ":]\0" #define CLO ":]\0"
static const char classes[] = static const char classes[] ALIGN1 =
"alpha"CLO "alnum"CLO "digit"CLO "lower"CLO "upper"CLO "space"CLO "alpha"CLO "alnum"CLO "digit"CLO "lower"CLO "upper"CLO "space"CLO
"blank"CLO "punct"CLO "cntrl"CLO; "blank"CLO "punct"CLO "cntrl"CLO;
#define CLASS_invalid 0 /* we increment the retval */ #define CLASS_invalid 0 /* we increment the retval */

View file

@ -38,8 +38,8 @@ typedef struct {
char processor[8]; /* for "unknown" */ char processor[8]; /* for "unknown" */
} uname_info_t; } uname_info_t;
static const char options[] = "snrvmpa"; static const char options[] ALIGN1 = "snrvmpa";
static const unsigned short int utsname_offset[] = { static const unsigned short utsname_offset[] ALIGN2 = {
offsetof(uname_info_t,name.sysname), offsetof(uname_info_t,name.sysname),
offsetof(uname_info_t,name.nodename), offsetof(uname_info_t,name.nodename),
offsetof(uname_info_t,name.release), offsetof(uname_info_t,name.release),

View file

@ -12,7 +12,7 @@
#include "libbb.h" #include "libbb.h"
static const char uniq_opts[] = "cdu" "f:s:" "cdu\0\1\2\4"; static const char uniq_opts[] ALIGN1 = "cdu" "f:s:" "cdu\0\1\2\4";
static FILE *xgetoptfile_uniq_s(char **argv, int read0write2) static FILE *xgetoptfile_uniq_s(char **argv, int read0write2)
{ {

View file

@ -35,7 +35,7 @@
#include "libbb.h" #include "libbb.h"
#if ENABLE_FEATURE_RUN_PARTS_LONG_OPTIONS #if ENABLE_FEATURE_RUN_PARTS_LONG_OPTIONS
static const char runparts_longopts[] = static const char runparts_longopts[] ALIGN1 =
"arg\0" Required_argument "a" "arg\0" Required_argument "a"
"umask\0" Required_argument "u" "umask\0" Required_argument "u"
"test\0" No_argument "t" "test\0" No_argument "t"

View file

@ -192,7 +192,7 @@ static int do_stop(void)
} }
#if ENABLE_FEATURE_START_STOP_DAEMON_LONG_OPTIONS #if ENABLE_FEATURE_START_STOP_DAEMON_LONG_OPTIONS
static const char start_stop_daemon_longopts[] = static const char start_stop_daemon_longopts[] ALIGN1 =
"stop\0" No_argument "K" "stop\0" No_argument "K"
"start\0" No_argument "S" "start\0" No_argument "S"
"background\0" No_argument "b" "background\0" No_argument "b"

View file

@ -38,7 +38,7 @@ struct globals {
static unsigned long get_flag(char c) static unsigned long get_flag(char c)
{ {
/* Two separate vectors take less space than vector of structs */ /* Two separate vectors take less space than vector of structs */
static const char flags_letter[] = "ASDacdijsutT"; static const char flags_letter[] ALIGN1 = "ASDacdijsutT";
static const unsigned long flags_val[] = { static const unsigned long flags_val[] = {
/* A */ EXT2_NOATIME_FL, /* A */ EXT2_NOATIME_FL,
/* S */ EXT2_SYNC_FL, /* S */ EXT2_SYNC_FL,

View file

@ -79,7 +79,7 @@ struct fsck_instance {
char *base_device; /* /dev/hda for /dev/hdaN etc */ char *base_device; /* /dev/hda for /dev/hdaN etc */
}; };
static const char ignored_types[] = static const char ignored_types[] ALIGN1 =
"ignore\0" "ignore\0"
"iso9660\0" "iso9660\0"
"nfs\0" "nfs\0"
@ -90,7 +90,7 @@ static const char ignored_types[] =
"devpts\0"; "devpts\0";
#if 0 #if 0
static const char really_wanted[] = static const char really_wanted[] ALIGN1 =
"minix\0" "minix\0"
"ext2\0" "ext2\0"
"ext3\0" "ext3\0"

View file

@ -379,7 +379,7 @@ static int probe_udf(int fd, blkid_cache cache __BLKID_ATTR((unused)),
{ {
int j, bs; int j, bs;
struct iso_volume_descriptor isosb; struct iso_volume_descriptor isosb;
const char * const * m; const char *const *m;
/* determine the block size by scanning in 2K increments /* determine the block size by scanning in 2K increments
(block sizes larger than 2K will be null padded) */ (block sizes larger than 2K will be null padded) */

View file

@ -2168,7 +2168,7 @@ static int e2fsck_run_ext3_journal(e2fsck_t ctx)
* This function will move the journal inode from a visible file in * This function will move the journal inode from a visible file in
* the filesystem directory hierarchy to the reserved inode if necessary. * the filesystem directory hierarchy to the reserved inode if necessary.
*/ */
static const char * const journal_names[] = { static const char *const journal_names[] = {
".journal", "journal", ".journal.dat", "journal.dat", 0 }; ".journal", "journal", ".journal.dat", "journal.dat", 0 };
static void e2fsck_move_ext3_journal(e2fsck_t ctx) static void e2fsck_move_ext3_journal(e2fsck_t ctx)
@ -2179,7 +2179,7 @@ static void e2fsck_move_ext3_journal(e2fsck_t ctx)
ext2_filsys fs = ctx->fs; ext2_filsys fs = ctx->fs;
ext2_ino_t ino; ext2_ino_t ino;
errcode_t retval; errcode_t retval;
const char * const * cpp; const char *const * cpp;
int group, mount_flags; int group, mount_flags;
clear_problem_context(&pctx); clear_problem_context(&pctx);
@ -2372,7 +2372,7 @@ err_out:
* abbreviation of the form '@<i>' is expanded by looking up the index * abbreviation of the form '@<i>' is expanded by looking up the index
* letter <i> in the table below. * letter <i> in the table below.
*/ */
static const char * const abbrevs[] = { static const char *const abbrevs[] = {
N_("aextended attribute"), N_("aextended attribute"),
N_("Aerror allocating"), N_("Aerror allocating"),
N_("bblock"), N_("bblock"),
@ -2410,7 +2410,7 @@ static const char * const abbrevs[] = {
* Give more user friendly names to the "special" inodes. * Give more user friendly names to the "special" inodes.
*/ */
#define num_special_inodes 11 #define num_special_inodes 11
static const char * const special_inode_name[] = static const char *const special_inode_name[] =
{ {
N_("<The NULL inode>"), /* 0 */ N_("<The NULL inode>"), /* 0 */
N_("<The bad blocks inode>"), /* 1 */ N_("<The bad blocks inode>"), /* 1 */
@ -2485,7 +2485,7 @@ static void expand_at_expression(e2fsck_t ctx, char ch,
struct problem_context *pctx, struct problem_context *pctx,
int *first) int *first)
{ {
const char * const *cpp; const char *const *cpp;
const char *str; const char *str;
/* Search for the abbreviation */ /* Search for the abbreviation */
@ -8178,7 +8178,7 @@ struct latch_descr {
* These are the prompts which are used to ask the user if they want * These are the prompts which are used to ask the user if they want
* to fix a problem. * to fix a problem.
*/ */
static const char * const prompt[] = { static const char *const prompt[] = {
N_("(no prompt)"), /* 0 */ N_("(no prompt)"), /* 0 */
N_("Fix"), /* 1 */ N_("Fix"), /* 1 */
N_("Clear"), /* 2 */ N_("Clear"), /* 2 */
@ -8206,7 +8206,7 @@ static const char * const prompt[] = {
* These messages are printed when we are preen mode and we will be * These messages are printed when we are preen mode and we will be
* automatically fixing the problem. * automatically fixing the problem.
*/ */
static const char * const preen_msg[] = { static const char *const preen_msg[] = {
N_("(NONE)"), /* 0 */ N_("(NONE)"), /* 0 */
N_("FIXED"), /* 1 */ N_("FIXED"), /* 1 */
N_("CLEARED"), /* 2 */ N_("CLEARED"), /* 2 */

View file

@ -12,7 +12,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
static const char * const os_tab[] = static const char *const os_tab[] =
{ "Linux", { "Linux",
"Hurd", "Hurd",
"Masix", "Masix",
@ -42,7 +42,7 @@ char *e2p_os2string(int os_type)
*/ */
int e2p_string2os(char *str) int e2p_string2os(char *str)
{ {
const char * const *cpp; const char *const *cpp;
int i = 0; int i = 0;
for (cpp = os_tab; *cpp; cpp++, i++) { for (cpp = os_tab; *cpp; cpp++, i++) {

View file

@ -115,7 +115,7 @@ struct fsck_instance {
* Required for the uber-silly devfs /dev/ide/host1/bus2/target3/lun3 * Required for the uber-silly devfs /dev/ide/host1/bus2/target3/lun3
* pathames. * pathames.
*/ */
static const char * const devfs_hier[] = { static const char *const devfs_hier[] = {
"host", "bus", "target", "lun", 0 "host", "bus", "target", "lun", 0
}; };
#endif #endif
@ -124,7 +124,7 @@ static char *base_device(const char *device)
{ {
char *str, *cp; char *str, *cp;
#ifdef CONFIG_FEATURE_DEVFS #ifdef CONFIG_FEATURE_DEVFS
const char * const *hier; const char *const *hier;
const char *disk; const char *disk;
int len; int len;
#endif #endif
@ -226,7 +226,7 @@ errout:
} }
static const char * const ignored_types[] = { static const char *const ignored_types[] = {
"ignore", "ignore",
"iso9660", "iso9660",
"nfs", "nfs",
@ -238,7 +238,7 @@ static const char * const ignored_types[] = {
NULL NULL
}; };
static const char * const really_wanted[] = { static const char *const really_wanted[] = {
"minix", "minix",
"ext2", "ext2",
"ext3", "ext3",

View file

@ -263,7 +263,7 @@ enum {
#define OC_B OC_BUILTIN #define OC_B OC_BUILTIN
static const char tokenlist[] = static const char tokenlist[] ALIGN1 =
"\1(" NTC "\1(" NTC
"\1)" NTC "\1)" NTC
"\1/" NTC /* REGEXP */ "\1/" NTC /* REGEXP */
@ -373,7 +373,7 @@ enum {
ENVIRON, F0, NUM_INTERNAL_VARS ENVIRON, F0, NUM_INTERNAL_VARS
}; };
static const char vNames[] = static const char vNames[] ALIGN1 =
"CONVFMT\0" "OFMT\0" "FS\0*" "OFS\0" "CONVFMT\0" "OFMT\0" "FS\0*" "OFS\0"
"ORS\0" "RS\0*" "RT\0" "FILENAME\0" "ORS\0" "RS\0*" "RT\0" "FILENAME\0"
"SUBSEP\0" "ARGIND\0" "ARGC\0" "ARGV\0" "SUBSEP\0" "ARGIND\0" "ARGC\0" "ARGV\0"
@ -381,16 +381,15 @@ static const char vNames[] =
"NR\0" "NF\0*" "IGNORECASE\0*" "NR\0" "NF\0*" "IGNORECASE\0*"
"ENVIRON\0" "$\0*" "\0"; "ENVIRON\0" "$\0*" "\0";
static const char vValues[] = static const char vValues[] ALIGN1 =
"%.6g\0" "%.6g\0" " \0" " \0" "%.6g\0" "%.6g\0" " \0" " \0"
"\n\0" "\n\0" "\0" "\0" "\n\0" "\n\0" "\0" "\0"
"\034\0" "\034\0"
"\377"; "\377";
/* hash size may grow to these values */ /* hash size may grow to these values */
#define FIRST_PRIME 61; #define FIRST_PRIME 61
static const unsigned PRIMES[] = { 251, 1021, 4093, 16381, 65521 }; static const uint16_t PRIMES[] ALIGN2 = { 251, 1021, 4093, 16381, 65521 };
/* Globals. Split in two parts so that first one is addressed /* Globals. Split in two parts so that first one is addressed
@ -504,17 +503,17 @@ static int awk_exit(int) ATTRIBUTE_NORETURN;
/* ---- error handling ---- */ /* ---- error handling ---- */
static const char EMSG_INTERNAL_ERROR[] = "Internal error"; static const char EMSG_INTERNAL_ERROR[] ALIGN1 = "Internal error";
static const char EMSG_UNEXP_EOS[] = "Unexpected end of string"; static const char EMSG_UNEXP_EOS[] ALIGN1 = "Unexpected end of string";
static const char EMSG_UNEXP_TOKEN[] = "Unexpected token"; static const char EMSG_UNEXP_TOKEN[] ALIGN1 = "Unexpected token";
static const char EMSG_DIV_BY_ZERO[] = "Division by zero"; static const char EMSG_DIV_BY_ZERO[] ALIGN1 = "Division by zero";
static const char EMSG_INV_FMT[] = "Invalid format specifier"; static const char EMSG_INV_FMT[] ALIGN1 = "Invalid format specifier";
static const char EMSG_TOO_FEW_ARGS[] = "Too few arguments for builtin"; static const char EMSG_TOO_FEW_ARGS[] ALIGN1 = "Too few arguments for builtin";
static const char EMSG_NOT_ARRAY[] = "Not an array"; static const char EMSG_NOT_ARRAY[] ALIGN1 = "Not an array";
static const char EMSG_POSSIBLE_ERROR[] = "Possible syntax error"; static const char EMSG_POSSIBLE_ERROR[] ALIGN1 = "Possible syntax error";
static const char EMSG_UNDEF_FUNC[] = "Call to undefined function"; static const char EMSG_UNDEF_FUNC[] ALIGN1 = "Call to undefined function";
#if !ENABLE_FEATURE_AWK_MATH #if !ENABLE_FEATURE_AWK_MATH
static const char EMSG_NO_MATH[] = "Math support is not compiled in"; static const char EMSG_NO_MATH[] ALIGN1 = "Math support is not compiled in";
#endif #endif
static void zero_out_var(var * vp) static void zero_out_var(var * vp)
@ -522,8 +521,8 @@ static void zero_out_var(var * vp)
memset(vp, 0, sizeof(*vp)); memset(vp, 0, sizeof(*vp));
} }
static void syntax_error(const char * const message) ATTRIBUTE_NORETURN; static void syntax_error(const char *const message) ATTRIBUTE_NORETURN;
static void syntax_error(const char * const message) static void syntax_error(const char *const message)
{ {
bb_error_msg_and_die("%s:%i: %s", g_progname, g_lineno, message); bb_error_msg_and_die("%s:%i: %s", g_progname, g_lineno, message);
} }
@ -825,7 +824,7 @@ static var *copyvar(var *dest, const var *src)
static var *incvar(var *v) static var *incvar(var *v)
{ {
return setvar_i(v, getvar_i(v)+1.); return setvar_i(v, getvar_i(v) + 1.);
} }
/* return true if v is number or numeric string */ /* return true if v is number or numeric string */

View file

@ -33,12 +33,12 @@ static FILE *cmp_xfopen_input(const char *filename)
xfunc_die(); /* We already output an error message. */ xfunc_die(); /* We already output an error message. */
} }
static const char fmt_eof[] = "cmp: EOF on %s\n"; static const char fmt_eof[] ALIGN1 = "cmp: EOF on %s\n";
static const char fmt_differ[] = "%s %s differ: char %"OFF_FMT"d, line %d\n"; static const char fmt_differ[] ALIGN1 = "%s %s differ: char %"OFF_FMT"d, line %d\n";
// This fmt_l_opt uses gnu-isms. SUSv3 would be "%.0s%.0s%"OFF_FMT"d %o %o\n" // This fmt_l_opt uses gnu-isms. SUSv3 would be "%.0s%.0s%"OFF_FMT"d %o %o\n"
static const char fmt_l_opt[] = "%.0s%.0s%"OFF_FMT"d %3o %3o\n"; static const char fmt_l_opt[] ALIGN1 = "%.0s%.0s%"OFF_FMT"d %3o %3o\n";
static const char opt_chars[] = "sl"; static const char opt_chars[] ALIGN1 = "sl";
#define CMP_OPT_s (1<<0) #define CMP_OPT_s (1<<0)
#define CMP_OPT_l (1<<1) #define CMP_OPT_l (1<<1)

View file

@ -166,7 +166,7 @@ static void print_only(const char *path, size_t dirlen, const char *entry)
static void print_status(int val, char *path1, char *path2, char *entry) static void print_status(int val, char *path1, char *path2, char *entry)
{ {
const char * const _entry = entry ? entry : ""; const char *const _entry = entry ? entry : "";
char * const _path1 = entry ? concat_path_file(path1, _entry) : path1; char * const _path1 = entry ? concat_path_file(path1, _entry) : path1;
char * const _path2 = entry ? concat_path_file(path2, _entry) : path2; char * const _path2 = entry ? concat_path_file(path2, _entry) : path2;

View file

@ -89,7 +89,7 @@ typedef struct sed_cmd_s {
char cmd; /* The command char: abcdDgGhHilnNpPqrstwxy:={} */ char cmd; /* The command char: abcdDgGhHilnNpPqrstwxy:={} */
} sed_cmd_t; } sed_cmd_t;
static const char semicolon_whitespace[] = "; \n\r\t\v"; static const char semicolon_whitespace[] ALIGN1 = "; \n\r\t\v";
struct globals { struct globals {
/* options */ /* options */

View file

@ -62,18 +62,18 @@ enum {
/* vt102 typical ESC sequence */ /* vt102 typical ESC sequence */
/* terminal standout start/normal ESC sequence */ /* terminal standout start/normal ESC sequence */
static const char SOs[] = "\033[7m"; static const char SOs[] ALIGN1 = "\033[7m";
static const char SOn[] = "\033[0m"; static const char SOn[] ALIGN1 = "\033[0m";
/* terminal bell sequence */ /* terminal bell sequence */
static const char bell[] = "\007"; static const char bell[] ALIGN1 = "\007";
/* Clear-end-of-line and Clear-end-of-screen ESC sequence */ /* Clear-end-of-line and Clear-end-of-screen ESC sequence */
static const char Ceol[] = "\033[0K"; static const char Ceol[] ALIGN1 = "\033[0K";
static const char Ceos [] = "\033[0J"; static const char Ceos[] ALIGN1 = "\033[0J";
/* Cursor motion arbitrary destination ESC sequence */ /* Cursor motion arbitrary destination ESC sequence */
static const char CMrc[] = "\033[%d;%dH"; static const char CMrc[] ALIGN1 = "\033[%d;%dH";
/* Cursor motion up and down ESC sequence */ /* Cursor motion up and down ESC sequence */
static const char CMup[] = "\033[A"; static const char CMup[] ALIGN1 = "\033[A";
static const char CMdown[] = "\n"; static const char CMdown[] ALIGN1 = "\n";
enum { enum {
@ -2663,7 +2663,7 @@ static void ni(const char * s) // display messages
static int format_edit_status(void) // show file status on status line static int format_edit_status(void) // show file status on status line
{ {
static int tot; static int tot;
static const char cmd_mode_indicator[] = "-IR-"; static const char cmd_mode_indicator[] ALIGN1 = "-IR-";
int cur, percent, ret, trunc_at; int cur, percent, ret, trunc_at;
// file_modified is now a counter rather than a flag. this // file_modified is now a counter rather than a flag. this

View file

@ -470,7 +470,7 @@ static action*** parse_params(char **argv)
USE_FEATURE_FIND_CONTEXT(PARM_context ,) USE_FEATURE_FIND_CONTEXT(PARM_context ,)
}; };
static const char params[] = static const char params[] ALIGN1 =
"-a\0" "-a\0"
"-o\0" "-o\0"
USE_FEATURE_FIND_NOT( "!\0" ) USE_FEATURE_FIND_NOT( "!\0" )
@ -794,7 +794,7 @@ static action*** parse_params(char **argv)
int find_main(int argc, char **argv); int find_main(int argc, char **argv);
int find_main(int argc, char **argv) int find_main(int argc, char **argv)
{ {
static const char options[] = static const char options[] ALIGN1 =
"-follow\0" "-follow\0"
USE_FEATURE_FIND_XDEV( "-xdev\0" ) USE_FEATURE_FIND_XDEV( "-xdev\0" )
USE_FEATURE_FIND_MAXDEPTH("-maxdepth\0") USE_FEATURE_FIND_MAXDEPTH("-maxdepth\0")

View file

@ -169,7 +169,7 @@ __extension__ typedef unsigned long long __u64;
# error "Sorry, this libc version is not supported :(" # error "Sorry, this libc version is not supported :("
#endif #endif
// Don't perpetuate e2fsck crap into the headers. Clean up e2fsck instead. /* Don't perpetuate e2fsck crap into the headers. Clean up e2fsck instead. */
#if defined __GLIBC__ || defined __UCLIBC__ \ #if defined __GLIBC__ || defined __UCLIBC__ \
|| defined __dietlibc__ || defined _NEWLIB_VERSION || defined __dietlibc__ || defined _NEWLIB_VERSION
@ -210,6 +210,16 @@ typedef unsigned smalluint;
#include <stdbool.h> #include <stdbool.h>
#endif #endif
/* Try to defeat gcc's alignment of "char message[]"-like data */
#if 1 /* if needed: !defined(arch1) && !defined(arch2) */
#define ALIGN1 __attribute__((aligned(1)))
#define ALIGN2 __attribute__((aligned(2)))
#else
/* Arches which MUST have 2 or 4 byte alignment for everything are here */
#define ALIGN1
#define ALIGN2
#endif
/* uclibc does not implement daemon() for no-mmu systems. /* uclibc does not implement daemon() for no-mmu systems.
* For 0.9.29 and svn, __ARCH_USE_MMU__ indicates no-mmu reliably. * For 0.9.29 and svn, __ARCH_USE_MMU__ indicates no-mmu reliably.
@ -289,7 +299,7 @@ static ALWAYS_INLINE char* strchrnul(const char *s, char c)
#if defined(__linux__) #if defined(__linux__)
#include <sys/mount.h> #include <sys/mount.h>
// Make sure we have all the new mount flags we actually try to use. /* Make sure we have all the new mount flags we actually try to use. */
#ifndef MS_BIND #ifndef MS_BIND
#define MS_BIND (1<<12) #define MS_BIND (1<<12)
#endif #endif
@ -303,7 +313,7 @@ static ALWAYS_INLINE char* strchrnul(const char *s, char c)
#define MS_SILENT (1<<15) #define MS_SILENT (1<<15)
#endif #endif
// The shared subtree stuff, which went in around 2.6.15 /* The shared subtree stuff, which went in around 2.6.15. */
#ifndef MS_UNBINDABLE #ifndef MS_UNBINDABLE
#define MS_UNBINDABLE (1<<17) #define MS_UNBINDABLE (1<<17)
#endif #endif

View file

@ -106,7 +106,7 @@ enum {
#endif #endif
}; };
static const char * const environment[] = { static const char *const environment[] = {
"HOME=/", "HOME=/",
bb_PATH_root_path, bb_PATH_root_path,
"SHELL=/bin/sh", "SHELL=/bin/sh",
@ -457,7 +457,7 @@ static pid_t run(const struct init_action *a)
#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__) #if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
if (a->action & ASKFIRST) { if (a->action & ASKFIRST) {
static const char press_enter[] = static const char press_enter[] ALIGN1 =
#ifdef CUSTOMIZED_BANNER #ifdef CUSTOMIZED_BANNER
#include CUSTOMIZED_BANNER #include CUSTOMIZED_BANNER
#endif #endif
@ -923,7 +923,7 @@ int init_main(int argc, char **argv)
chdir("/"); chdir("/");
setsid(); setsid();
{ {
const char * const *e; const char *const *e;
/* Make sure environs is set to something sane */ /* Make sure environs is set to something sane */
for (e = environment; *e; e++) for (e = environment; *e; e++)
putenv((char *) *e); putenv((char *) *e);

View file

@ -7,7 +7,7 @@
/* returns the array index of the string */ /* returns the array index of the string */
/* (index of first match is returned, or -1) */ /* (index of first match is returned, or -1) */
int index_in_str_array(const char * const string_array[], const char *key) int index_in_str_array(const char *const string_array[], const char *key)
{ {
int i; int i;
@ -36,7 +36,7 @@ int index_in_strings(const char *strings, const char *key)
/* returns the array index of the string, even if it matches only a beginning */ /* returns the array index of the string, even if it matches only a beginning */
/* (index of first match is returned, or -1) */ /* (index of first match is returned, or -1) */
#ifdef UNUSED #ifdef UNUSED
int index_in_substr_array(const char * const string_array[], const char *key) int index_in_substr_array(const char *const string_array[], const char *key)
{ {
int i; int i;
int len = strlen(key); int len = strlen(key);

View file

@ -26,12 +26,12 @@ static int exitval; /* final exit value */
int bb_dump_blocksize; /* data block size */ int bb_dump_blocksize; /* data block size */
int bb_dump_length = -1; /* max bytes to read */ int bb_dump_length = -1; /* max bytes to read */
static const char index_str[] = ".#-+ 0123456789"; static const char index_str[] ALIGN1 = ".#-+ 0123456789";
static const char size_conv_str[] = static const char size_conv_str[] ALIGN1 =
"\x1\x4\x4\x4\x4\x4\x4\x8\x8\x8\x8\010cdiouxXeEfgG"; "\x1\x4\x4\x4\x4\x4\x4\x8\x8\x8\x8\010cdiouxXeEfgG";
static const char lcc[] = "diouxX"; static const char lcc[] ALIGN1 = "diouxX";
int bb_dump_size(FS * fs) int bb_dump_size(FS * fs)
{ {
@ -440,7 +440,7 @@ static void bpad(PR * pr)
while ((*p2++ = *p1++) != 0); while ((*p2++ = *p1++) != 0);
} }
static const char conv_str[] = static const char conv_str[] ALIGN1 =
"\0\\0\0" "\0\\0\0"
"\007\\a\0" /* \a */ "\007\\a\0" /* \a */
"\b\\b\0" "\b\\b\0"
@ -479,7 +479,7 @@ static void conv_c(PR * pr, unsigned char * p)
static void conv_u(PR * pr, unsigned char * p) static void conv_u(PR * pr, unsigned char * p)
{ {
static const char list[] = static const char list[] ALIGN1 =
"nul\0soh\0stx\0etx\0eot\0enq\0ack\0bel\0" "nul\0soh\0stx\0etx\0eot\0enq\0ack\0bel\0"
"bs\0_ht\0_lf\0_vt\0_ff\0_cr\0_so\0_si\0_" "bs\0_ht\0_lf\0_vt\0_ff\0_cr\0_so\0_si\0_"
"dle\0dcl\0dc2\0dc3\0dc4\0nak\0syn\0etb\0" "dle\0dcl\0dc2\0dc3\0dc4\0nak\0syn\0etb\0"

View file

@ -76,7 +76,7 @@ const char *applet_long_options
This struct allows you to define long options: This struct allows you to define long options:
static const char applet_longopts[] = static const char applet_longopts[] ALIGN1 =
//"name\0" has_arg val //"name\0" has_arg val
"verbose\0" No_argument "v" "verbose\0" No_argument "v"
; ;

View file

@ -31,12 +31,12 @@
const char *make_human_readable_str(unsigned long long size, const char *make_human_readable_str(unsigned long long size,
unsigned long block_size, unsigned long display_unit) unsigned long block_size, unsigned long display_unit)
{ {
/* The code will adjust for additional (appended) units. */ /* The code will adjust for additional (appended) units */
static const char zero_and_units[] = { '0', 0, 'k', 'M', 'G', 'T' }; static const char zero_and_units[] ALIGN1 = { '0', 0, 'k', 'M', 'G', 'T' };
static const char fmt[] = "%llu"; static const char fmt[] ALIGN1 = "%llu";
static const char fmt_tenths[] = "%llu.%d%c"; static const char fmt_tenths[] ALIGN1 = "%llu.%d%c";
static char str[21]; /* Sufficient for 64 bit unsigned integers. */ static char str[21] ALIGN1; /* Sufficient for 64 bit unsigned integers */
unsigned long long val; unsigned long long val;
int frac; int frac;
@ -53,7 +53,7 @@ const char *make_human_readable_str(unsigned long long size,
} }
if (display_unit) { if (display_unit) {
val += display_unit/2; /* Deal with rounding. */ val += display_unit/2; /* Deal with rounding */
val /= display_unit; /* Don't combine with the line above!!! */ val /= display_unit; /* Don't combine with the line above!!! */
} else { } else {
++u; ++u;

View file

@ -15,8 +15,8 @@
#define LOGIN " login: " #define LOGIN " login: "
static const char fmtstr_d[] = "%A, %d %B %Y"; static const char fmtstr_d[] ALIGN1 = "%A, %d %B %Y";
static const char fmtstr_t[] = "%H:%M:%S"; static const char fmtstr_t[] ALIGN1 = "%H:%M:%S";
void print_login_issue(const char *issue_file, const char *tty) void print_login_issue(const char *issue_file, const char *tty)
{ {

View file

@ -75,7 +75,7 @@ static void md5_hash_block(const void *buffer, md5_ctx_t *ctx)
0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391
}; };
static const char P_array[] = { static const char P_array[] ALIGN1 = {
# if MD5_SIZE_VS_SPEED > 1 # if MD5_SIZE_VS_SPEED > 1
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 1 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 1 */
# endif /* MD5_SIZE_VS_SPEED > 1 */ # endif /* MD5_SIZE_VS_SPEED > 1 */
@ -85,7 +85,7 @@ static void md5_hash_block(const void *buffer, md5_ctx_t *ctx)
}; };
# if MD5_SIZE_VS_SPEED > 1 # if MD5_SIZE_VS_SPEED > 1
static const char S_array[] = { static const char S_array[] ALIGN1 = {
7, 12, 17, 22, 7, 12, 17, 22,
5, 9, 14, 20, 5, 9, 14, 20,
4, 11, 16, 23, 4, 11, 16, 23,

View file

@ -12,34 +12,34 @@
#else #else
#define BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")" #define BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")"
#endif #endif
const char bb_banner[] = BANNER; const char bb_banner[] ALIGN1 = BANNER;
const char bb_msg_memory_exhausted[] = "memory exhausted"; const char bb_msg_memory_exhausted[] ALIGN1 = "memory exhausted";
const char bb_msg_invalid_date[] = "invalid date '%s'"; const char bb_msg_invalid_date[] ALIGN1 = "invalid date '%s'";
const char bb_msg_write_error[] = "write error"; const char bb_msg_write_error[] ALIGN1 = "write error";
const char bb_msg_read_error[] = "read error"; const char bb_msg_read_error[] ALIGN1 = "read error";
const char bb_msg_unknown[] = "(unknown)"; const char bb_msg_unknown[] ALIGN1 = "(unknown)";
const char bb_msg_can_not_create_raw_socket[] = "can't create raw socket"; const char bb_msg_can_not_create_raw_socket[] ALIGN1 = "can't create raw socket";
const char bb_msg_perm_denied_are_you_root[] = "permission denied. (are you root?)"; const char bb_msg_perm_denied_are_you_root[] ALIGN1 = "permission denied. (are you root?)";
const char bb_msg_requires_arg[] = "%s requires an argument"; const char bb_msg_requires_arg[] ALIGN1 = "%s requires an argument";
const char bb_msg_invalid_arg[] = "invalid argument '%s' to '%s'"; const char bb_msg_invalid_arg[] ALIGN1 = "invalid argument '%s' to '%s'";
const char bb_msg_standard_input[] = "standard input"; const char bb_msg_standard_input[] ALIGN1 = "standard input";
const char bb_msg_standard_output[] = "standard output"; const char bb_msg_standard_output[] ALIGN1 = "standard output";
const char bb_str_default[] = "default"; const char bb_str_default[] ALIGN1 = "default";
const char bb_hexdigits_upcase[] = "0123456789ABCDEF"; const char bb_hexdigits_upcase[] ALIGN1 = "0123456789ABCDEF";
const char bb_path_passwd_file[] = "/etc/passwd"; const char bb_path_passwd_file[] ALIGN1 = "/etc/passwd";
const char bb_path_shadow_file[] = "/etc/shadow"; const char bb_path_shadow_file[] ALIGN1 = "/etc/shadow";
const char bb_path_group_file[] = "/etc/group"; const char bb_path_group_file[] ALIGN1 = "/etc/group";
const char bb_path_gshadow_file[] = "/etc/gshadow"; const char bb_path_gshadow_file[] ALIGN1 = "/etc/gshadow";
const char bb_path_motd_file[] = "/etc/motd"; const char bb_path_motd_file[] ALIGN1 = "/etc/motd";
const char bb_dev_null[] = "/dev/null"; const char bb_dev_null[] ALIGN1 = "/dev/null";
const char bb_busybox_exec_path[] = CONFIG_BUSYBOX_EXEC_PATH; const char bb_busybox_exec_path[] ALIGN1 = CONFIG_BUSYBOX_EXEC_PATH;
const char bb_default_login_shell[] = LIBBB_DEFAULT_LOGIN_SHELL; const char bb_default_login_shell[] ALIGN1 = LIBBB_DEFAULT_LOGIN_SHELL;
/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,
* but I want to save a few bytes here. Check libbb.h before changing! */ * but I want to save a few bytes here. Check libbb.h before changing! */
const char bb_PATH_root_path[] = "PATH=/sbin:/usr/sbin:/bin:/usr/bin"; const char bb_PATH_root_path[] ALIGN1 = "PATH=/sbin:/usr/sbin:/bin:/usr/bin";
const int const_int_0; const int const_int_0;
@ -47,7 +47,7 @@ const int const_int_1 = 1;
#include <utmp.h> #include <utmp.h>
/* This is usually something like "/var/adm/wtmp" or "/var/log/wtmp" */ /* This is usually something like "/var/adm/wtmp" or "/var/log/wtmp" */
const char bb_path_wtmp_file[] = const char bb_path_wtmp_file[] ALIGN1 =
#if defined _PATH_WTMP #if defined _PATH_WTMP
_PATH_WTMP; _PATH_WTMP;
#elif defined WTMP_FILE #elif defined WTMP_FILE

View file

@ -47,9 +47,9 @@ static const mode_t mode_flags[] = {
/* The previous version used "0pcCd?bB-?l?s???". However, the '0', 'C', /* The previous version used "0pcCd?bB-?l?s???". However, the '0', 'C',
* and 'B' types don't appear to be available on linux. So I removed them. */ * and 'B' types don't appear to be available on linux. So I removed them. */
static const char type_chars[16] = "?pc?d?b?-?l?s???"; static const char type_chars[16] ALIGN1 = "?pc?d?b?-?l?s???";
/* 0123456789abcdef */ /* 0123456789abcdef */
static const char mode_chars[7] = "rwxSTst"; static const char mode_chars[7] ALIGN1 = "rwxSTst";
const char *bb_mode_string(mode_t mode) const char *bb_mode_string(mode_t mode)
{ {

View file

@ -11,5 +11,5 @@
/* Busybox mount uses either /proc/mounts or /etc/mtab to /* Busybox mount uses either /proc/mounts or /etc/mtab to
* get the list of currently mounted filesystems */ * get the list of currently mounted filesystems */
const char bb_path_mtab_file[] = const char bb_path_mtab_file[] ALIGN1 =
USE_FEATURE_MTAB_SUPPORT("/etc/mtab")SKIP_FEATURE_MTAB_SUPPORT("/proc/mounts"); USE_FEATURE_MTAB_SUPPORT("/etc/mtab")SKIP_FEATURE_MTAB_SUPPORT("/proc/mounts");

View file

@ -31,8 +31,8 @@ int bb_parse_mode(const char *s, mode_t *current_mode)
S_ISUID | S_ISGID, /* s */ S_ISUID | S_ISGID, /* s */
S_ISVTX /* t */ S_ISVTX /* t */
}; };
static const char who_chars[] = "augo"; static const char who_chars[] ALIGN1 = "augo";
static const char perm_chars[] = "rwxXst"; static const char perm_chars[] ALIGN1 = "rwxXst";
const char *p; const char *p;
mode_t wholist; mode_t wholist;

View file

@ -18,7 +18,7 @@
char bb_process_escape_sequence(const char **ptr) char bb_process_escape_sequence(const char **ptr)
{ {
static const char charmap[] = { static const char charmap[] ALIGN1 = {
'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', 0, 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', 0,
'\a', '\b', '\f', '\n', '\r', '\t', '\v', '\\', '\\' }; '\a', '\b', '\f', '\n', '\r', '\t', '\v', '\\', '\\' };

View file

@ -8,7 +8,7 @@
#include "libbb.h" #include "libbb.h"
/* Conversion table. for base 64 */ /* Conversion table. for base 64 */
const char bb_uuenc_tbl_base64[65 + 2] = { const char bb_uuenc_tbl_base64[65 + 2] ALIGN1 = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
@ -21,7 +21,7 @@ const char bb_uuenc_tbl_base64[65 + 2] = {
'\n', '\0' /* needed for uudecode.c */ '\n', '\0' /* needed for uudecode.c */
}; };
const char bb_uuenc_tbl_std[65] = { const char bb_uuenc_tbl_std[65] ALIGN1 = {
'`', '!', '"', '#', '$', '%', '&', '\'', '`', '!', '"', '#', '$', '%', '&', '\'',
'(', ')', '*', '+', ',', '-', '.', '/', '(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '0', '1', '2', '3', '4', '5', '6', '7',

View file

@ -695,7 +695,8 @@ int putpwent(const struct passwd *__restrict p, FILE *__restrict f)
int putgrent(const struct group *__restrict p, FILE *__restrict f) int putgrent(const struct group *__restrict p, FILE *__restrict f)
{ {
static const char format[] = ",%s"; static const char format[] ALIGN1 = ",%s";
char **m; char **m;
const char *fmt; const char *fmt;
int rv = -1; int rv = -1;
@ -735,18 +736,19 @@ int putgrent(const struct group *__restrict p, FILE *__restrict f)
} }
#if ENABLE_USE_BB_SHADOW #if ENABLE_USE_BB_SHADOW
static const unsigned char _sp_off[] = { static const unsigned char _sp_off[] ALIGN1 = {
offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */ offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */
offsetof(struct spwd, sp_min), /* 3 - not a char ptr */ offsetof(struct spwd, sp_min), /* 3 - not a char ptr */
offsetof(struct spwd, sp_max), /* 4 - not a char ptr */ offsetof(struct spwd, sp_max), /* 4 - not a char ptr */
offsetof(struct spwd, sp_warn), /* 5 - not a char ptr */ offsetof(struct spwd, sp_warn), /* 5 - not a char ptr */
offsetof(struct spwd, sp_inact), /* 6 - not a char ptr */ offsetof(struct spwd, sp_inact), /* 6 - not a char ptr */
offsetof(struct spwd, sp_expire), /* 7 - not a char ptr */ offsetof(struct spwd, sp_expire) /* 7 - not a char ptr */
}; };
int putspent(const struct spwd *p, FILE *stream) int putspent(const struct spwd *p, FILE *stream)
{ {
static const char ld_format[] = "%ld:"; static const char ld_format[] ALIGN1 = "%ld:";
const char *f; const char *f;
long x; long x;
int i; int i;
@ -787,14 +789,14 @@ DO_UNLOCK:
/* Internal uClibc functions. */ /* Internal uClibc functions. */
/**********************************************************************/ /**********************************************************************/
static const unsigned char pw_off[] = { static const unsigned char pw_off[] ALIGN1 = {
offsetof(struct passwd, pw_name), /* 0 */ offsetof(struct passwd, pw_name), /* 0 */
offsetof(struct passwd, pw_passwd), /* 1 */ offsetof(struct passwd, pw_passwd), /* 1 */
offsetof(struct passwd, pw_uid), /* 2 - not a char ptr */ offsetof(struct passwd, pw_uid), /* 2 - not a char ptr */
offsetof(struct passwd, pw_gid), /* 3 - not a char ptr */ offsetof(struct passwd, pw_gid), /* 3 - not a char ptr */
offsetof(struct passwd, pw_gecos), /* 4 */ offsetof(struct passwd, pw_gecos), /* 4 */
offsetof(struct passwd, pw_dir), /* 5 */ offsetof(struct passwd, pw_dir), /* 5 */
offsetof(struct passwd, pw_shell) /* 6 */ offsetof(struct passwd, pw_shell) /* 6 */
}; };
static int bb__parsepwent(void *data, char *line) static int bb__parsepwent(void *data, char *line)
@ -845,10 +847,10 @@ static int bb__parsepwent(void *data, char *line)
/**********************************************************************/ /**********************************************************************/
static const unsigned char gr_off[] = { static const unsigned char gr_off[] ALIGN1 = {
offsetof(struct group, gr_name), /* 0 */ offsetof(struct group, gr_name), /* 0 */
offsetof(struct group, gr_passwd), /* 1 */ offsetof(struct group, gr_passwd), /* 1 */
offsetof(struct group, gr_gid) /* 2 - not a char ptr */ offsetof(struct group, gr_gid) /* 2 - not a char ptr */
}; };
static int bb__parsegrent(void *data, char *line) static int bb__parsegrent(void *data, char *line)
@ -943,16 +945,16 @@ static int bb__parsegrent(void *data, char *line)
/**********************************************************************/ /**********************************************************************/
#if ENABLE_USE_BB_SHADOW #if ENABLE_USE_BB_SHADOW
static const unsigned char sp_off[] = { static const unsigned char sp_off[] ALIGN1 = {
offsetof(struct spwd, sp_namp), /* 0 */ offsetof(struct spwd, sp_namp), /* 0 */
offsetof(struct spwd, sp_pwdp), /* 1 */ offsetof(struct spwd, sp_pwdp), /* 1 */
offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */ offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */
offsetof(struct spwd, sp_min), /* 3 - not a char ptr */ offsetof(struct spwd, sp_min), /* 3 - not a char ptr */
offsetof(struct spwd, sp_max), /* 4 - not a char ptr */ offsetof(struct spwd, sp_max), /* 4 - not a char ptr */
offsetof(struct spwd, sp_warn), /* 5 - not a char ptr */ offsetof(struct spwd, sp_warn), /* 5 - not a char ptr */
offsetof(struct spwd, sp_inact), /* 6 - not a char ptr */ offsetof(struct spwd, sp_inact), /* 6 - not a char ptr */
offsetof(struct spwd, sp_expire), /* 7 - not a char ptr */ offsetof(struct spwd, sp_expire), /* 7 - not a char ptr */
offsetof(struct spwd, sp_flag) /* 8 - not a char ptr */ offsetof(struct spwd, sp_flag) /* 8 - not a char ptr */
}; };
static int bb__parsespent(void *data, char * line) static int bb__parsespent(void *data, char * line)

View file

@ -81,7 +81,8 @@ static void passwd_wrapper(const char *login) ATTRIBUTE_NORETURN;
static void passwd_wrapper(const char *login) static void passwd_wrapper(const char *login)
{ {
static const char prog[] = "passwd"; static const char prog[] ALIGN1 = "passwd";
BB_EXECLP(prog, prog, login, NULL); BB_EXECLP(prog, prog, login, NULL);
bb_error_msg_and_die("failed to execute '%s', you must set the password for '%s' manually", prog, login); bb_error_msg_and_die("failed to execute '%s', you must set the password for '%s' manually", prog, login);
} }

View file

@ -11,7 +11,7 @@
#if ENABLE_GETOPT_LONG #if ENABLE_GETOPT_LONG
#include <getopt.h> #include <getopt.h>
static const char chpasswd_longopts[] = static const char chpasswd_longopts[] ALIGN1 =
"encrypted\0" No_argument "e" "encrypted\0" No_argument "e"
"md5\0" No_argument "m" "md5\0" No_argument "m"
; ;

View file

@ -93,7 +93,7 @@ struct options {
int speeds[MAX_SPEED]; /* baud rates to be tried */ int speeds[MAX_SPEED]; /* baud rates to be tried */
}; };
static const char opt_string[] = "I:LH:f:hil:mt:wn"; static const char opt_string[] ALIGN1 = "I:LH:f:hil:mt:wn";
#define F_INITSTRING (1<<0) /* initstring is set */ #define F_INITSTRING (1<<0) /* initstring is set */
#define F_LOCAL (1<<1) /* force local */ #define F_LOCAL (1<<1) /* force local */
#define F_FAKEHOST (1<<2) /* force fakehost */ #define F_FAKEHOST (1<<2) /* force fakehost */

View file

@ -9,7 +9,7 @@
#include "libbb.h" #include "libbb.h"
static const char * const forbid[] = { static const char *const forbid[] = {
"ENV", "ENV",
"BASH_ENV", "BASH_ENV",
"HOME", "HOME",
@ -40,7 +40,7 @@ int sulogin_main(int argc, char **argv)
char *cp; char *cp;
int timeout = 0; int timeout = 0;
char *timeout_arg; char *timeout_arg;
const char * const *p; const char *const *p;
struct passwd *pwd; struct passwd *pwd;
const char *shell; const char *shell;
#if ENABLE_FEATURE_SHADOWPASSWDS #if ENABLE_FEATURE_SHADOWPASSWDS

View file

@ -14,7 +14,10 @@
#include "libbb.h" #include "libbb.h"
#include <sys/timex.h> #include <sys/timex.h>
static const struct {int bit; const char *name;} statlist[] = { static const struct {
int bit;
const char *name;
} statlist[] = {
{ STA_PLL, "PLL" }, { STA_PLL, "PLL" },
{ STA_PPSFREQ, "PPSFREQ" }, { STA_PPSFREQ, "PPSFREQ" },
{ STA_PPSTIME, "PPSTIME" }, { STA_PPSTIME, "PPSTIME" },
@ -28,15 +31,17 @@ static const struct {int bit; const char *name;} statlist[] = {
{ STA_PPSWANDER, "PPSWANDER" }, { STA_PPSWANDER, "PPSWANDER" },
{ STA_PPSERROR, "PPSERROR" }, { STA_PPSERROR, "PPSERROR" },
{ STA_CLOCKERR, "CLOCKERR" }, { STA_CLOCKERR, "CLOCKERR" },
{ 0, NULL } }; { 0, NULL }
};
static const char * const ret_code_descript[] = { static const char *const ret_code_descript[] = {
"clock synchronized", "clock synchronized",
"insert leap second", "insert leap second",
"delete leap second", "delete leap second",
"leap second in progress", "leap second in progress",
"leap second has occurred", "leap second has occurred",
"clock not synchronized" }; "clock not synchronized"
};
int adjtimex_main(int argc, char **argv); int adjtimex_main(int argc, char **argv);
int adjtimex_main(int argc, char **argv) int adjtimex_main(int argc, char **argv)

View file

@ -245,12 +245,10 @@ static struct config_entry_struct *last_config = NULL;
static char *mount_point = NULL; static char *mount_point = NULL;
static volatile int caught_signal = FALSE; static volatile int caught_signal = FALSE;
static volatile int caught_sighup = FALSE; static volatile int caught_sighup = FALSE;
static struct initial_symlink_struct static struct initial_symlink_struct {
{
const char *dest; const char *dest;
const char *name; const char *name;
} initial_symlinks[] = } initial_symlinks[] = {
{
{"/proc/self/fd", "fd"}, {"/proc/self/fd", "fd"},
{"fd/0", "stdin"}, {"fd/0", "stdin"},
{"fd/1", "stdout"}, {"fd/1", "stdout"},
@ -258,12 +256,10 @@ static struct initial_symlink_struct
{NULL, NULL}, {NULL, NULL},
}; };
static struct event_type static struct event_type {
{
unsigned int type; /* The DEVFSD_NOTIFY_* value */ unsigned int type; /* The DEVFSD_NOTIFY_* value */
const char *config_name; /* The name used in the config file */ const char *config_name; /* The name used in the config file */
} event_types[] = } event_types[] = {
{
{DEVFSD_NOTIFY_REGISTERED, "REGISTER"}, {DEVFSD_NOTIFY_REGISTERED, "REGISTER"},
{DEVFSD_NOTIFY_UNREGISTERED, "UNREGISTER"}, {DEVFSD_NOTIFY_UNREGISTERED, "UNREGISTER"},
{DEVFSD_NOTIFY_ASYNC_OPEN, "ASYNC_OPEN"}, {DEVFSD_NOTIFY_ASYNC_OPEN, "ASYNC_OPEN"},
@ -277,10 +273,10 @@ static struct event_type
/* Busybox messages */ /* Busybox messages */
static const char * const bb_msg_proto_rev = "protocol revision"; static const char bb_msg_proto_rev[] ALIGN1 = "protocol revision";
static const char * const bb_msg_bad_config = "bad %s config file: %s"; static const char bb_msg_bad_config[] ALIGN1 = "bad %s config file: %s";
static const char * const bb_msg_small_buffer = "buffer too small"; static const char bb_msg_small_buffer[] ALIGN1 = "buffer too small";
static const char * const bb_msg_variable_not_found = "variable: %s not found"; static const char bb_msg_variable_not_found[] ALIGN1 = "variable: %s not found";
/* Busybox stuff */ /* Busybox stuff */
#if ENABLE_DEVFSD_VERBOSE || ENABLE_DEBUG #if ENABLE_DEVFSD_VERBOSE || ENABLE_DEBUG
@ -387,10 +383,10 @@ int devfsd_main(int argc, char **argv)
/* NB: The check for CONFIG_FILE is done in read_config_file() */ /* NB: The check for CONFIG_FILE is done in read_config_file() */
if (print_version ||(DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev)) { if (print_version || (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev)) {
printf("%s v%s\nDaemon %s:\t%d\nKernel-side %s:\t%d\n", printf("%s v%s\nDaemon %s:\t%d\nKernel-side %s:\t%d\n",
applet_name, DEVFSD_VERSION, bb_msg_proto_rev, applet_name, DEVFSD_VERSION, bb_msg_proto_rev,
DEVFSD_PROTOCOL_REVISION_DAEMON,bb_msg_proto_rev, proto_rev); DEVFSD_PROTOCOL_REVISION_DAEMON, bb_msg_proto_rev, proto_rev);
if (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev) if (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev)
bb_error_msg_and_die("%s mismatch!", bb_msg_proto_rev); bb_error_msg_and_die("%s mismatch!", bb_msg_proto_rev);
exit(EXIT_SUCCESS); /* -v */ exit(EXIT_SUCCESS); /* -v */
@ -509,7 +505,7 @@ static void process_config_line(const char *line, unsigned long *event_mask)
int i; int i;
/* !!!! Only Uppercase Keywords in devsfd.conf */ /* !!!! Only Uppercase Keywords in devsfd.conf */
static const char options[] = static const char options[] ALIGN1 =
"CLEAR_CONFIG\0""INCLUDE\0""OPTIONAL_INCLUDE\0" "CLEAR_CONFIG\0""INCLUDE\0""OPTIONAL_INCLUDE\0"
"RESTORE\0""PERMISSIONS\0""MODLOAD\0""EXECUTE\0" "RESTORE\0""PERMISSIONS\0""MODLOAD\0""EXECUTE\0"
"COPY\0""IGNORE\0""MKOLDCOMPAT\0""MKNEWCOMPAT\0" "COPY\0""IGNORE\0""MKOLDCOMPAT\0""MKNEWCOMPAT\0"

View file

@ -128,7 +128,7 @@
#define CDROM 0x0005 #define CDROM 0x0005
#if ENABLE_FEATURE_HDPARM_GET_IDENTITY #if ENABLE_FEATURE_HDPARM_GET_IDENTITY
static const char * const pkt_str[] = { static const char *const pkt_str[] = {
"Direct-access device", /* word 0, bits 12-8 = 00 */ "Direct-access device", /* word 0, bits 12-8 = 00 */
"Sequential-access device", /* word 0, bits 12-8 = 01 */ "Sequential-access device", /* word 0, bits 12-8 = 01 */
"Printer", /* word 0, bits 12-8 = 02 */ "Printer", /* word 0, bits 12-8 = 02 */
@ -163,7 +163,7 @@ static const char * const pkt_str[] = {
"Unknown", /* word 0, bits 12-8 = 1f */ "Unknown", /* word 0, bits 12-8 = 1f */
}; };
static const char * const ata1_cfg_str[] = { /* word 0 in ATA-1 mode */ static const char *const ata1_cfg_str[] = { /* word 0 in ATA-1 mode */
"Reserved", /* bit 0 */ "Reserved", /* bit 0 */
"hard sectored", /* bit 1 */ "hard sectored", /* bit 1 */
"soft sectored", /* bit 2 */ "soft sectored", /* bit 2 */
@ -326,7 +326,7 @@ static const char actual_ver[MINOR_MAX+2] = {
#define NUM_CMD_FEAT_STR 48 #define NUM_CMD_FEAT_STR 48
#if ENABLE_FEATURE_HDPARM_GET_IDENTITY #if ENABLE_FEATURE_HDPARM_GET_IDENTITY
static const char * const cmd_feat_str[] = { static const char *const cmd_feat_str[] = {
"", /* word 82 bit 15: obsolete */ "", /* word 82 bit 15: obsolete */
"NOP cmd", /* word 82 bit 14 */ "NOP cmd", /* word 82 bit 14 */
"READ BUFFER cmd", /* word 82 bit 13 */ "READ BUFFER cmd", /* word 82 bit 13 */
@ -413,7 +413,7 @@ void identify_from_stdin(void);
#define SECU_LEVEL 0x0010 #define SECU_LEVEL 0x0010
#define NUM_SECU_STR 6 #define NUM_SECU_STR 6
#if ENABLE_FEATURE_HDPARM_GET_IDENTITY #if ENABLE_FEATURE_HDPARM_GET_IDENTITY
static const char * const secu_str[] = { static const char *const secu_str[] = {
"supported", /* word 128, bit 0 */ "supported", /* word 128, bit 0 */
"enabled", /* word 128, bit 1 */ "enabled", /* word 128, bit 1 */
"locked", /* word 128, bit 2 */ "locked", /* word 128, bit 2 */
@ -1096,14 +1096,16 @@ static unsigned long hwif_irq;
// Too bad, really. // Too bad, really.
#if ENABLE_FEATURE_HDPARM_GET_IDENTITY #if ENABLE_FEATURE_HDPARM_GET_IDENTITY
static const char * const cfg_str[] = static const char *const cfg_str[] = {
{ "", "HardSect", "SoftSect", "NotMFM", "", "HardSect", "SoftSect", "NotMFM",
"HdSw>15uSec", "SpinMotCtl", "Fixed", "Removeable", "HdSw>15uSec", "SpinMotCtl", "Fixed", "Removeable",
"DTR<=5Mbs", "DTR>5Mbs", "DTR>10Mbs", "RotSpdTol>.5%", "DTR<=5Mbs", "DTR>5Mbs", "DTR>10Mbs", "RotSpdTol>.5%",
"dStbOff", "TrkOff", "FmtGapReq", "nonMagnetic" "dStbOff", "TrkOff", "FmtGapReq", "nonMagnetic"
}; };
static const char * const BuffType[] = {"Unknown", "1Sect", "DualPort", "DualPortCache"}; static const char *const BuffType[] = {
"Unknown", "1Sect", "DualPort", "DualPortCache"
};
static void dump_identity(const struct hd_driveid *id) static void dump_identity(const struct hd_driveid *id)
{ {
@ -1930,7 +1932,8 @@ static void parse_xfermode(int flag, smallint *get, smallint *set, int *value)
} }
/*------- getopt short options --------*/ /*------- getopt short options --------*/
static const char hdparm_options[] = "gfu::n::p:r::m::c::k::a::B:tTh" static const char hdparm_options[] ALIGN1 =
"gfu::n::p:r::m::c::k::a::B:tTh"
USE_FEATURE_HDPARM_GET_IDENTITY("iI") USE_FEATURE_HDPARM_GET_IDENTITY("iI")
USE_FEATURE_HDPARM_HDIO_GETSET_DMA("d::") USE_FEATURE_HDPARM_HDIO_GETSET_DMA("d::")
#ifdef HDIO_DRIVE_CMD #ifdef HDIO_DRIVE_CMD

View file

@ -450,12 +450,12 @@ static void cap_cur_fline(int nlines)
} }
} }
static const char controls[] = static const char controls[] ALIGN1 =
/* NUL: never encountered; TAB: not converted */ /* NUL: never encountered; TAB: not converted */
/**/"\x01\x02\x03\x04\x05\x06\x07\x08" "\x0a\x0b\x0c\x0d\x0e\x0f" /**/"\x01\x02\x03\x04\x05\x06\x07\x08" "\x0a\x0b\x0c\x0d\x0e\x0f"
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
"\x7f\x9b"; /* DEL and infamous Meta-ESC :( */ "\x7f\x9b"; /* DEL and infamous Meta-ESC :( */
static const char ctrlconv[] = static const char ctrlconv[] ALIGN1 =
/* '\n': it's a former NUL - subst with '@', not 'J' */ /* '\n': it's a former NUL - subst with '@', not 'J' */
"\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x40\x4b\x4c\x4d\x4e\x4f" "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x40\x4b\x4c\x4d\x4e\x4f"
"\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"; "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f";

View file

@ -23,15 +23,15 @@ typedef struct {
#define UL unsigned long #define UL unsigned long
static const char default_format[] = "real\t%E\nuser\t%u\nsys\t%T"; static const char default_format[] ALIGN1 = "real\t%E\nuser\t%u\nsys\t%T";
/* The output format for the -p option .*/ /* The output format for the -p option .*/
static const char posix_format[] = "real %e\nuser %U\nsys %S"; static const char posix_format[] ALIGN1 = "real %e\nuser %U\nsys %S";
/* Format string for printing all statistics verbosely. /* Format string for printing all statistics verbosely.
Keep this output to 24 lines so users on terminals can see it all.*/ Keep this output to 24 lines so users on terminals can see it all.*/
static const char long_format[] = static const char long_format[] ALIGN1 =
"\tCommand being timed: \"%C\"\n" "\tCommand being timed: \"%C\"\n"
"\tUser time (seconds): %U\n" "\tUser time (seconds): %U\n"
"\tSystem time (seconds): %S\n" "\tSystem time (seconds): %S\n"

View file

@ -3613,12 +3613,12 @@ static int obj_gpl_license(struct obj_file *f, const char **license)
* linux/include/linux/module.h. Checking for leading "GPL" will not * linux/include/linux/module.h. Checking for leading "GPL" will not
* work, somebody will use "GPL sucks, this is proprietary". * work, somebody will use "GPL sucks, this is proprietary".
*/ */
static const char * const gpl_licenses[] = { static const char *const gpl_licenses[] = {
"GPL", "GPL",
"GPL v2", "GPL v2",
"GPL and additional rights", "GPL and additional rights",
"Dual BSD/GPL", "Dual BSD/GPL",
"Dual MPL/GPL", "Dual MPL/GPL"
}; };
sec = obj_find_section(f, ".modinfo"); sec = obj_find_section(f, ".modinfo");
@ -3681,7 +3681,8 @@ static void set_tainted(struct obj_file *f, int fd, char *m_name,
/* Check if loading this module will taint the kernel. */ /* Check if loading this module will taint the kernel. */
static void check_tainted_module(struct obj_file *f, char *m_name) static void check_tainted_module(struct obj_file *f, char *m_name)
{ {
static const char tainted_file[] = TAINT_FILENAME; static const char tainted_file[] ALIGN1 = TAINT_FILENAME;
int fd, kernel_has_tainted; int fd, kernel_has_tainted;
const char *ptr; const char *ptr;
@ -3750,7 +3751,8 @@ static void
add_ksymoops_symbols(struct obj_file *f, const char *filename, add_ksymoops_symbols(struct obj_file *f, const char *filename,
const char *m_name) const char *m_name)
{ {
static const char symprefix[] = "__insmod_"; static const char symprefix[] ALIGN1 = "__insmod_";
struct obj_section *sec; struct obj_section *sec;
struct obj_symbol *sym; struct obj_symbol *sym;
char *name, *absolute_filename; char *name, *absolute_filename;

View file

@ -46,7 +46,7 @@ static int sockfd; /* active socket descriptor */
static smallint hw_set; /* flag if hw-type was set (-H) */ static smallint hw_set; /* flag if hw-type was set (-H) */
static const char *device = ""; /* current device */ static const char *device = ""; /* current device */
static const char options[] = static const char options[] ALIGN1 =
"pub\0" "pub\0"
"priv\0" "priv\0"
"temp\0" "temp\0"

View file

@ -287,7 +287,7 @@ int ftp_send(ftp_host_info_t *server, FILE *control_stream,
#define FTPGETPUT_OPT_PORT 16 #define FTPGETPUT_OPT_PORT 16
#if ENABLE_FEATURE_FTPGETPUT_LONG_OPTIONS #if ENABLE_FEATURE_FTPGETPUT_LONG_OPTIONS
static const char ftpgetput_longopts[] = static const char ftpgetput_longopts[] ALIGN1 =
"continue\0" Required_argument "c" "continue\0" Required_argument "c"
"verbose\0" No_argument "v" "verbose\0" No_argument "v"
"username\0" Required_argument "u" "username\0" Required_argument "u"

View file

@ -98,8 +98,8 @@
# define PIPE_BUF 4096 # define PIPE_BUF 4096
#endif #endif
static const char default_path_httpd_conf[] = "/etc"; static const char default_path_httpd_conf[] ALIGN1 = "/etc";
static const char httpd_conf[] = "httpd.conf"; static const char httpd_conf[] ALIGN1 = "httpd.conf";
#define TIMEOUT 60 #define TIMEOUT 60
@ -202,9 +202,9 @@ struct globals {
ContentLength = -1; \ ContentLength = -1; \
} while (0) } while (0)
static const char request_GET[] = "GET"; /* size algorithmic optimize */ static const char request_GET[] ALIGN1 = "GET"; /* size algorithmic optimize */
static const char* const suffixTable [] = { static const char *const suffixTable[] = {
/* Warning: shorted equivalent suffix in one line must be first */ /* Warning: shorted equivalent suffix in one line must be first */
".htm.html", "text/html", ".htm.html", "text/html",
".jpg.jpeg", "image/jpeg", ".jpg.jpeg", "image/jpeg",
@ -288,7 +288,7 @@ static const HttpEnumString httpResponseNames[] = {
}; };
static const char RFC1123FMT[] = "%a, %d %b %Y %H:%M:%S GMT"; static const char RFC1123FMT[] ALIGN1 = "%a, %d %b %Y %H:%M:%S GMT";
#define STRNCASECMP(a, str) strncasecmp((a), (str), sizeof(str)-1) #define STRNCASECMP(a, str) strncasecmp((a), (str), sizeof(str)-1)
@ -1268,7 +1268,7 @@ static int sendCgi(const char *url,
* <cr><lf> pair here. We will output "200 OK" line * <cr><lf> pair here. We will output "200 OK" line
* if needed, but CGI still has to provide blank line * if needed, but CGI still has to provide blank line
* between header and body */ * between header and body */
static const char HTTP_200[] = "HTTP/1.0 200 OK\r\n"; static const char HTTP_200[] ALIGN1 = "HTTP/1.0 200 OK\r\n";
/* Must use safe_read, not full_read, because /* Must use safe_read, not full_read, because
* CGI may output a few first bytes and then wait * CGI may output a few first bytes and then wait
@ -1343,9 +1343,9 @@ static int sendCgi(const char *url,
static int sendFile(const char *url) static int sendFile(const char *url)
{ {
char * suffix; char * suffix;
int f; int f;
const char * const * table; const char *const *table;
const char * try_suffix; const char *try_suffix;
suffix = strrchr(url, '.'); suffix = strrchr(url, '.');

View file

@ -871,7 +871,7 @@ static int hw_null_address(const struct hwtype *hw, void *ap)
return 1; return 1;
} }
static const char TRext[] = "\0\0\0Ki\0Mi\0Gi\0Ti"; static const char TRext[] ALIGN1 = "\0\0\0Ki\0Mi\0Gi\0Ti";
static void print_bytes_scaled(unsigned long long ull, const char *end) static void print_bytes_scaled(unsigned long long ull, const char *end)
{ {
@ -1020,7 +1020,7 @@ static void ife_print(struct interface *ptr)
if (ptr->flags == 0) { if (ptr->flags == 0) {
printf("[NO FLAGS] "); printf("[NO FLAGS] ");
} else { } else {
static const char ife_print_flags_strs[] = static const char ife_print_flags_strs[] ALIGN1 =
"UP\0" "UP\0"
"BROADCAST\0" "BROADCAST\0"
"DEBUG\0" "DEBUG\0"
@ -1038,7 +1038,7 @@ static void ife_print(struct interface *ptr)
"DYNAMIC\0" "DYNAMIC\0"
#endif #endif
; ;
static const unsigned short ife_print_flags_mask[] = { static const unsigned short ife_print_flags_mask[] ALIGN2 = {
IFF_UP, IFF_UP,
IFF_BROADCAST, IFF_BROADCAST,
IFF_DEBUG, IFF_DEBUG,
@ -1051,9 +1051,9 @@ static void ife_print(struct interface *ptr)
IFF_ALLMULTI, IFF_ALLMULTI,
IFF_SLAVE, IFF_SLAVE,
IFF_MASTER, IFF_MASTER,
IFF_MULTICAST, IFF_MULTICAST
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
IFF_DYNAMIC, ,IFF_DYNAMIC
#endif #endif
}; };
const unsigned short *mask = ife_print_flags_mask; const unsigned short *mask = ife_print_flags_mask;

View file

@ -82,7 +82,7 @@ int iptunnel_main(int argc, char **argv)
int ip_main(int argc, char **argv); int ip_main(int argc, char **argv);
int ip_main(int argc, char **argv) int ip_main(int argc, char **argv)
{ {
static const char keywords[] = static const char keywords[] ALIGN1 =
USE_FEATURE_IP_ADDRESS("address\0") USE_FEATURE_IP_ADDRESS("address\0")
USE_FEATURE_IP_ROUTE("route\0") USE_FEATURE_IP_ROUTE("route\0")
USE_FEATURE_IP_LINK("link\0") USE_FEATURE_IP_LINK("link\0")

View file

@ -63,7 +63,7 @@ int get_prefix(unsigned long netmask);
#define SILENT 0x20 #define SILENT 0x20
#if ENABLE_FEATURE_IPCALC_LONG_OPTIONS #if ENABLE_FEATURE_IPCALC_LONG_OPTIONS
static const char ipcalc_longopts[] = static const char ipcalc_longopts[] ALIGN1 =
"netmask\0" No_argument "m" "netmask\0" No_argument "m"
"broadcast\0" No_argument "b" "broadcast\0" No_argument "b"
"network\0" No_argument "n" "network\0" No_argument "n"

View file

@ -26,7 +26,7 @@ void ip_parse_common_args(int *argcp, char ***argvp)
{ {
int argc = *argcp; int argc = *argcp;
char **argv = *argvp; char **argv = *argvp;
static const char ip_common_commands[] = static const char ip_common_commands[] ALIGN1 =
"-family\0""inet\0""inet6\0""link\0" "-family\0""inet\0""inet6\0""link\0"
"-4\0""-6\0""-0\0""-oneline\0"; "-4\0""-6\0""-0\0""-oneline\0";
enum { enum {

View file

@ -412,7 +412,7 @@ static void ipaddr_reset_filter(int _oneline)
/* Return value becomes exitcode. It's okay to not return at all */ /* Return value becomes exitcode. It's okay to not return at all */
int ipaddr_list_or_flush(int argc, char **argv, int flush) int ipaddr_list_or_flush(int argc, char **argv, int flush)
{ {
static const char option[] = "to\0""scope\0""up\0""label\0""dev\0"; static const char option[] ALIGN1 = "to\0""scope\0""up\0""label\0""dev\0";
struct nlmsg_list *linfo = NULL; struct nlmsg_list *linfo = NULL;
struct nlmsg_list *ainfo = NULL; struct nlmsg_list *ainfo = NULL;
@ -599,7 +599,7 @@ static int default_scope(inet_prefix *lcl)
/* Return value becomes exitcode. It's okay to not return at all */ /* Return value becomes exitcode. It's okay to not return at all */
static int ipaddr_modify(int cmd, int argc, char **argv) static int ipaddr_modify(int cmd, int argc, char **argv)
{ {
static const char option[] = static const char option[] ALIGN1 =
"peer\0""remote\0""broadcast\0""brd\0" "peer\0""remote\0""broadcast\0""brd\0"
"anycast\0""scope\0""dev\0""label\0""local\0"; "anycast\0""scope\0""dev\0""label\0""local\0";
struct rtnl_handle rth; struct rtnl_handle rth;
@ -768,7 +768,7 @@ static int ipaddr_modify(int cmd, int argc, char **argv)
/* Return value becomes exitcode. It's okay to not return at all */ /* Return value becomes exitcode. It's okay to not return at all */
int do_ipaddr(int argc, char **argv) int do_ipaddr(int argc, char **argv)
{ {
static const char commands[] = static const char commands[] ALIGN1 =
"add\0""delete\0""list\0""show\0""lst\0""flush\0"; "add\0""delete\0""list\0""show\0""lst\0""flush\0";
int command_num = 2; /* default command is list */ int command_num = 2; /* default command is list */

View file

@ -171,7 +171,7 @@ static int do_set(int argc, char **argv)
struct ifreq ifr0, ifr1; struct ifreq ifr0, ifr1;
char *newname = NULL; char *newname = NULL;
int htype, halen; int htype, halen;
static const char keywords[] = static const char keywords[] ALIGN1 =
"up\0""down\0""name\0""mtu\0""multicast\0""arp\0""addr\0""dev\0" "up\0""down\0""name\0""mtu\0""multicast\0""arp\0""addr\0""dev\0"
"on\0""off\0"; "on\0""off\0";
enum { ARG_up = 1, ARG_down, ARG_name, ARG_mtu, ARG_multicast, ARG_arp, enum { ARG_up = 1, ARG_down, ARG_name, ARG_mtu, ARG_multicast, ARG_arp,
@ -275,7 +275,7 @@ static int ipaddr_list_link(int argc, char **argv)
/* Return value becomes exitcode. It's okay to not return at all */ /* Return value becomes exitcode. It's okay to not return at all */
int do_iplink(int argc, char **argv) int do_iplink(int argc, char **argv)
{ {
static const char keywords[] = static const char keywords[] ALIGN1 =
"set\0""show\0""lst\0""list\0"; "set\0""show\0""lst\0""list\0";
smalluint key; smalluint key;
if (argc <= 0) if (argc <= 0)

View file

@ -294,7 +294,7 @@ static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED,
/* Return value becomes exitcode. It's okay to not return at all */ /* Return value becomes exitcode. It's okay to not return at all */
static int iproute_modify(int cmd, unsigned flags, int argc, char **argv) static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
{ {
static const char keywords[] = static const char keywords[] ALIGN1 =
"src\0""via\0""mtu\0""lock\0""protocol\0"USE_FEATURE_IP_RULE("table\0") "src\0""via\0""mtu\0""lock\0""protocol\0"USE_FEATURE_IP_RULE("table\0")
"dev\0""oif\0""to\0"; "dev\0""oif\0""to\0";
enum { enum {
@ -489,7 +489,7 @@ static int rtnl_rtcache_request(struct rtnl_handle *rth, int family)
static void iproute_flush_cache(void) static void iproute_flush_cache(void)
{ {
static const char fn[] = "/proc/sys/net/ipv4/route/flush"; static const char fn[] ALIGN1 = "/proc/sys/net/ipv4/route/flush";
int flush_fd = open_or_warn(fn, O_WRONLY); int flush_fd = open_or_warn(fn, O_WRONLY);
if (flush_fd < 0) { if (flush_fd < 0) {
@ -517,7 +517,7 @@ static int iproute_list_or_flush(int argc, char **argv, int flush)
struct rtnl_handle rth; struct rtnl_handle rth;
char *id = NULL; char *id = NULL;
char *od = NULL; char *od = NULL;
static const char keywords[] = static const char keywords[] ALIGN1 =
"protocol\0""all\0""dev\0""oif\0""iif\0""via\0""table\0""cache\0" /*all*/ "protocol\0""all\0""dev\0""oif\0""iif\0""via\0""table\0""cache\0" /*all*/
"from\0""root\0""match\0""exact\0""to\0"/*root match exact*/; "from\0""root\0""match\0""exact\0""to\0"/*root match exact*/;
enum { enum {
@ -679,7 +679,7 @@ static int iproute_get(int argc, char **argv)
char *odev = NULL; char *odev = NULL;
bool connected = 0; bool connected = 0;
bool from_ok = 0; bool from_ok = 0;
static const char options[] = static const char options[] ALIGN1 =
"from\0""iif\0""oif\0""dev\0""notify\0""connected\0""to\0"; "from\0""iif\0""oif\0""dev\0""notify\0""connected\0""to\0";
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
@ -824,7 +824,7 @@ static int iproute_get(int argc, char **argv)
/* Return value becomes exitcode. It's okay to not return at all */ /* Return value becomes exitcode. It's okay to not return at all */
int do_iproute(int argc, char **argv) int do_iproute(int argc, char **argv)
{ {
static const char ip_route_commands[] = static const char ip_route_commands[] ALIGN1 =
/*0-3*/ "add\0""append\0""change\0""chg\0" /*0-3*/ "add\0""append\0""change\0""chg\0"
/*4-7*/ "delete\0""get\0""list\0""show\0" /*4-7*/ "delete\0""get\0""list\0""show\0"
/*8..*/ "prepend\0""replace\0""test\0""flush\0"; /*8..*/ "prepend\0""replace\0""test\0""flush\0";

View file

@ -187,7 +187,7 @@ static int iprule_list(int argc, char **argv)
/* Return value becomes exitcode. It's okay to not return at all */ /* Return value becomes exitcode. It's okay to not return at all */
static int iprule_modify(int cmd, int argc, char **argv) static int iprule_modify(int cmd, int argc, char **argv)
{ {
static const char keywords[] = static const char keywords[] ALIGN1 =
"from\0""to\0""preference\0""order\0""priority\0" "from\0""to\0""preference\0""order\0""priority\0"
"tos\0""fwmark\0""realms\0""table\0""lookup\0""dev\0" "tos\0""fwmark\0""realms\0""table\0""lookup\0""dev\0"
"iif\0""nat\0""map-to\0""type\0""help\0"; "iif\0""nat\0""map-to\0""type\0""help\0";
@ -313,7 +313,7 @@ static int iprule_modify(int cmd, int argc, char **argv)
/* Return value becomes exitcode. It's okay to not return at all */ /* Return value becomes exitcode. It's okay to not return at all */
int do_iprule(int argc, char **argv) int do_iprule(int argc, char **argv)
{ {
static const char ip_rule_commands[] = static const char ip_rule_commands[] ALIGN1 =
"add\0""delete\0""list\0""show\0"; "add\0""delete\0""list\0""show\0";
int cmd = 2; /* list */ int cmd = 2; /* list */

View file

@ -128,7 +128,7 @@ static int do_del_ioctl(const char *basedev, struct ip_tunnel_parm *p)
/* Dies on error */ /* Dies on error */
static void parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p) static void parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
{ {
static const char keywords[] = static const char keywords[] ALIGN1 =
"mode\0""ipip\0""ip/ip\0""gre\0""gre/ip\0""sit\0""ipv6/ip\0" "mode\0""ipip\0""ip/ip\0""gre\0""gre/ip\0""sit\0""ipv6/ip\0"
"key\0""ikey\0""okey\0""seq\0""iseq\0""oseq\0" "key\0""ikey\0""okey\0""seq\0""iseq\0""oseq\0"
"csum\0""icsum\0""ocsum\0""nopmtudisc\0""pmtudisc\0" "csum\0""icsum\0""ocsum\0""nopmtudisc\0""pmtudisc\0"
@ -519,7 +519,7 @@ static int do_show(int argc, char **argv)
/* Return value becomes exitcode. It's okay to not return at all */ /* Return value becomes exitcode. It's okay to not return at all */
int do_iptunnel(int argc, char **argv) int do_iptunnel(int argc, char **argv)
{ {
static const char keywords[] = static const char keywords[] ALIGN1 =
"add\0""change\0""delete\0""show\0""list\0""lst\0"; "add\0""change\0""delete\0""show\0""list\0""lst\0";
enum { ARG_add = 0, ARG_change, ARG_del, ARG_show, ARG_list, ARG_lst }; enum { ARG_add = 0, ARG_change, ARG_del, ARG_show, ARG_list, ARG_lst };
int key; int key;

View file

@ -131,7 +131,7 @@ unsigned ll_index_to_flags(int idx)
return 0; return 0;
} }
int xll_name_to_index(const char * const name) int xll_name_to_index(const char *const name)
{ {
int ret = 0; int ret = 0;
int sock_fd; int sock_fd;

View file

@ -4,7 +4,7 @@
int ll_remember_index(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); int ll_remember_index(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
int ll_init_map(struct rtnl_handle *rth); int ll_init_map(struct rtnl_handle *rth);
int xll_name_to_index(const char * const name); int xll_name_to_index(const char *const name);
const char *ll_index_to_name(int idx); const char *ll_index_to_name(int idx);
const char *ll_idx_n2a(int idx, char *buf); const char *ll_idx_n2a(int idx, char *buf);
/* int ll_index_to_type(int idx); */ /* int ll_index_to_type(int idx); */

View file

@ -51,7 +51,7 @@ const char *rtnl_rtntype_n2a(int id, char *buf, int len)
int rtnl_rtntype_a2n(int *id, char *arg) int rtnl_rtntype_a2n(int *id, char *arg)
{ {
static const char keywords[] = static const char keywords[] ALIGN1 =
"local\0""nat\0""broadcast\0""brd\0""anycast\0" "local\0""nat\0""broadcast\0""brd\0""anycast\0"
"multicast\0""prohibit\0""unreachable\0""blackhole\0" "multicast\0""prohibit\0""unreachable\0""blackhole\0"
"xresolve\0""unicast\0""throw\0"; "xresolve\0""unicast\0""throw\0";

View file

@ -47,8 +47,7 @@ enum {
TCP_CLOSING /* now a valid state */ TCP_CLOSING /* now a valid state */
}; };
static const char * const tcp_state[] = static const char *const tcp_state[] = {
{
"", "",
"ESTABLISHED", "ESTABLISHED",
"SYN_SENT", "SYN_SENT",

View file

@ -73,7 +73,7 @@
#define HOST_FLAG 2 #define HOST_FLAG 2
/* We remap '-' to '#' to avoid problems with getopt. */ /* We remap '-' to '#' to avoid problems with getopt. */
static const char tbl_hash_net_host[] = static const char tbl_hash_net_host[] ALIGN1 =
"\007\001#net\0" "\007\001#net\0"
/* "\010\002#host\0" */ /* "\010\002#host\0" */
"\007\002#host" /* Since last, we can save a byte. */ "\007\002#host" /* Since last, we can save a byte. */
@ -96,7 +96,7 @@ static const char tbl_hash_net_host[] =
#define KW_IPVx_DYN 042 #define KW_IPVx_DYN 042
#define KW_IPVx_REINSTATE 043 #define KW_IPVx_REINSTATE 043
static const char tbl_ipvx[] = static const char tbl_ipvx[] ALIGN1 =
/* 020 is the "takes an arg" bit */ /* 020 is the "takes an arg" bit */
#if HAVE_NEW_ADDRT #if HAVE_NEW_ADDRT
"\011\020metric\0" "\011\020metric\0"
@ -438,7 +438,7 @@ static void INET6_setroute(int action, char **args)
} }
#endif #endif
static const unsigned int flagvals[] = { /* Must agree with flagchars[]. */ static const unsigned flagvals[] = { /* Must agree with flagchars[]. */
RTF_GATEWAY, RTF_GATEWAY,
RTF_HOST, RTF_HOST,
RTF_REINSTATE, RTF_REINSTATE,
@ -454,7 +454,8 @@ static const unsigned int flagvals[] = { /* Must agree with flagchars[]. */
#define IPV4_MASK (RTF_GATEWAY|RTF_HOST|RTF_REINSTATE|RTF_DYNAMIC|RTF_MODIFIED) #define IPV4_MASK (RTF_GATEWAY|RTF_HOST|RTF_REINSTATE|RTF_DYNAMIC|RTF_MODIFIED)
#define IPV6_MASK (RTF_GATEWAY|RTF_HOST|RTF_DEFAULT|RTF_ADDRCONF|RTF_CACHE) #define IPV6_MASK (RTF_GATEWAY|RTF_HOST|RTF_DEFAULT|RTF_ADDRCONF|RTF_CACHE)
static const char flagchars[] = /* Must agree with flagvals[]. */ /* Must agree with flagvals[]. */
static const char flagchars[] ALIGN1 =
"GHRDM" "GHRDM"
#if ENABLE_FEATURE_IPV6 #if ENABLE_FEATURE_IPV6
"DAC" "DAC"
@ -631,11 +632,12 @@ static void INET6_displayroutes(int noresolve)
#define ROUTE_OPT_INET6 0x08 /* Not an actual option. See below. */ #define ROUTE_OPT_INET6 0x08 /* Not an actual option. See below. */
/* 1st byte is offset to next entry offset. 2nd byte is return value. */ /* 1st byte is offset to next entry offset. 2nd byte is return value. */
static const char tbl_verb[] = /* 2nd byte matches RTACTION_* code */ /* 2nd byte matches RTACTION_* code */
static const char tbl_verb[] ALIGN1 =
"\006\001add\0" "\006\001add\0"
"\006\002del\0" "\006\002del\0"
/* "\011\002delete\0" */ /* "\011\002delete\0" */
"\010\002delete" /* Since last, we can save a byte. */ "\010\002delete" /* Since it's last, we can save a byte. */
; ;
int route_main(int argc, char **argv); int route_main(int argc, char **argv);

View file

@ -123,7 +123,7 @@ int slattach_main(int argc, char **argv);
int slattach_main(int argc, char **argv) int slattach_main(int argc, char **argv)
{ {
/* Line discipline code table */ /* Line discipline code table */
static const char proto_names[] = static const char proto_names[] ALIGN1 =
"slip\0" /* 0 */ "slip\0" /* 0 */
"cslip\0" /* 1 */ "cslip\0" /* 1 */
"slip6\0" /* 2 */ "slip6\0" /* 2 */

View file

@ -353,7 +353,7 @@ static void putiac_naws(byte c, int x, int y)
} }
#endif #endif
static char const escapecharis[] = "\r\nEscape character is "; static char const escapecharis[] ALIGN1 = "\r\nEscape character is ";
static void setConMode(void) static void setConMode(void)
{ {

View file

@ -278,7 +278,7 @@ static int tftp( USE_GETPUT(const int cmd,)
"unknown transfer id", "unknown transfer id",
"file already exists", "file already exists",
"no such user", "no such user",
"bad option", "bad option"
}; };
const char *msg = ""; const char *msg = "";
@ -309,7 +309,7 @@ static int tftp( USE_GETPUT(const int cmd,)
/* htons can be impossible to use in const initializer: */ /* htons can be impossible to use in const initializer: */
/*static const uint16_t error_8[2] = { htons(TFTP_ERROR), htons(8) };*/ /*static const uint16_t error_8[2] = { htons(TFTP_ERROR), htons(8) };*/
/* thus we open-code big-endian layout */ /* thus we open-code big-endian layout */
static const char error_8[4] = { 0,TFTP_ERROR, 0,8 }; static const uint8_t error_8[4] = { 0,TFTP_ERROR, 0,8 };
xsendto(socketfd, error_8, 4, &peer_lsa->sa, peer_lsa->len); xsendto(socketfd, error_8, 4, &peer_lsa->sa, peer_lsa->len);
bb_error_msg("server proposes bad blksize %d, exiting", blksize); bb_error_msg("server proposes bad blksize %d, exiting", blksize);
goto ret; goto ret;

View file

@ -700,7 +700,7 @@ send_probe(int seq, int ttl)
static inline const char * static inline const char *
pr_type(unsigned char t) pr_type(unsigned char t)
{ {
static const char * const ttab[] = { static const char *const ttab[] = {
"Echo Reply", "ICMP 1", "ICMP 2", "Dest Unreachable", "Echo Reply", "ICMP 1", "ICMP 2", "Dest Unreachable",
"Source Quench", "Redirect", "ICMP 6", "ICMP 7", "Source Quench", "Redirect", "ICMP 6", "ICMP 7",
"Echo", "Router Advert", "Router Solicit", "Time Exceeded", "Echo", "Router Advert", "Router Solicit", "Time Exceeded",

View file

@ -6,4 +6,6 @@
#include "common.h" #include "common.h"
const uint8_t MAC_BCAST_ADDR[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; const uint8_t MAC_BCAST_ADDR[6] ALIGN2 = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

View file

@ -180,7 +180,7 @@ int udhcpc_main(int argc, char **argv)
OPT_v = 1 << 17, OPT_v = 1 << 17,
}; };
#if ENABLE_GETOPT_LONG #if ENABLE_GETOPT_LONG
static const char udhcpc_longopts[] = static const char udhcpc_longopts[] ALIGN1 =
"clientid\0" Required_argument "c" "clientid\0" Required_argument "c"
"clientid-none\0" No_argument "C" "clientid-none\0" No_argument "C"
"vendorclass\0" Required_argument "V" "vendorclass\0" Required_argument "V"

View file

@ -24,7 +24,7 @@ int dumpleases_main(int argc, char **argv)
OPT_f = 0x4, // -f OPT_f = 0x4, // -f
}; };
#if ENABLE_GETOPT_LONG #if ENABLE_GETOPT_LONG
static const char dumpleases_longopts[] = static const char dumpleases_longopts[] ALIGN1 =
"absolute\0" No_argument "a" "absolute\0" No_argument "a"
"remaining\0" No_argument "r" "remaining\0" No_argument "r"
"file\0" Required_argument "f" "file\0" Required_argument "f"

View file

@ -52,7 +52,7 @@ const struct dhcp_option dhcp_options[] = {
}; };
/* Lengths of the different option types */ /* Lengths of the different option types */
const unsigned char option_lengths[] = { const unsigned char option_lengths[] ALIGN1 = {
[OPTION_IP] = 4, [OPTION_IP] = 4,
[OPTION_IP_PAIR] = 8, [OPTION_IP_PAIR] = 8,
[OPTION_BOOLEAN] = 1, [OPTION_BOOLEAN] = 1,

View file

@ -63,7 +63,7 @@ static const char *xfind_str(const char *table, const char *str)
return table - 1; return table - 1;
} }
static const char cmds[] = { static const char cmds[] ALIGN1 = {
4, ADD_VLAN_CMD, 7, 4, ADD_VLAN_CMD, 7,
'a', 'd', 'd', 0, 'a', 'd', 'd', 0,
3, DEL_VLAN_CMD, 7, 3, DEL_VLAN_CMD, 7,
@ -85,7 +85,7 @@ static const char cmds[] = {
'm', 'a', 'p', 0, 'm', 'a', 'p', 0,
}; };
static const char name_types[] = { static const char name_types[] ALIGN1 = {
VLAN_NAME_TYPE_PLUS_VID, 16, VLAN_NAME_TYPE_PLUS_VID, 16,
'V', 'L', 'A', 'N', 'V', 'L', 'A', 'N',
'_', 'P', 'L', 'U', 'S', '_', 'V', 'I', 'D', '_', 'P', 'L', 'U', 'S', '_', 'V', 'I', 'D',
@ -104,7 +104,7 @@ static const char name_types[] = {
'_', 'N', 'O', '_', 'P', 'A', 'D', 0, '_', 'N', 'O', '_', 'P', 'A', 'D', 0,
}; };
static const char conf_file_name[] = "/proc/net/vlan/config"; static const char conf_file_name[] ALIGN1 = "/proc/net/vlan/config";
int vconfig_main(int argc, char **argv); int vconfig_main(int argc, char **argv);
int vconfig_main(int argc, char **argv) int vconfig_main(int argc, char **argv)

View file

@ -114,7 +114,7 @@ int wget_main(int argc, char **argv)
bool use_proxy = 1; /* Use proxies if env vars are set */ bool use_proxy = 1; /* Use proxies if env vars are set */
const char *proxy_flag = "on"; /* Use proxies if env vars are set */ const char *proxy_flag = "on"; /* Use proxies if env vars are set */
const char *user_agent = "Wget";/* "User-Agent" header field */ const char *user_agent = "Wget";/* "User-Agent" header field */
static const char keywords[] = static const char keywords[] ALIGN1 =
"content-length\0""transfer-encoding\0""chunked\0""location\0"; "content-length\0""transfer-encoding\0""chunked\0""location\0";
enum { enum {
KEY_content_length = 1, KEY_transfer_encoding, KEY_chunked, KEY_location KEY_content_length = 1, KEY_transfer_encoding, KEY_chunked, KEY_location
@ -131,7 +131,7 @@ int wget_main(int argc, char **argv)
WGET_OPT_HEADER = 0x100, WGET_OPT_HEADER = 0x100,
}; };
#if ENABLE_FEATURE_WGET_LONG_OPTIONS #if ENABLE_FEATURE_WGET_LONG_OPTIONS
static const char wget_longopts[] = static const char wget_longopts[] ALIGN1 =
/* name, has_arg, val */ /* name, has_arg, val */
"continue\0" No_argument "c" "continue\0" No_argument "c"
"spider\0" No_argument "s" "spider\0" No_argument "s"
@ -539,7 +539,7 @@ static void parse_url(char *src_url, struct host_info *h)
p = strchr(h->host, '#'); if (!sp || (p && sp > p)) sp = p; p = strchr(h->host, '#'); if (!sp || (p && sp > p)) sp = p;
if (!sp) { if (!sp) {
/* must be writable because of bb_get_last_path_component() */ /* must be writable because of bb_get_last_path_component() */
static char nullstr[] = ""; static char nullstr[] ALIGN1 = "";
h->path = nullstr; h->path = nullstr;
} else if (*sp == '/') { } else if (*sp == '/') {
*sp = '\0'; *sp = '\0';

View file

@ -36,7 +36,7 @@ static const char *const proc_name[] = {
"net/dev", "net/dev",
"meminfo", "meminfo",
"diskstats", "diskstats",
"sys/fs/file-nr", "sys/fs/file-nr"
}; };
struct globals { struct globals {
@ -754,7 +754,7 @@ static void collect_info(s_stat *s)
typedef s_stat* init_func(const char *param); typedef s_stat* init_func(const char *param);
static const char options[] = "ncmsfixptbdr"; static const char options[] ALIGN1 = "ncmsfixptbdr";
static init_func *const init_functions[] = { static init_func *const init_functions[] = {
init_if, init_if,
init_cpu, init_cpu,
@ -767,7 +767,7 @@ static init_func *const init_functions[] = {
init_time, init_time,
init_blk, init_blk,
init_delay, init_delay,
init_cr, init_cr
}; };
int nmeter_main(int argc, char **argv); int nmeter_main(int argc, char **argv);

Some files were not shown because too many files have changed in this diff Show more