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

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29805 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2011-05-01 11:42:41 +00:00
parent 5e57edf263
commit e75018ad66
12 changed files with 36 additions and 42 deletions

View file

@ -77,7 +77,9 @@ enum codec_status codec_run(void)
{ {
struct pcm_format format; struct pcm_format format;
uint32_t bytesdone, decodedsamples; uint32_t bytesdone, decodedsamples;
/* rockbox: comment 'set but unused' variables
uint32_t num_sample_frames = 0; uint32_t num_sample_frames = 0;
*/
size_t n; size_t n;
int bufcount; int bufcount;
int endofstream; int endofstream;
@ -146,8 +148,11 @@ enum codec_status codec_run(void)
/* num_channels */ /* num_channels */
format.channels = ((buf[8]<<8)|buf[9]); format.channels = ((buf[8]<<8)|buf[9]);
/* num_sample_frames */ /* num_sample_frames */
/*
num_sample_frames = ((buf[10]<<24)|(buf[11]<<16)|(buf[12]<<8) num_sample_frames = ((buf[10]<<24)|(buf[11]<<16)|(buf[12]<<8)
|buf[13]); |buf[13]);
*/
/* sample_size */ /* sample_size */
format.bitspersample = ((buf[14]<<8)|buf[15]); format.bitspersample = ((buf[14]<<8)|buf[15]);
/* sample_rate (don't use last 4 bytes, only integer fs) */ /* sample_rate (don't use last 4 bytes, only integer fs) */

View file

@ -59,16 +59,18 @@ int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength,
uint8_t* datap; uint8_t* datap;
uint32_t length; uint32_t length;
uint32_t padding_length; uint32_t padding_length;
/* rockbox: comment 'set but unused' variables
uint32_t send_time; uint32_t send_time;
uint16_t duration; uint16_t duration;
uint32_t media_object_number;
uint32_t media_object_offset;
*/
uint16_t payload_count; uint16_t payload_count;
int payload_length_type; int payload_length_type;
uint32_t payload_hdrlen; uint32_t payload_hdrlen;
int payload_datalen; int payload_datalen;
int multiple; int multiple;
uint32_t replicated_length; uint32_t replicated_length;
uint32_t media_object_number;
uint32_t media_object_offset;
uint32_t bytesread = 0; uint32_t bytesread = 0;
uint8_t* buf; uint8_t* buf;
size_t bufsize; size_t bufsize;
@ -133,9 +135,9 @@ int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength,
datap += GETLEN2b((packet_flags >> 1) & 0x03); datap += GETLEN2b((packet_flags >> 1) & 0x03);
padding_length = GETVALUE2b((packet_flags >> 3) & 0x03, datap); padding_length = GETVALUE2b((packet_flags >> 3) & 0x03, datap);
datap += GETLEN2b((packet_flags >> 3) & 0x03); datap += GETLEN2b((packet_flags >> 3) & 0x03);
send_time = get_long_le(datap); /* send_time = get_long_le(datap); */
datap += 4; datap += 4;
duration = get_short_le(datap); /* duration = get_short_le(datap); */
datap += 2; datap += 2;
/*DEBUGF("and duration %d ms\n", duration);*/ /*DEBUGF("and duration %d ms\n", duration);*/
@ -225,9 +227,9 @@ int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength,
} }
bytesread += payload_hdrlen; bytesread += payload_hdrlen;
media_object_number = GETVALUE2b((packet_property >> 4) & 0x03, datap); /* media_object_number = GETVALUE2b((packet_property >> 4) & 0x03, datap); */
datap += GETLEN2b((packet_property >> 4) & 0x03); datap += GETLEN2b((packet_property >> 4) & 0x03);
media_object_offset = GETVALUE2b((packet_property >> 2) & 0x03, datap); /* media_object_offset = GETVALUE2b((packet_property >> 2) & 0x03, datap); */
datap += GETLEN2b((packet_property >> 2) & 0x03); datap += GETLEN2b((packet_property >> 2) & 0x03);
replicated_length = GETVALUE2b(packet_property & 0x03, datap); replicated_length = GETVALUE2b(packet_property & 0x03, datap);
datap += GETLEN2b(packet_property & 0x03); datap += GETLEN2b(packet_property & 0x03);
@ -299,8 +301,10 @@ int asf_get_timestamp(int *duration)
int datalen; int datalen;
uint8_t data[18]; uint8_t data[18];
uint8_t* datap; uint8_t* datap;
/* rockbox: comment 'set but unused' variables
uint32_t length; uint32_t length;
uint32_t padding_length; uint32_t padding_length;
*/
uint32_t send_time; uint32_t send_time;
static int packet_count = 0; static int packet_count = 0;
@ -359,13 +363,13 @@ int asf_get_timestamp(int *duration)
bytesread += datalen; bytesread += datalen;
datap = data; datap = data;
length = GETVALUE2b((packet_flags >> 5) & 0x03, datap); /* length = GETVALUE2b((packet_flags >> 5) & 0x03, datap); */
datap += GETLEN2b((packet_flags >> 5) & 0x03); datap += GETLEN2b((packet_flags >> 5) & 0x03);
/* sequence value is not used */ /* sequence value is not used */
GETVALUE2b((packet_flags >> 1) & 0x03, datap); GETVALUE2b((packet_flags >> 1) & 0x03, datap);
datap += GETLEN2b((packet_flags >> 1) & 0x03); datap += GETLEN2b((packet_flags >> 1) & 0x03);
padding_length = GETVALUE2b((packet_flags >> 3) & 0x03, datap); /* padding_length = GETVALUE2b((packet_flags >> 3) & 0x03, datap); */
datap += GETLEN2b((packet_flags >> 3) & 0x03); datap += GETLEN2b((packet_flags >> 3) & 0x03);
send_time = get_long_le(datap); send_time = get_long_le(datap);
datap += 4; datap += 4;

