fix "variable 'foo' set but not used" warnings

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2011-05-13 20:57:01 +02:00
parent 8dd29da2c6
commit 60a9414cad
9 changed files with 11 additions and 27 deletions

View File

@ -251,7 +251,7 @@ void sendMTFValues(EState* s)
{
int32_t v, t, i, j, gs, ge, totc, bt, bc, iter;
int32_t nSelectors, alphaSize, minLen, maxLen, selCtr;
int32_t nGroups, nBytes;
int32_t nGroups;
/*
* uint8_t len[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
@ -512,7 +512,6 @@ void sendMTFValues(EState* s)
}
}
nBytes = s->numZ;
bsW(s, 16, inUse16);
inUse16 <<= (sizeof(int)*8 - 16); /* move 15th bit into sign bit */
@ -528,7 +527,6 @@ void sendMTFValues(EState* s)
}
/*--- Now the selectors. ---*/
nBytes = s->numZ;
bsW(s, 3, nGroups);
bsW(s, 15, nSelectors);
for (i = 0; i < nSelectors; i++) {
@ -538,8 +536,6 @@ void sendMTFValues(EState* s)
}
/*--- Now the coding tables. ---*/
nBytes = s->numZ;
for (t = 0; t < nGroups; t++) {
int32_t curr = s->len[t][0];
bsW(s, 5, curr);
@ -551,7 +547,6 @@ void sendMTFValues(EState* s)
}
/*--- And finally, the block data proper ---*/
nBytes = s->numZ;
selCtr = 0;
gs = 0;
while (1) {

View File

@ -317,7 +317,6 @@ static void load_fs_info(const char *filename)
{
FILE *fstab;
struct mntent mte;
struct fs_info *fs;
fstab = setmntent(filename, "r");
if (!fstab) {
@ -330,7 +329,7 @@ static void load_fs_info(const char *filename)
//bb_info_msg("CREATE[%s][%s][%s][%s][%d]", mte.mnt_fsname, mte.mnt_dir,
// mte.mnt_type, mte.mnt_opts,
// mte.mnt_passno);
fs = create_fs_device(mte.mnt_fsname, mte.mnt_dir,
create_fs_device(mte.mnt_fsname, mte.mnt_dir,
mte.mnt_type, mte.mnt_opts,
mte.mnt_passno);
}

View File

@ -536,7 +536,6 @@ static void edit_file(char *fn)
#define cur_line edit_file__cur_line
#endif
int c;
int size;
#if ENABLE_FEATURE_VI_USE_SIGNALS
int sig;
#endif
@ -545,7 +544,6 @@ static void edit_file(char *fn)
rawmode();
rows = 24;
columns = 80;
size = 0;
IF_FEATURE_VI_ASK_TERMINAL(G.get_rowcol_error =) query_screen_dimensions();
#if ENABLE_FEATURE_VI_ASK_TERMINAL
if (G.get_rowcol_error /* TODO? && no input on stdin */) {

View File

@ -99,7 +99,7 @@ static NOINLINE int bb_dump_size(FS *fs)
static NOINLINE void rewrite(priv_dumper_t *dumper, FS *fs)
{
enum { NOTOKAY, USEBCNT, USEPREC } sokay;
PR *pr, **nextpr = NULL;
PR *pr;
FU *fu;
char *p1, *p2, *p3;
char savech, *fmtp;
@ -111,15 +111,12 @@ static NOINLINE void rewrite(priv_dumper_t *dumper, FS *fs)
* break each format unit into print units; each
* conversion character gets its own.
*/
for (nconv = 0, fmtp = fu->fmt; *fmtp; nextpr = &pr->nextpr) {
for (nconv = 0, fmtp = fu->fmt; *fmtp; ) {
/* NOSTRICT */
/* DBU:[dvae@cray.com] zalloc so that forward ptrs start out NULL*/
pr = xzalloc(sizeof(PR));
if (!fu->nextpr)
fu->nextpr = pr;
/* ignore nextpr -- its unused inside the loop and is
* uninitialized 1st time through.
*/
/* skip preceding text and up to the next % sign */
for (p1 = fmtp; *p1 && *p1 != '%'; ++p1)

View File

@ -161,11 +161,10 @@ int last_main(int argc UNUSED_PARAM, char **argv)
time_t boot_time;
time_t down_time;
int file;
unsigned opt;
smallint going_down;
smallint boot_down;
opt = getopt32(argv, "Wf:" /* "H" */, &filename);
/*opt =*/ getopt32(argv, "Wf:" /* "H" */, &filename);
#ifdef BUT_UTIL_LINUX_LAST_HAS_NO_SUCH_OPT
if (opt & LAST_OPT_H) {
/* Print header line */

View File

@ -60,7 +60,7 @@ struct globals {
FILE *control_stream;
int verbose_flag;
int do_continue;
char buf[1]; /* actually [BUFSZ] */
char buf[4]; /* actually [BUFSZ] */
} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
enum { BUFSZ = COMMON_BUFSIZE - offsetof(struct globals, buf) };
@ -105,7 +105,7 @@ static int ftpcmd(const char *s1, const char *s2)
}
do {
strcpy(buf, "EOF");
strcpy(buf, "EOF"); /* for ftp_die */
if (fgets(buf, BUFSZ - 2, control_stream) == NULL) {
ftp_die(NULL);
}
@ -316,7 +316,6 @@ static const char ftpgetput_longopts[] ALIGN1 =
int ftpgetput_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int ftpgetput_main(int argc UNUSED_PARAM, char **argv)
{
unsigned opt;
const char *port = "ftp";
/* socket to ftp server */
@ -345,7 +344,7 @@ int ftpgetput_main(int argc UNUSED_PARAM, char **argv)
applet_long_options = ftpgetput_longopts;
#endif
opt_complementary = "-2:vv:cc"; /* must have 2 to 3 params; -v and -c count */
opt = getopt32(argv, "cvu:p:P:", &user, &password, &port,
getopt32(argv, "cvu:p:P:", &user, &password, &port,
&verbose_flag, &do_continue);
argv += optind;

View File

@ -393,11 +393,9 @@ static NOINLINE int process_timer_stats(void)
char buf[128];
char line[15 + 3 + 128];
int n;
ullong totalticks;
FILE *fp;
buf[0] = '\0';
totalticks = 0;
n = 0;
fp = NULL;

View File

@ -437,7 +437,6 @@ static int control(const char *a)
int sv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int sv_main(int argc UNUSED_PARAM, char **argv)
{
unsigned opt;
char *x;
char *action;
const char *varservice = CONFIG_SV_DEFAULT_SERVICE_DIR;
@ -458,7 +457,7 @@ int sv_main(int argc UNUSED_PARAM, char **argv)
if (x) waitsec = xatou(x);
opt_complementary = "w+:vv"; /* -w N, -v is a counter */
opt = getopt32(argv, "w:v", &waitsec, &verbose);
getopt32(argv, "w:v", &waitsec, &verbose);
argv += optind;
action = *argv++;
if (!action || !*argv) bb_show_usage();

View File

@ -4517,11 +4517,11 @@ static struct pipe *parse_stream(char **pstring,
break;
#if ENABLE_HUSH_TICK
case '`': {
unsigned pos;
USE_FOR_NOMMU(unsigned pos;)
o_addchr(&dest, SPECIAL_VAR_SYMBOL);
o_addchr(&dest, '`');
pos = dest.length;
USE_FOR_NOMMU(pos = dest.length;)
if (!add_till_backquote(&dest, input, /*in_dquote:*/ 0))
goto parse_error;
# if !BB_MMU