diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-17 09:00:54 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-17 09:00:54 +0000 |
commit | 68404f13d4bf4826e3609703dad5375763db28ab (patch) | |
tree | b89ed41daeb3a761ac9416a6eed090023b23e7e2 /shell/hush.c | |
parent | a55bd05f3cea6c7cbfb45d15009cb70570c2a43b (diff) | |
download | busybox-w32-68404f13d4bf4826e3609703dad5375763db28ab.tar.gz busybox-w32-68404f13d4bf4826e3609703dad5375763db28ab.tar.bz2 busybox-w32-68404f13d4bf4826e3609703dad5375763db28ab.zip |
*: add -Wunused-parameter; fix resulting breakage
function old new delta
procps_scan 1265 1298 +33
aliascmd 278 283 +5
parse_file_cmd 116 120 +4
dname_enc 373 377 +4
setcmd 90 93 +3
execcmd 57 60 +3
count_lines 72 74 +2
process_command_subs 340 339 -1
test_main 409 407 -2
mknod_main 179 177 -2
handle_incoming_and_exit 2653 2651 -2
argstr 1312 1310 -2
shiftcmd 131 128 -3
exitcmd 46 43 -3
dotcmd 297 294 -3
breakcmd 86 83 -3
evalpipe 353 349 -4
evalcommand 1180 1176 -4
evalcmd 109 105 -4
send_tree 374 369 -5
mkfifo_main 82 77 -5
evalsubshell 152 147 -5
typecmd 75 69 -6
letcmd 61 55 -6
add_cmd 1190 1183 -7
main 891 883 -8
ash_main 1415 1407 -8
parse_stream 1377 1367 -10
alloc_procps_scan 55 - -55
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148) Total: -94 bytes
text data bss dec hex filename
797195 658 7428 805281 c49a1 busybox_old
797101 658 7428 805187 c4943 busybox_unstripped
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/shell/hush.c b/shell/hush.c index c61607dd3..2d5697269 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -536,11 +536,13 @@ static int done_pipe(struct p_context *ctx, pipe_style type); | |||
536 | static int redirect_dup_num(struct in_str *input); | 536 | static int redirect_dup_num(struct in_str *input); |
537 | static int redirect_opt_num(o_string *o); | 537 | static int redirect_opt_num(o_string *o); |
538 | #if ENABLE_HUSH_TICK | 538 | #if ENABLE_HUSH_TICK |
539 | static int process_command_subs(o_string *dest, struct p_context *ctx, struct in_str *input, const char *subst_end); | 539 | static int process_command_subs(o_string *dest, /*struct p_context *ctx,*/ |
540 | struct in_str *input, const char *subst_end); | ||
540 | #endif | 541 | #endif |
541 | static int parse_group(o_string *dest, struct p_context *ctx, struct in_str *input, int ch); | 542 | static int parse_group(o_string *dest, struct p_context *ctx, struct in_str *input, int ch); |
542 | static const char *lookup_param(const char *src); | 543 | static const char *lookup_param(const char *src); |
543 | static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input); | 544 | static int handle_dollar(o_string *dest, /*struct p_context *ctx,*/ |
545 | struct in_str *input); | ||
544 | static int parse_stream(o_string *dest, struct p_context *ctx, struct in_str *input0, const char *end_trigger); | 546 | static int parse_stream(o_string *dest, struct p_context *ctx, struct in_str *input0, const char *end_trigger); |
545 | /* setup: */ | 547 | /* setup: */ |
546 | static int parse_and_run_stream(struct in_str *inp, int parse_flag); | 548 | static int parse_and_run_stream(struct in_str *inp, int parse_flag); |
@@ -741,14 +743,14 @@ static void set_every_sighandler(void (*handler)(int)) | |||
741 | signal(SIGCHLD, handler); | 743 | signal(SIGCHLD, handler); |
742 | } | 744 | } |
743 | 745 | ||
744 | static void handler_ctrl_c(int sig) | 746 | static void handler_ctrl_c(int sig ATTRIBUTE_UNUSED) |
745 | { | 747 | { |
746 | debug_printf_jobs("got sig %d\n", sig); | 748 | debug_printf_jobs("got sig %d\n", sig); |
747 | // as usual we can have all kinds of nasty problems with leaked malloc data here | 749 | // as usual we can have all kinds of nasty problems with leaked malloc data here |
748 | siglongjmp(toplevel_jb, 1); | 750 | siglongjmp(toplevel_jb, 1); |
749 | } | 751 | } |
750 | 752 | ||
751 | static void handler_ctrl_z(int sig) | 753 | static void handler_ctrl_z(int sig ATTRIBUTE_UNUSED) |
752 | { | 754 | { |
753 | pid_t pid; | 755 | pid_t pid; |
754 | 756 | ||
@@ -3257,8 +3259,10 @@ static FILE *generate_stream_from_list(struct pipe *head) | |||
3257 | } | 3259 | } |
3258 | 3260 | ||
3259 | /* Return code is exit status of the process that is run. */ | 3261 | /* Return code is exit status of the process that is run. */ |
3260 | static int process_command_subs(o_string *dest, struct p_context *ctx, | 3262 | static int process_command_subs(o_string *dest, |
3261 | struct in_str *input, const char *subst_end) | 3263 | /*struct p_context *ctx,*/ |
3264 | struct in_str *input, | ||
3265 | const char *subst_end) | ||
3262 | { | 3266 | { |
3263 | int retcode, ch, eol_cnt; | 3267 | int retcode, ch, eol_cnt; |
3264 | o_string result = NULL_O_STRING; | 3268 | o_string result = NULL_O_STRING; |
@@ -3351,7 +3355,7 @@ static const char *lookup_param(const char *src) | |||
3351 | } | 3355 | } |
3352 | 3356 | ||
3353 | /* return code: 0 for OK, 1 for syntax error */ | 3357 | /* return code: 0 for OK, 1 for syntax error */ |
3354 | static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input) | 3358 | static int handle_dollar(o_string *dest, /*struct p_context *ctx,*/ struct in_str *input) |
3355 | { | 3359 | { |
3356 | int ch = b_peek(input); /* first character after the $ */ | 3360 | int ch = b_peek(input); /* first character after the $ */ |
3357 | unsigned char quote_mask = dest->o_quote ? 0x80 : 0; | 3361 | unsigned char quote_mask = dest->o_quote ? 0x80 : 0; |
@@ -3409,7 +3413,7 @@ static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *i | |||
3409 | #if ENABLE_HUSH_TICK | 3413 | #if ENABLE_HUSH_TICK |
3410 | case '(': | 3414 | case '(': |
3411 | b_getch(input); | 3415 | b_getch(input); |
3412 | process_command_subs(dest, ctx, input, ")"); | 3416 | process_command_subs(dest, /*ctx,*/ input, ")"); |
3413 | break; | 3417 | break; |
3414 | #endif | 3418 | #endif |
3415 | case '-': | 3419 | case '-': |
@@ -3507,7 +3511,7 @@ static int parse_stream(o_string *dest, struct p_context *ctx, | |||
3507 | b_addqchr(dest, b_getch(input), dest->o_quote); | 3511 | b_addqchr(dest, b_getch(input), dest->o_quote); |
3508 | break; | 3512 | break; |
3509 | case '$': | 3513 | case '$': |
3510 | if (handle_dollar(dest, ctx, input) != 0) { | 3514 | if (handle_dollar(dest, /*ctx,*/ input) != 0) { |
3511 | debug_printf_parse("parse_stream return 1: handle_dollar returned non-0\n"); | 3515 | debug_printf_parse("parse_stream return 1: handle_dollar returned non-0\n"); |
3512 | return 1; | 3516 | return 1; |
3513 | } | 3517 | } |
@@ -3532,7 +3536,7 @@ static int parse_stream(o_string *dest, struct p_context *ctx, | |||
3532 | break; | 3536 | break; |
3533 | #if ENABLE_HUSH_TICK | 3537 | #if ENABLE_HUSH_TICK |
3534 | case '`': | 3538 | case '`': |
3535 | process_command_subs(dest, ctx, input, "`"); | 3539 | process_command_subs(dest, /*ctx,*/ input, "`"); |
3536 | break; | 3540 | break; |
3537 | #endif | 3541 | #endif |
3538 | case '>': | 3542 | case '>': |