View file

@ -529,14 +529,13 @@ spx_int32_t *seed
VARDECL(int *ind); VARDECL(int *ind);
VARDECL(int *signs); VARDECL(int *signs);
const signed char *shape_cb; const signed char *shape_cb;
int shape_cb_size, subvect_size, nb_subvect; int subvect_size, nb_subvect;
const split_cb_params *params; const split_cb_params *params;
int have_sign; int have_sign;
params = (const split_cb_params *) par; params = (const split_cb_params *) par;
subvect_size = params->subvect_size; subvect_size = params->subvect_size;
nb_subvect = params->nb_subvect; nb_subvect = params->nb_subvect;
shape_cb_size = 1<<params->shape_bits;
shape_cb = params->shape_cb; shape_cb = params->shape_cb;
have_sign = params->have_sign; have_sign = params->have_sign;

View file

@ -1002,11 +1002,12 @@ void *nb_decoder_init(const SpeexMode *m)
void nb_decoder_destroy(void *state) void nb_decoder_destroy(void *state)
{ {
#if !(defined(VAR_ARRAYS) || defined (USE_ALLOCA))
DecState *st; DecState *st;
st=(DecState*)state; st=(DecState*)state;
#if !(defined(VAR_ARRAYS) || defined (USE_ALLOCA))
speex_free_scratch(st->stack); speex_free_scratch(st->stack);
#else
(void)state;
#endif #endif
/* /*
speex_free (st->excBuf); speex_free (st->excBuf);
@ -1315,7 +1316,6 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
{ {
int offset; int offset;
spx_word16_t *exc; spx_word16_t *exc;
spx_word16_t *sp;
spx_word16_t *innov_save = NULL; spx_word16_t *innov_save = NULL;
spx_word16_t tmp; spx_word16_t tmp;
@ -1323,8 +1323,7 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
offset = st->subframeSize*sub; offset = st->subframeSize*sub;
/* Excitation */ /* Excitation */
exc=st->exc+offset; exc=st->exc+offset;
/* Original signal */
sp=out+offset;
if (st->innov_save) if (st->innov_save)
innov_save = st->innov_save+offset; innov_save = st->innov_save+offset;
@ -1517,13 +1516,11 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
{ {
int offset; int offset;
spx_word16_t *sp; spx_word16_t *sp;
spx_word16_t *exc;
/* Offset relative to start of frame */ /* Offset relative to start of frame */
offset = st->subframeSize*sub; offset = st->subframeSize*sub;
/* Original signal */ /* Original signal */
sp=out+offset; sp=out+offset;
/* Excitation */
exc=st->exc+offset;
/* LSP interpolation (quantized and unquantized) */ /* LSP interpolation (quantized and unquantized) */
lsp_interpolate(st->old_qlsp, qlsp, interp_qlsp, st->lpcSize, sub, st->nbSubframes); lsp_interpolate(st->old_qlsp, qlsp, interp_qlsp, st->lpcSize, sub, st->nbSubframes);

View file

@ -598,7 +598,7 @@ static inline fixed32 pow_m1_4(WMADecodeContext *s, fixed32 x)
static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len) static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len)
{ {
fixed32 wdel, a, b, temp2; fixed32 wdel, a, b, temp2;
int i, m; int i;
wdel = fixdiv32(itofix32(1), itofix32(frame_len)); wdel = fixdiv32(itofix32(1), itofix32(frame_len));
for (i=0; i<frame_len; ++i) for (i=0; i<frame_len; ++i)
@ -620,7 +620,6 @@ static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len)
/*double check this later*/ /*double check this later*/
for(i=(1 << LSP_POW_BITS) - 1;i>=0;i--) for(i=(1 << LSP_POW_BITS) - 1;i>=0;i--)
{ {
m = (1 << LSP_POW_BITS) + i;
a = pow_a_table[ix++]<<4; a = pow_a_table[ix++]<<4;
((fixed32*)s->lsp_pow_m_table1)[i] = 2 * a - b; ((fixed32*)s->lsp_pow_m_table1)[i] = 2 * a - b;
((fixed32*)s->lsp_pow_m_table2)[i] = b - a; ((fixed32*)s->lsp_pow_m_table2)[i] = b - a;

View file

@ -270,7 +270,6 @@ static inline unsigned char get_bit(unsigned long val, unsigned char b)
static inline int GenerateDigi(int sIn) static inline int GenerateDigi(int sIn)
{ {
static int last_sample = 0;
static int sample = 0; static int sample = 0;
if (!sample_active) return(sIn); if (!sample_active) return(sIn);
@ -285,8 +284,6 @@ static inline int GenerateDigi(int sIn)
{ {
fracPos%=mixing_frequency; fracPos%=mixing_frequency;
last_sample = sample;
// N<>hstes Samples holen // N<>hstes Samples holen
if (sample_order == 0) { if (sample_order == 0) {
sample_nibble++; // Nähstes Sample-Nibble sample_nibble++; // Nähstes Sample-Nibble

View file

@ -396,7 +396,9 @@ enum codec_status codec_run(void)
int samplerate = ci->id3->frequency; int samplerate = ci->id3->frequency;
int extra_headers = 0; int extra_headers = 0;
int stream_init = 0; int stream_init = 0;
/* rockbox: comment 'set but unused' variables
int page_nb_packets; int page_nb_packets;
*/
int frame_size; int frame_size;
int packet_count = 0; int packet_count = 0;
int lookahead; int lookahead;
@ -465,7 +467,7 @@ next_page:
spx_ogg_stream_pagein(&os, &og); spx_ogg_stream_pagein(&os, &og);
page_granule = spx_ogg_page_granulepos(&og); page_granule = spx_ogg_page_granulepos(&og);
page_nb_packets = spx_ogg_page_packets(&og); /* page_nb_packets = spx_ogg_page_packets(&og); */
cur_granule = page_granule; cur_granule = page_granule;

View file

@ -51,7 +51,10 @@ enum codec_status codec_run(void)
{ {
WavpackContext *wpc; WavpackContext *wpc;
char error [80]; char error [80];
int bps, nchans, sr_100; /* rockbox: comment 'set but unused' variables
int bps;
*/
int nchans, sr_100;
intptr_t param; intptr_t param;
if (codec_init()) if (codec_init())
@ -67,7 +70,7 @@ enum codec_status codec_run(void)
ci->configure(DSP_SWITCH_FREQUENCY, WavpackGetSampleRate (wpc)); ci->configure(DSP_SWITCH_FREQUENCY, WavpackGetSampleRate (wpc));
codec_set_replaygain(ci->id3); codec_set_replaygain(ci->id3);
bps = WavpackGetBytesPerSample (wpc); /* bps = WavpackGetBytesPerSample (wpc); */
nchans = WavpackGetReducedChannels (wpc); nchans = WavpackGetReducedChannels (wpc);
ci->configure(DSP_SET_STEREO_MODE, nchans == 2 ? STEREO_INTERLEAVED : STEREO_MONO); ci->configure(DSP_SET_STEREO_MODE, nchans == 2 ? STEREO_INTERLEAVED : STEREO_MONO);
sr_100 = ci->id3->frequency / 100; sr_100 = ci->id3->frequency / 100;

View file

@ -44,7 +44,6 @@ enum codec_status codec_run(void)
{ {
uint32_t elapsedtime; uint32_t elapsedtime;
asf_waveformatex_t wfx; /* Holds the stream properties */ asf_waveformatex_t wfx; /* Holds the stream properties */
size_t resume_offset;
int res; /* Return values from asf_read_packet() and decode_packet() */ int res; /* Return values from asf_read_packet() and decode_packet() */
uint8_t* audiobuf; /* Pointer to the payload of one wma pro packet */ uint8_t* audiobuf; /* Pointer to the payload of one wma pro packet */
int audiobufsize; /* Payload size */ int audiobufsize; /* Payload size */
@ -55,9 +54,6 @@ enum codec_status codec_run(void)
int size; /* Size of the input frame to the decoder */ int size; /* Size of the input frame to the decoder */
intptr_t param; intptr_t param;
/* Remember the resume position */
resume_offset = ci->id3->offset;
restart_track: restart_track:
if (codec_init()) { if (codec_init()) {
LOGF("(WMA PRO) Error: Error initialising codec\n"); LOGF("(WMA PRO) Error: Error initialising codec\n");
@ -82,7 +78,6 @@ restart_track:
ci->seek_buffer(ci->id3->first_frame_offset); ci->seek_buffer(ci->id3->first_frame_offset);
elapsedtime = 0; elapsedtime = 0;
resume_offset = 0;
/* The main decoding loop */ /* The main decoding loop */

View file

@ -171,7 +171,6 @@ static void gui_quickscreen_draw(const struct gui_quickscreen *qs,
int i; int i;
char buf[MAX_PATH]; char buf[MAX_PATH];
unsigned const char *title, *value; unsigned const char *title, *value;
void *setting;
int temp; int temp;
display->set_viewport(parent); display->set_viewport(parent);
display->clear_viewport(); display->clear_viewport();
@ -184,7 +183,6 @@ static void gui_quickscreen_draw(const struct gui_quickscreen *qs,
display->set_viewport(vp); display->set_viewport(vp);
title = P2STR(ID2P(qs->items[i]->lang_id)); title = P2STR(ID2P(qs->items[i]->lang_id));
setting = qs->items[i]->setting;
temp = option_value_as_int(qs->items[i]); temp = option_value_as_int(qs->items[i]);
value = option_get_valuestring(qs->items[i], value = option_get_valuestring(qs->items[i],
buf, MAX_PATH, temp); buf, MAX_PATH, temp);

View file

@ -1257,14 +1257,13 @@ int create_empty_slide(bool force)
{ {
if ( force || ! rb->file_exists( EMPTY_SLIDE ) ) { if ( force || ! rb->file_exists( EMPTY_SLIDE ) ) {
struct bitmap input_bmp; struct bitmap input_bmp;
int ret;
input_bmp.width = DISPLAY_WIDTH; input_bmp.width = DISPLAY_WIDTH;
input_bmp.height = DISPLAY_HEIGHT; input_bmp.height = DISPLAY_HEIGHT;
#if LCD_DEPTH > 1 #if LCD_DEPTH > 1
input_bmp.format = FORMAT_NATIVE; input_bmp.format = FORMAT_NATIVE;
#endif #endif
input_bmp.data = (char*)buf; input_bmp.data = (char*)buf;
ret = scaled_read_bmp_file(EMPTY_SLIDE_BMP, &input_bmp, scaled_read_bmp_file(EMPTY_SLIDE_BMP, &input_bmp,
buf_size, buf_size,
FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT, FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT,
&format_transposed); &format_transposed);

View file

@ -492,7 +492,6 @@ int read_bmp_fd(int fd,
#if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \ #if (LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)) && \
defined(HAVE_BMP_SCALING) || defined(PLUGIN) defined(HAVE_BMP_SCALING) || defined(PLUGIN)
unsigned int resize = IMG_NORESIZE; unsigned int resize = IMG_NORESIZE;
bool transparent = false;
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
bool remote = false; bool remote = false;
@ -508,9 +507,6 @@ int read_bmp_fd(int fd,
resize = IMG_RESIZE; resize = IMG_RESIZE;
} }
if (format & FORMAT_TRANSPARENT) {
transparent = true;
}
#else #else
(void)format; (void)format;