aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
commit6ca409e0e4c198fe3081346eebbae3f068fe605a (patch)
tree060cb05d99220a1eda399194d1209c269f0e8cd8 /miscutils
parent4185548984357df91311f30c8e43d95f33922576 (diff)
downloadbusybox-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.gz
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
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/adjtimex.c13
-rw-r--r--miscutils/devfsd.c26
-rw-r--r--miscutils/hdparm.c19
-rw-r--r--miscutils/less.c4
-rw-r--r--miscutils/time.c6
5 files changed, 36 insertions, 32 deletions
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c
index 9f8227cf0..1e6d15fa7 100644
--- a/miscutils/adjtimex.c
+++ b/miscutils/adjtimex.c
@@ -14,7 +14,10 @@
#include "libbb.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_PPSFREQ, "PPSFREQ" },
{ STA_PPSTIME, "PPSTIME" },
@@ -28,15 +31,17 @@ static const struct {int bit; const char *name;} statlist[] = {
{ STA_PPSWANDER, "PPSWANDER" },
{ STA_PPSERROR, "PPSERROR" },
{ STA_CLOCKERR, "CLOCKERR" },
- { 0, NULL } };
+ { 0, NULL }
+};
-static const char * const ret_code_descript[] = {
+static const char *const ret_code_descript[] = {
"clock synchronized",
"insert leap second",
"delete leap second",
"leap second in progress",
"leap second has occurred",
- "clock not synchronized" };
+ "clock not synchronized"
+};
int adjtimex_main(int argc, char **argv);
int adjtimex_main(int argc, char **argv)
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c
index 848f2b3ea..6b31f368a 100644
--- a/miscutils/devfsd.c
+++ b/miscutils/devfsd.c
@@ -245,12 +245,10 @@ static struct config_entry_struct *last_config = NULL;
static char *mount_point = NULL;
static volatile int caught_signal = FALSE;
static volatile int caught_sighup = FALSE;
-static struct initial_symlink_struct
-{
+static struct initial_symlink_struct {
const char *dest;
const char *name;
-} initial_symlinks[] =
-{
+} initial_symlinks[] = {
{"/proc/self/fd", "fd"},
{"fd/0", "stdin"},
{"fd/1", "stdout"},
@@ -258,12 +256,10 @@ static struct initial_symlink_struct
{NULL, NULL},
};
-static struct event_type
-{
+static struct event_type {
unsigned int type; /* The DEVFSD_NOTIFY_* value */
const char *config_name; /* The name used in the config file */
-} event_types[] =
-{
+} event_types[] = {
{DEVFSD_NOTIFY_REGISTERED, "REGISTER"},
{DEVFSD_NOTIFY_UNREGISTERED, "UNREGISTER"},
{DEVFSD_NOTIFY_ASYNC_OPEN, "ASYNC_OPEN"},
@@ -277,10 +273,10 @@ static struct event_type
/* Busybox messages */
-static const char * const bb_msg_proto_rev = "protocol revision";
-static const char * const bb_msg_bad_config = "bad %s config file: %s";
-static const char * const bb_msg_small_buffer = "buffer too small";
-static const char * const bb_msg_variable_not_found = "variable: %s not found";
+static const char bb_msg_proto_rev[] ALIGN1 = "protocol revision";
+static const char bb_msg_bad_config[] ALIGN1 = "bad %s config file: %s";
+static const char bb_msg_small_buffer[] ALIGN1 = "buffer too small";
+static const char bb_msg_variable_not_found[] ALIGN1 = "variable: %s not found";
/* Busybox stuff */
#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() */
- 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",
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)
bb_error_msg_and_die("%s mismatch!", bb_msg_proto_rev);
exit(EXIT_SUCCESS); /* -v */
@@ -509,7 +505,7 @@ static void process_config_line(const char *line, unsigned long *event_mask)
int i;
/* !!!! Only Uppercase Keywords in devsfd.conf */
- static const char options[] =
+ static const char options[] ALIGN1 =
"CLEAR_CONFIG\0""INCLUDE\0""OPTIONAL_INCLUDE\0"
"RESTORE\0""PERMISSIONS\0""MODLOAD\0""EXECUTE\0"
"COPY\0""IGNORE\0""MKOLDCOMPAT\0""MKNEWCOMPAT\0"
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index 98cc04fd3..484c97061 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -128,7 +128,7 @@
#define CDROM 0x0005
#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 */
"Sequential-access device", /* word 0, bits 12-8 = 01 */
"Printer", /* word 0, bits 12-8 = 02 */
@@ -163,7 +163,7 @@ static const char * const pkt_str[] = {
"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 */
"hard sectored", /* bit 1 */
"soft sectored", /* bit 2 */
@@ -326,7 +326,7 @@ static const char actual_ver[MINOR_MAX+2] = {
#define NUM_CMD_FEAT_STR 48
#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 */
"NOP cmd", /* word 82 bit 14 */
"READ BUFFER cmd", /* word 82 bit 13 */
@@ -413,7 +413,7 @@ void identify_from_stdin(void);
#define SECU_LEVEL 0x0010
#define NUM_SECU_STR 6
#if ENABLE_FEATURE_HDPARM_GET_IDENTITY
-static const char * const secu_str[] = {
+static const char *const secu_str[] = {
"supported", /* word 128, bit 0 */
"enabled", /* word 128, bit 1 */
"locked", /* word 128, bit 2 */
@@ -1096,14 +1096,16 @@ static unsigned long hwif_irq;
// Too bad, really.
#if ENABLE_FEATURE_HDPARM_GET_IDENTITY
-static const char * const cfg_str[] =
-{ "", "HardSect", "SoftSect", "NotMFM",
+static const char *const cfg_str[] = {
+ "", "HardSect", "SoftSect", "NotMFM",
"HdSw>15uSec", "SpinMotCtl", "Fixed", "Removeable",
"DTR<=5Mbs", "DTR>5Mbs", "DTR>10Mbs", "RotSpdTol>.5%",
"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)
{
@@ -1930,7 +1932,8 @@ static void parse_xfermode(int flag, smallint *get, smallint *set, int *value)
}
/*------- 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_HDIO_GETSET_DMA("d::")
#ifdef HDIO_DRIVE_CMD
diff --git a/miscutils/less.c b/miscutils/less.c
index a6649c5ca..046a3c459 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -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 */
/**/"\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"
"\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' */
"\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";
diff --git a/miscutils/time.c b/miscutils/time.c
index 9b7db662a..e8473f702 100644
--- a/miscutils/time.c
+++ b/miscutils/time.c
@@ -23,15 +23,15 @@ typedef struct {
#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 .*/
-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.
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"
"\tUser time (seconds): %U\n"
"\tSystem time (seconds): %S\n"