aboutsummaryrefslogtreecommitdiff
path: root/editors
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 /editors
parent4185548984357df91311f30c8e43d95f33922576 (diff)
downloadbusybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.gz
busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.bz2
busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.zip
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 'editors')
-rw-r--r--editors/awk.c37
-rw-r--r--editors/cmp.c8
-rw-r--r--editors/diff.c2
-rw-r--r--editors/sed.c2
-rw-r--r--editors/vi.c18
5 files changed, 33 insertions, 34 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 752c73e7e..4ec3d4652 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -263,7 +263,7 @@ enum {
263 263
264#define OC_B OC_BUILTIN 264#define OC_B OC_BUILTIN
265 265
266static const char tokenlist[] = 266static const char tokenlist[] ALIGN1 =
267 "\1(" NTC 267 "\1(" NTC
268 "\1)" NTC 268 "\1)" NTC
269 "\1/" NTC /* REGEXP */ 269 "\1/" NTC /* REGEXP */
@@ -373,7 +373,7 @@ enum {
373 ENVIRON, F0, NUM_INTERNAL_VARS 373 ENVIRON, F0, NUM_INTERNAL_VARS
374}; 374};
375 375
376static const char vNames[] = 376static const char vNames[] ALIGN1 =
377 "CONVFMT\0" "OFMT\0" "FS\0*" "OFS\0" 377 "CONVFMT\0" "OFMT\0" "FS\0*" "OFS\0"
378 "ORS\0" "RS\0*" "RT\0" "FILENAME\0" 378 "ORS\0" "RS\0*" "RT\0" "FILENAME\0"
379 "SUBSEP\0" "ARGIND\0" "ARGC\0" "ARGV\0" 379 "SUBSEP\0" "ARGIND\0" "ARGC\0" "ARGV\0"
@@ -381,16 +381,15 @@ static const char vNames[] =
381 "NR\0" "NF\0*" "IGNORECASE\0*" 381 "NR\0" "NF\0*" "IGNORECASE\0*"
382 "ENVIRON\0" "$\0*" "\0"; 382 "ENVIRON\0" "$\0*" "\0";
383 383
384static const char vValues[] = 384static const char vValues[] ALIGN1 =
385 "%.6g\0" "%.6g\0" " \0" " \0" 385 "%.6g\0" "%.6g\0" " \0" " \0"
386 "\n\0" "\n\0" "\0" "\0" 386 "\n\0" "\n\0" "\0" "\0"
387 "\034\0" 387 "\034\0"
388 "\377"; 388 "\377";
389 389
390/* hash size may grow to these values */ 390/* hash size may grow to these values */
391#define FIRST_PRIME 61; 391#define FIRST_PRIME 61
392static const unsigned PRIMES[] = { 251, 1021, 4093, 16381, 65521 }; 392static const uint16_t PRIMES[] ALIGN2 = { 251, 1021, 4093, 16381, 65521 };
393
394 393
395 394
396/* Globals. Split in two parts so that first one is addressed 395/* Globals. Split in two parts so that first one is addressed
@@ -504,17 +503,17 @@ static int awk_exit(int) ATTRIBUTE_NORETURN;
504 503
505/* ---- error handling ---- */ 504/* ---- error handling ---- */
506 505
507static const char EMSG_INTERNAL_ERROR[] = "Internal error"; 506static const char EMSG_INTERNAL_ERROR[] ALIGN1 = "Internal error";
508static const char EMSG_UNEXP_EOS[] = "Unexpected end of string"; 507static const char EMSG_UNEXP_EOS[] ALIGN1 = "Unexpected end of string";
509static const char EMSG_UNEXP_TOKEN[] = "Unexpected token"; 508static const char EMSG_UNEXP_TOKEN[] ALIGN1 = "Unexpected token";
510static const char EMSG_DIV_BY_ZERO[] = "Division by zero"; 509static const char EMSG_DIV_BY_ZERO[] ALIGN1 = "Division by zero";
511static const char EMSG_INV_FMT[] = "Invalid format specifier"; 510static const char EMSG_INV_FMT[] ALIGN1 = "Invalid format specifier";
512static const char EMSG_TOO_FEW_ARGS[] = "Too few arguments for builtin"; 511static const char EMSG_TOO_FEW_ARGS[] ALIGN1 = "Too few arguments for builtin";
513static const char EMSG_NOT_ARRAY[] = "Not an array"; 512static const char EMSG_NOT_ARRAY[] ALIGN1 = "Not an array";
514static const char EMSG_POSSIBLE_ERROR[] = "Possible syntax error"; 513static const char EMSG_POSSIBLE_ERROR[] ALIGN1 = "Possible syntax error";
515static const char EMSG_UNDEF_FUNC[] = "Call to undefined function"; 514static const char EMSG_UNDEF_FUNC[] ALIGN1 = "Call to undefined function";
516#if !ENABLE_FEATURE_AWK_MATH 515#if !ENABLE_FEATURE_AWK_MATH
517static const char EMSG_NO_MATH[] = "Math support is not compiled in"; 516static const char EMSG_NO_MATH[] ALIGN1 = "Math support is not compiled in";
518#endif 517#endif
519 518
520static void zero_out_var(var * vp) 519static void zero_out_var(var * vp)
@@ -522,8 +521,8 @@ static void zero_out_var(var * vp)
522 memset(vp, 0, sizeof(*vp)); 521 memset(vp, 0, sizeof(*vp));
523} 522}
524 523
525static void syntax_error(const char * const message) ATTRIBUTE_NORETURN; 524static void syntax_error(const char *const message) ATTRIBUTE_NORETURN;
526static void syntax_error(const char * const message) 525static void syntax_error(const char *const message)
527{ 526{
528 bb_error_msg_and_die("%s:%i: %s", g_progname, g_lineno, message); 527 bb_error_msg_and_die("%s:%i: %s", g_progname, g_lineno, message);
529} 528}
@@ -825,7 +824,7 @@ static var *copyvar(var *dest, const var *src)
825 824
826static var *incvar(var *v) 825static var *incvar(var *v)
827{ 826{
828 return setvar_i(v, getvar_i(v)+1.); 827 return setvar_i(v, getvar_i(v) + 1.);
829} 828}
830 829
831/* return true if v is number or numeric string */ 830/* return true if v is number or numeric string */
diff --git a/editors/cmp.c b/editors/cmp.c
index da431f39b..ffdfb9103 100644
--- a/editors/cmp.c
+++ b/editors/cmp.c
@@ -33,12 +33,12 @@ static FILE *cmp_xfopen_input(const char *filename)
33 xfunc_die(); /* We already output an error message. */ 33 xfunc_die(); /* We already output an error message. */
34} 34}
35 35
36static const char fmt_eof[] = "cmp: EOF on %s\n"; 36static const char fmt_eof[] ALIGN1 = "cmp: EOF on %s\n";
37static const char fmt_differ[] = "%s %s differ: char %"OFF_FMT"d, line %d\n"; 37static const char fmt_differ[] ALIGN1 = "%s %s differ: char %"OFF_FMT"d, line %d\n";
38// This fmt_l_opt uses gnu-isms. SUSv3 would be "%.0s%.0s%"OFF_FMT"d %o %o\n" 38// This fmt_l_opt uses gnu-isms. SUSv3 would be "%.0s%.0s%"OFF_FMT"d %o %o\n"
39static const char fmt_l_opt[] = "%.0s%.0s%"OFF_FMT"d %3o %3o\n"; 39static const char fmt_l_opt[] ALIGN1 = "%.0s%.0s%"OFF_FMT"d %3o %3o\n";
40 40
41static const char opt_chars[] = "sl"; 41static const char opt_chars[] ALIGN1 = "sl";
42#define CMP_OPT_s (1<<0) 42#define CMP_OPT_s (1<<0)
43#define CMP_OPT_l (1<<1) 43#define CMP_OPT_l (1<<1)
44 44
diff --git a/editors/diff.c b/editors/diff.c
index 88f8b22db..41808b1ac 100644
--- a/editors/diff.c
+++ b/editors/diff.c
@@ -166,7 +166,7 @@ static void print_only(const char *path, size_t dirlen, const char *entry)
166 166
167static void print_status(int val, char *path1, char *path2, char *entry) 167static void print_status(int val, char *path1, char *path2, char *entry)
168{ 168{
169 const char * const _entry = entry ? entry : ""; 169 const char *const _entry = entry ? entry : "";
170 char * const _path1 = entry ? concat_path_file(path1, _entry) : path1; 170 char * const _path1 = entry ? concat_path_file(path1, _entry) : path1;
171 char * const _path2 = entry ? concat_path_file(path2, _entry) : path2; 171 char * const _path2 = entry ? concat_path_file(path2, _entry) : path2;
172 172
diff --git a/editors/sed.c b/editors/sed.c
index 4647079aa..01ef93c6c 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -89,7 +89,7 @@ typedef struct sed_cmd_s {
89 char cmd; /* The command char: abcdDgGhHilnNpPqrstwxy:={} */ 89 char cmd; /* The command char: abcdDgGhHilnNpPqrstwxy:={} */
90} sed_cmd_t; 90} sed_cmd_t;
91 91
92static const char semicolon_whitespace[] = "; \n\r\t\v"; 92static const char semicolon_whitespace[] ALIGN1 = "; \n\r\t\v";
93 93
94struct globals { 94struct globals {
95 /* options */ 95 /* options */
diff --git a/editors/vi.c b/editors/vi.c
index c4f3a8393..74566499c 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -62,18 +62,18 @@ enum {
62 62
63/* vt102 typical ESC sequence */ 63/* vt102 typical ESC sequence */
64/* terminal standout start/normal ESC sequence */ 64/* terminal standout start/normal ESC sequence */
65static const char SOs[] = "\033[7m"; 65static const char SOs[] ALIGN1 = "\033[7m";
66static const char SOn[] = "\033[0m"; 66static const char SOn[] ALIGN1 = "\033[0m";
67/* terminal bell sequence */ 67/* terminal bell sequence */
68static const char bell[] = "\007"; 68static const char bell[] ALIGN1 = "\007";
69/* Clear-end-of-line and Clear-end-of-screen ESC sequence */ 69/* Clear-end-of-line and Clear-end-of-screen ESC sequence */
70static const char Ceol[] = "\033[0K"; 70static const char Ceol[] ALIGN1 = "\033[0K";
71static const char Ceos [] = "\033[0J"; 71static const char Ceos[] ALIGN1 = "\033[0J";
72/* Cursor motion arbitrary destination ESC sequence */ 72/* Cursor motion arbitrary destination ESC sequence */
73static const char CMrc[] = "\033[%d;%dH"; 73static const char CMrc[] ALIGN1 = "\033[%d;%dH";
74/* Cursor motion up and down ESC sequence */ 74/* Cursor motion up and down ESC sequence */
75static const char CMup[] = "\033[A"; 75static const char CMup[] ALIGN1 = "\033[A";
76static const char CMdown[] = "\n"; 76static const char CMdown[] ALIGN1 = "\n";
77 77
78 78
79enum { 79enum {
@@ -2663,7 +2663,7 @@ static void ni(const char * s) // display messages
2663static int format_edit_status(void) // show file status on status line 2663static int format_edit_status(void) // show file status on status line
2664{ 2664{
2665 static int tot; 2665 static int tot;
2666 static const char cmd_mode_indicator[] = "-IR-"; 2666 static const char cmd_mode_indicator[] ALIGN1 = "-IR-";
2667 int cur, percent, ret, trunc_at; 2667 int cur, percent, ret, trunc_at;
2668 2668
2669 // file_modified is now a counter rather than a flag. this 2669 // file_modified is now a counter rather than a flag. this