aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-05-13 20:57:01 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-05-13 20:57:01 +0200
commit60a9414cad23b6e8cc6b13e37675826ed05f7709 (patch)
tree38b193f0468dd57728fe991e9eaed8abf088deeb
parent8dd29da2c667b6c9ae7381096320b9e31d3a50e2 (diff)
downloadbusybox-w32-60a9414cad23b6e8cc6b13e37675826ed05f7709.tar.gz
busybox-w32-60a9414cad23b6e8cc6b13e37675826ed05f7709.tar.bz2
busybox-w32-60a9414cad23b6e8cc6b13e37675826ed05f7709.zip
fix "variable 'foo' set but not used" warnings
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--archival/libarchive/bz/compress.c7
-rw-r--r--e2fsprogs/fsck.c3
-rw-r--r--editors/vi.c2
-rw-r--r--libbb/dump.c7
-rw-r--r--miscutils/last_fancy.c3
-rw-r--r--networking/ftpgetput.c7
-rw-r--r--procps/powertop.c2
-rw-r--r--runit/sv.c3
-rw-r--r--shell/hush.c4
9 files changed, 11 insertions, 27 deletions
diff --git a/archival/libarchive/bz/compress.c b/archival/libarchive/bz/compress.c
index 6f1c70a08..f93671742 100644
--- a/archival/libarchive/bz/compress.c
+++ b/archival/libarchive/bz/compress.c
@@ -251,7 +251,7 @@ void sendMTFValues(EState* s)
251{ 251{
252 int32_t v, t, i, j, gs, ge, totc, bt, bc, iter; 252 int32_t v, t, i, j, gs, ge, totc, bt, bc, iter;
253 int32_t nSelectors, alphaSize, minLen, maxLen, selCtr; 253 int32_t nSelectors, alphaSize, minLen, maxLen, selCtr;
254 int32_t nGroups, nBytes; 254 int32_t nGroups;
255 255
256 /* 256 /*
257 * uint8_t len[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; 257 * uint8_t len[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
@@ -512,7 +512,6 @@ void sendMTFValues(EState* s)
512 } 512 }
513 } 513 }
514 514
515 nBytes = s->numZ;
516 bsW(s, 16, inUse16); 515 bsW(s, 16, inUse16);
517 516
518 inUse16 <<= (sizeof(int)*8 - 16); /* move 15th bit into sign bit */ 517 inUse16 <<= (sizeof(int)*8 - 16); /* move 15th bit into sign bit */
@@ -528,7 +527,6 @@ void sendMTFValues(EState* s)
528 } 527 }
529 528
530 /*--- Now the selectors. ---*/ 529 /*--- Now the selectors. ---*/
531 nBytes = s->numZ;
532 bsW(s, 3, nGroups); 530 bsW(s, 3, nGroups);
533 bsW(s, 15, nSelectors); 531 bsW(s, 15, nSelectors);
534 for (i = 0; i < nSelectors; i++) { 532 for (i = 0; i < nSelectors; i++) {
@@ -538,8 +536,6 @@ void sendMTFValues(EState* s)
538 } 536 }
539 537
540 /*--- Now the coding tables. ---*/ 538 /*--- Now the coding tables. ---*/
541 nBytes = s->numZ;
542
543 for (t = 0; t < nGroups; t++) { 539 for (t = 0; t < nGroups; t++) {
544 int32_t curr = s->len[t][0]; 540 int32_t curr = s->len[t][0];
545 bsW(s, 5, curr); 541 bsW(s, 5, curr);
@@ -551,7 +547,6 @@ void sendMTFValues(EState* s)
551 } 547 }
552 548
553 /*--- And finally, the block data proper ---*/ 549 /*--- And finally, the block data proper ---*/
554 nBytes = s->numZ;
555 selCtr = 0; 550 selCtr = 0;
556 gs = 0; 551 gs = 0;
557 while (1) { 552 while (1) {
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c
index b4257a2ad..fcbdb5989 100644
--- a/e2fsprogs/fsck.c
+++ b/e2fsprogs/fsck.c
@@ -317,7 +317,6 @@ static void load_fs_info(const char *filename)
317{ 317{
318 FILE *fstab; 318 FILE *fstab;
319 struct mntent mte; 319 struct mntent mte;
320 struct fs_info *fs;
321 320
322 fstab = setmntent(filename, "r"); 321 fstab = setmntent(filename, "r");
323 if (!fstab) { 322 if (!fstab) {
@@ -330,7 +329,7 @@ static void load_fs_info(const char *filename)
330 //bb_info_msg("CREATE[%s][%s][%s][%s][%d]", mte.mnt_fsname, mte.mnt_dir, 329 //bb_info_msg("CREATE[%s][%s][%s][%s][%d]", mte.mnt_fsname, mte.mnt_dir,
331 // mte.mnt_type, mte.mnt_opts, 330 // mte.mnt_type, mte.mnt_opts,
332 // mte.mnt_passno); 331 // mte.mnt_passno);
333 fs = create_fs_device(mte.mnt_fsname, mte.mnt_dir, 332 create_fs_device(mte.mnt_fsname, mte.mnt_dir,
334 mte.mnt_type, mte.mnt_opts, 333 mte.mnt_type, mte.mnt_opts,
335 mte.mnt_passno); 334 mte.mnt_passno);
336 } 335 }
diff --git a/editors/vi.c b/editors/vi.c
index fd8bd0f78..638b3b733 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -536,7 +536,6 @@ static void edit_file(char *fn)
536#define cur_line edit_file__cur_line 536#define cur_line edit_file__cur_line
537#endif 537#endif
538 int c; 538 int c;
539 int size;
540#if ENABLE_FEATURE_VI_USE_SIGNALS 539#if ENABLE_FEATURE_VI_USE_SIGNALS
541 int sig; 540 int sig;
542#endif 541#endif
@@ -545,7 +544,6 @@ static void edit_file(char *fn)
545 rawmode(); 544 rawmode();
546 rows = 24; 545 rows = 24;
547 columns = 80; 546 columns = 80;
548 size = 0;
549 IF_FEATURE_VI_ASK_TERMINAL(G.get_rowcol_error =) query_screen_dimensions(); 547 IF_FEATURE_VI_ASK_TERMINAL(G.get_rowcol_error =) query_screen_dimensions();
550#if ENABLE_FEATURE_VI_ASK_TERMINAL 548#if ENABLE_FEATURE_VI_ASK_TERMINAL
551 if (G.get_rowcol_error /* TODO? && no input on stdin */) { 549 if (G.get_rowcol_error /* TODO? && no input on stdin */) {
diff --git a/libbb/dump.c b/libbb/dump.c
index 1b1d03a66..919fe135c 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -99,7 +99,7 @@ static NOINLINE int bb_dump_size(FS *fs)
99static NOINLINE void rewrite(priv_dumper_t *dumper, FS *fs) 99static NOINLINE void rewrite(priv_dumper_t *dumper, FS *fs)
100{ 100{
101 enum { NOTOKAY, USEBCNT, USEPREC } sokay; 101 enum { NOTOKAY, USEBCNT, USEPREC } sokay;
102 PR *pr, **nextpr = NULL; 102 PR *pr;
103 FU *fu; 103 FU *fu;
104 char *p1, *p2, *p3; 104 char *p1, *p2, *p3;
105 char savech, *fmtp; 105 char savech, *fmtp;
@@ -111,15 +111,12 @@ static NOINLINE void rewrite(priv_dumper_t *dumper, FS *fs)
111 * break each format unit into print units; each 111 * break each format unit into print units; each
112 * conversion character gets its own. 112 * conversion character gets its own.
113 */ 113 */
114 for (nconv = 0, fmtp = fu->fmt; *fmtp; nextpr = &pr->nextpr) { 114 for (nconv = 0, fmtp = fu->fmt; *fmtp; ) {
115 /* NOSTRICT */ 115 /* NOSTRICT */
116 /* DBU:[dvae@cray.com] zalloc so that forward ptrs start out NULL*/ 116 /* DBU:[dvae@cray.com] zalloc so that forward ptrs start out NULL*/
117 pr = xzalloc(sizeof(PR)); 117 pr = xzalloc(sizeof(PR));
118 if (!fu->nextpr) 118 if (!fu->nextpr)
119 fu->nextpr = pr; 119 fu->nextpr = pr;
120 /* ignore nextpr -- its unused inside the loop and is
121 * uninitialized 1st time through.
122 */
123 120
124 /* skip preceding text and up to the next % sign */ 121 /* skip preceding text and up to the next % sign */
125 for (p1 = fmtp; *p1 && *p1 != '%'; ++p1) 122 for (p1 = fmtp; *p1 && *p1 != '%'; ++p1)
diff --git a/miscutils/last_fancy.c b/miscutils/last_fancy.c
index 7e61b7691..dc09b65fb 100644
--- a/miscutils/last_fancy.c
+++ b/miscutils/last_fancy.c
@@ -161,11 +161,10 @@ int last_main(int argc UNUSED_PARAM, char **argv)
161 time_t boot_time; 161 time_t boot_time;
162 time_t down_time; 162 time_t down_time;
163 int file; 163 int file;
164 unsigned opt;
165 smallint going_down; 164 smallint going_down;
166 smallint boot_down; 165 smallint boot_down;
167 166
168 opt = getopt32(argv, "Wf:" /* "H" */, &filename); 167 /*opt =*/ getopt32(argv, "Wf:" /* "H" */, &filename);
169#ifdef BUT_UTIL_LINUX_LAST_HAS_NO_SUCH_OPT 168#ifdef BUT_UTIL_LINUX_LAST_HAS_NO_SUCH_OPT
170 if (opt & LAST_OPT_H) { 169 if (opt & LAST_OPT_H) {
171 /* Print header line */ 170 /* Print header line */
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 66316e21f..f63df55f4 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -60,7 +60,7 @@ struct globals {
60 FILE *control_stream; 60 FILE *control_stream;
61 int verbose_flag; 61 int verbose_flag;
62 int do_continue; 62 int do_continue;
63 char buf[1]; /* actually [BUFSZ] */ 63 char buf[4]; /* actually [BUFSZ] */
64} FIX_ALIASING; 64} FIX_ALIASING;
65#define G (*(struct globals*)&bb_common_bufsiz1) 65#define G (*(struct globals*)&bb_common_bufsiz1)
66enum { BUFSZ = COMMON_BUFSIZE - offsetof(struct globals, buf) }; 66enum { BUFSZ = COMMON_BUFSIZE - offsetof(struct globals, buf) };
@@ -105,7 +105,7 @@ static int ftpcmd(const char *s1, const char *s2)
105 } 105 }
106 106
107 do { 107 do {
108 strcpy(buf, "EOF"); 108 strcpy(buf, "EOF"); /* for ftp_die */
109 if (fgets(buf, BUFSZ - 2, control_stream) == NULL) { 109 if (fgets(buf, BUFSZ - 2, control_stream) == NULL) {
110 ftp_die(NULL); 110 ftp_die(NULL);
111 } 111 }
@@ -316,7 +316,6 @@ static const char ftpgetput_longopts[] ALIGN1 =
316int ftpgetput_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 316int ftpgetput_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
317int ftpgetput_main(int argc UNUSED_PARAM, char **argv) 317int ftpgetput_main(int argc UNUSED_PARAM, char **argv)
318{ 318{
319 unsigned opt;
320 const char *port = "ftp"; 319 const char *port = "ftp";
321 /* socket to ftp server */ 320 /* socket to ftp server */
322 321
@@ -345,7 +344,7 @@ int ftpgetput_main(int argc UNUSED_PARAM, char **argv)
345 applet_long_options = ftpgetput_longopts; 344 applet_long_options = ftpgetput_longopts;
346#endif 345#endif
347 opt_complementary = "-2:vv:cc"; /* must have 2 to 3 params; -v and -c count */ 346 opt_complementary = "-2:vv:cc"; /* must have 2 to 3 params; -v and -c count */
348 opt = getopt32(argv, "cvu:p:P:", &user, &password, &port, 347 getopt32(argv, "cvu:p:P:", &user, &password, &port,
349 &verbose_flag, &do_continue); 348 &verbose_flag, &do_continue);
350 argv += optind; 349 argv += optind;
351 350
diff --git a/procps/powertop.c b/procps/powertop.c
index bfe5a9568..008cdfca4 100644
--- a/procps/powertop.c
+++ b/procps/powertop.c
@@ -393,11 +393,9 @@ static NOINLINE int process_timer_stats(void)
393 char buf[128]; 393 char buf[128];
394 char line[15 + 3 + 128]; 394 char line[15 + 3 + 128];
395 int n; 395 int n;
396 ullong totalticks;
397 FILE *fp; 396 FILE *fp;
398 397
399 buf[0] = '\0'; 398 buf[0] = '\0';
400 totalticks = 0;
401 399
402 n = 0; 400 n = 0;
403 fp = NULL; 401 fp = NULL;
diff --git a/runit/sv.c b/runit/sv.c
index 322688a36..5b01c875c 100644
--- a/runit/sv.c
+++ b/runit/sv.c
@@ -437,7 +437,6 @@ static int control(const char *a)
437int sv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 437int sv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
438int sv_main(int argc UNUSED_PARAM, char **argv) 438int sv_main(int argc UNUSED_PARAM, char **argv)
439{ 439{
440 unsigned opt;
441 char *x; 440 char *x;
442 char *action; 441 char *action;
443 const char *varservice = CONFIG_SV_DEFAULT_SERVICE_DIR; 442 const char *varservice = CONFIG_SV_DEFAULT_SERVICE_DIR;
@@ -458,7 +457,7 @@ int sv_main(int argc UNUSED_PARAM, char **argv)
458 if (x) waitsec = xatou(x); 457 if (x) waitsec = xatou(x);
459 458
460 opt_complementary = "w+:vv"; /* -w N, -v is a counter */ 459 opt_complementary = "w+:vv"; /* -w N, -v is a counter */
461 opt = getopt32(argv, "w:v", &waitsec, &verbose); 460 getopt32(argv, "w:v", &waitsec, &verbose);
462 argv += optind; 461 argv += optind;
463 action = *argv++; 462 action = *argv++;
464 if (!action || !*argv) bb_show_usage(); 463 if (!action || !*argv) bb_show_usage();
diff --git a/shell/hush.c b/shell/hush.c
index 4c348ec2b..9cc86fa9a 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -4517,11 +4517,11 @@ static struct pipe *parse_stream(char **pstring,
4517 break; 4517 break;
4518#if ENABLE_HUSH_TICK 4518#if ENABLE_HUSH_TICK
4519 case '`': { 4519 case '`': {
4520 unsigned pos; 4520 USE_FOR_NOMMU(unsigned pos;)
4521 4521
4522 o_addchr(&dest, SPECIAL_VAR_SYMBOL); 4522 o_addchr(&dest, SPECIAL_VAR_SYMBOL);
4523 o_addchr(&dest, '`'); 4523 o_addchr(&dest, '`');
4524 pos = dest.length; 4524 USE_FOR_NOMMU(pos = dest.length;)
4525 if (!add_till_backquote(&dest, input, /*in_dquote:*/ 0)) 4525 if (!add_till_backquote(&dest, input, /*in_dquote:*/ 0))
4526 goto parse_error; 4526 goto parse_error;
4527# if !BB_MMU 4527# if !BB_MMU