Fix further 'variable set but not used' warnings reported from GCC 4.6.0.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29809 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2011-05-01 13:48:28 +00:00
parent 08fb3f6574
commit f7c4594134
17 changed files with 344 additions and 355 deletions

View File

@ -54,7 +54,6 @@ enum codec_status codec_run(void)
static NeAACDecFrameInfo frame_info;
NeAACDecHandle decoder;
size_t n;
void *ret;
unsigned int i;
unsigned char* buffer;
int err, consumed, pkt_offset, skipped = 0;
@ -192,7 +191,7 @@ enum codec_status codec_run(void)
/* Decode one block - returned samples will be host-endian */
for(i = 0; i < rmctx.sub_packet_cnt; i++) {
ret = NeAACDecDecode(decoder, &frame_info, buffer, rmctx.sub_packet_lengths[i]);
NeAACDecDecode(decoder, &frame_info, buffer, rmctx.sub_packet_lengths[i]);
buffer += rmctx.sub_packet_lengths[i];
if (frame_info.error > 0) {
DEBUGF("FAAD: decode error '%s'\n", NeAACDecGetErrorMessage(frame_info.error));

View File

@ -315,7 +315,10 @@ void option_select_next_val(const struct settings_list *setting,
static int selection_to_val(const struct settings_list *setting, int selection)
{
int min = 0, max = 0, step = 1;
/* rockbox: comment 'set but unused' variables
int min = 0;
*/
int max = 0, step = 1;
if (((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING) ||
((setting->flags & F_CHOICE_SETTING) == F_CHOICE_SETTING))
return selection;
@ -339,10 +342,10 @@ static int selection_to_val(const struct settings_list *setting, int selection)
#ifndef ASCENDING_INT_SETTINGS
step = sound_steps(setting_id);
max = sound_max(setting_id);
min = sound_min(setting_id);
/* min = sound_min(setting_id); */
#else
step = -sound_steps(setting_id);
min = sound_max(setting_id);
/* min = sound_max(setting_id); */
max = sound_min(setting_id);
#endif
}
@ -350,12 +353,12 @@ static int selection_to_val(const struct settings_list *setting, int selection)
{
const struct int_setting *info = setting->int_setting;
#ifndef ASCENDING_INT_SETTINGS
min = info->min;
/* min = info->min; */
max = info->max;
step = info->step;
#else
max = info->min;
min = info->max;
/* min = info->max; */
step = -info->step;
#endif
}

View File

@ -223,7 +223,7 @@ static int rm_parse_header(int fd, RMContext *rmctx, struct mp3entry *id3)
struct real_object_t obj;
int res;
int skipped;
off_t curpos;
off_t curpos __attribute__((unused));
uint8_t len; /* Holds a string_length, which is then passed to read_string() */
#ifdef SIMULATOR

View File

@ -1953,7 +1953,7 @@ static int bubbles_remove(struct game_context* bb) {
******************************************************************************/
static void bubbles_anchored(struct game_context* bb, int row, int col) {
int i, adj;
int myrow, mycol, mytype;
int myrow, mycol;
int count = 0;
struct coord {
@ -1971,7 +1971,6 @@ static void bubbles_anchored(struct game_context* bb, int row, int col) {
for(i=0; i<count; i++) {
myrow = search[i].row;
mycol = search[i].col;
mytype = bb->playboard[myrow][mycol].type;
adj = myrow%2;
if(mycol-1 >= 0) {

View File

@ -321,7 +321,6 @@ void cb_saveposition ( void ) {
/* ---- Restore saved position ---- */
void cb_restoreposition ( void ) {
int fd;
int c;
short sq;
unsigned short m;
@ -357,7 +356,7 @@ void cb_restoreposition ( void ) {
else
--color[sq];
}
GameCnt = -1; c = '?';
GameCnt = -1;
while (rb->read(fd, &(GameList[++GameCnt].gmove),
sizeof(GameList[GameCnt].gmove)) > 0) {
rb->read(fd, &(GameList[GameCnt].score),

View File

@ -392,7 +392,6 @@ static void chopTerrainNodeDeleteAndShift(struct CTerrain *ter,int nodeIndex)
int chopUpdateTerrainRecycling(struct CTerrain *ter)
{
int i=1;
int ret = 0;
int iNewNodePos,g,v;
while(i < ter->iNodesCount)
{
@ -412,8 +411,6 @@ int chopUpdateTerrainRecycling(struct CTerrain *ter)
v*=5;
chopAddTerrainNode(ter,iNewNodePos,g - iR(-v,v));
ret=1;
}
i++;
@ -426,7 +423,7 @@ int chopUpdateTerrainRecycling(struct CTerrain *ter)
int chopTerrainHeightAtPoint(struct CTerrain *ter, int pX)
{
int iNodeIndexOne=0,iNodeIndexTwo=0, h, terY1, terY2, terX1, terX2, a, b;
int iNodeIndexOne=0,iNodeIndexTwo=0, h, terY1, terY2, terX2, a, b;
float c,d;
int i=0;
@ -444,7 +441,7 @@ int chopTerrainHeightAtPoint(struct CTerrain *ter, int pX)
terY1 = ter->mNodes[iNodeIndexOne].y;
terY2 = ter->mNodes[iNodeIndexTwo].y;
terX1 = 0;
/* terX1 = 0; */
terX2 = ter->mNodes[iNodeIndexTwo].x - ter->mNodes[iNodeIndexOne].x;
pX-= ter->mNodes[iNodeIndexOne].x;

View File

@ -402,12 +402,10 @@ void init_undo (void)
static void free_undo (int count)
{
undo_t *p;
if (count > undo_count)
count = undo_count;
while (count--) {
p = first_undo;
if (curr_undo == first_undo)
curr_undo = curr_undo->next;
first_undo = first_undo->next;

View File

@ -1675,7 +1675,6 @@ static void decodeGeneric(LodePNG_Decoder* decoder)
/* for unknown chunk order */
bool unknown = false;
uint8_t critical_pos = 1; /*1 = after IHDR, 2 = after PLTE, 3 = after IDAT*/
if (decoder->file_size == 0 || in == NULL)
{
@ -1739,7 +1738,6 @@ static void decodeGeneric(LodePNG_Decoder* decoder)
/* copy compressed data */
memcpy(idat+idat_size, data, chunkLength * sizeof(uint8_t));
idat_size += chunkLength;
critical_pos = 3;
}
/*IEND chunk*/
else if (LodePNG_chunk_type_equals(chunk, PNG_CHUNK_IEND))
@ -1765,7 +1763,6 @@ static void decodeGeneric(LodePNG_Decoder* decoder)
decoder->infoPng.color.palette[(i<<2) | 2] = data[pos++]; /*B*/
decoder->infoPng.color.palette[(i<<2) | 3] = 255; /*alpha*/
}
critical_pos = 2;
}
/*palette transparency chunk (tRNS)*/
else if (LodePNG_chunk_type_equals(chunk, PNG_CHUNK_tRNS))

View File

@ -465,7 +465,6 @@ static int parse_buffer(void)
static void write_output(int fd)
{
size_t bytes_written;
int i;
size_t len, size;
char *p = &buffer[HEADER_LEN]; /* reserve space for salt + hash */
@ -498,7 +497,7 @@ static void write_output(int fd)
encrypt_buffer(&buffer[8], size, &key.words[0]);
rb->memcpy(&buffer[0], &salt, sizeof(salt));
bytes_written = rb->write(fd, &buffer, size);
rb->write(fd, &buffer, size);
}
static int enter_pw(char *pw_buf, size_t buflen, bool new_pw)

View File

@ -1193,7 +1193,6 @@ static void parse_id3v2(int fd)
int bytesread = 0;
unsigned char global_flags;
int flags;
int skip;
bool global_unsynch = false;
bool global_ff_found = false;
bool unsynch = false;
@ -1235,7 +1234,6 @@ static void parse_id3v2(int fd)
/* Skip the extended header if it is present */
if(global_flags & 0x40) {
skip = 0;
if(version == ID3_VER_2_3) {
if(10 != rb->read(fd, header, 10))

View File

@ -871,8 +871,10 @@ int Read32BitsLowHigh(int fd)
int wave_open(void)
{
unsigned short wFormatTag;
/* rockbox: comment 'set but unused" variable
unsigned long dAvgBytesPerSec;
unsigned short wBlockAlign;
*/
unsigned short bits_per_samp;
long header_size;
@ -889,8 +891,8 @@ int wave_open(void)
cfg.channels = Read16BitsLowHigh(wavfile);
cfg.samplerate = Read32BitsLowHigh(wavfile);
dAvgBytesPerSec = Read32BitsLowHigh(wavfile);
wBlockAlign = Read16BitsLowHigh(wavfile);
/*dAvgBytesPerSec*/ Read32BitsLowHigh(wavfile);
/*wBlockAlign */ Read16BitsLowHigh(wavfile);
bits_per_samp = Read16BitsLowHigh(wavfile);
if(wFormatTag != 0x0001) return -5; /* linear PCM required */

View File

@ -982,7 +982,9 @@ static void record_data(void)
static void record_and_get_pitch(void)
{
int quit=0, button;
#ifndef SIMULATOR
bool redraw = true;
#endif
/* For tracking the latency */
/*
long timer;
@ -1016,7 +1018,9 @@ static void record_and_get_pitch(void)
quit = main_menu();
if(!quit)
{
#ifndef SIMULATOR
redraw = true;
#endif
record_data();
}
break;

View File

@ -153,10 +153,11 @@ void cleanup(void)
int main(void)
{
plasma_frequency = 1;
int action, delay, x, y;
int action, x, y;
unsigned char p1,p2,p3,p4,t1,t2,t3,t4, z,z0;
long last_tick = *rb->current_tick;
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
int delay;
int cumulated_lag = 0;
#endif
#ifdef HAVE_LCD_COLOR
@ -243,8 +244,8 @@ int main(void)
grey_ub_gray_bitmap(greybuffer, 0, 0, LCD_WIDTH, LCD_HEIGHT);
#endif
delay = last_tick - *rb->current_tick + HZ/33;
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
delay = last_tick - *rb->current_tick + HZ/33;
if (!boosted && delay < 0)
{
cumulated_lag -= delay; /* proportional increase */

View File

@ -1528,16 +1528,12 @@ static bool sokoban_loop(void)
{
bool moved;
int i = 0, button = 0, lastbutton = 0;
short r = 0, c = 0;
int w, h;
char *loc;
while (true) {
moved = false;
r = current_info.player.row;
c = current_info.player.col;
button = rb->button_get(true);
switch(button)

View File

@ -947,10 +947,6 @@ static int star_run_game(int current_level)
int key;
int lastkey = BUTTON_NONE;
int label_offset_y;
label_offset_y = LCD_HEIGHT - char_height;
if (!star_load_level(current_level))
return 0;

View File

@ -1,5 +1,7 @@
#include "zxconfig.h"
//#define ZX_WRITE_OUT_TEXT
#ifndef O_BINARY
#define O_BINARY 0
#endif
@ -274,8 +276,9 @@ int zx_kbd_input(char* text/*, int buflen*/)
bool done = false;
int i, j, k, w, l;
int text_w = 0;
int len_utf8/*, c = 0*/;
int editpos;
#ifdef ZX_WRITE_OUT_TEXT
int editpos, len_utf8;
#endif
/* int statusbar_size = global_settings.statusbar ? STATUSBAR_HEIGHT : 0;*/
unsigned short ch/*, tmp, hlead = 0, hvowel = 0, htail = 0*/;
/*bool hangul = false;*/
@ -298,7 +301,7 @@ int zx_kbd_input(char* text/*, int buflen*/)
}
char outline[256];
int button, lastbutton = 0;
int button;
FOR_NB_SCREENS(l)
{
/* Copy default keyboard to buffer */
@ -419,13 +422,15 @@ int zx_kbd_input(char* text/*, int buflen*/)
param[l].keyboard_margin -= param[l].keyboard_margin/2;
}
#ifdef ZX_WRITE_OUT_TEXT
editpos = rb->utf8length(text);
#endif
while(!done)
{
#ifdef ZX_WRITE_OUT_TEXT
len_utf8 = rb->utf8length(text);
#endif
FOR_NB_SCREENS(l)
rb->screens[l]->clear_display();
@ -456,7 +461,7 @@ int zx_kbd_input(char* text/*, int buflen*/)
param[l].main_y - param[l].keyboard_margin);
/* write out the text */
#if 0
#ifdef ZX_WRITE_OUT_TEXT
rb->screens[l]->setfont(param[l].curfont);
i=j=0;
@ -626,7 +631,6 @@ int zx_kbd_input(char* text/*, int buflen*/)
}
if (button != BUTTON_NONE)
{
lastbutton = button;
cur_blink = true;
}
}

View File

@ -474,7 +474,6 @@ static int skin_parse_tag(struct skin_element* element, const char** document)
int num_args = 1;
int i;
int star = 0; /* Flag for the all-or-none option */
int req_args; /* To mark when we enter optional arguments */
int optional = 0;
tag_recursion_level++;
@ -597,7 +596,6 @@ static int skin_parse_tag(struct skin_element* element, const char** document)
if(*tag_args == '|')
{
optional = 1;
req_args = i;
tag_args++;
}
@ -775,7 +773,6 @@ static int skin_parse_tag(struct skin_element* element, const char** document)
if(*tag_args == '|')
{
optional = 1;
req_args = i + 1;
tag_args++;
}
}