fixed -Wshadow warnings
Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7143 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:

committed by
Eric Wong

parent
28008e6977
commit
07adb14e3c
@@ -62,12 +62,12 @@ static int flacFindVorbisCommentFloat(const FLAC__StreamMetadata * block,
|
||||
- pos;
|
||||
if (len > 0) {
|
||||
unsigned char tmp;
|
||||
unsigned char *dup = &(block->data.vorbis_comment.
|
||||
comments[offset].entry[pos]);
|
||||
tmp = dup[len];
|
||||
dup[len] = '\0';
|
||||
*fl = atof((char *)dup);
|
||||
dup[len] = tmp;
|
||||
unsigned char *p = &(block->data.vorbis_comment.
|
||||
comments[offset].entry[pos]);
|
||||
tmp = p[len];
|
||||
p[len] = '\0';
|
||||
*fl = atof((char *)p);
|
||||
p[len] = tmp;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@@ -33,16 +33,16 @@
|
||||
|
||||
static int getAudiofileTotalTime(char *file)
|
||||
{
|
||||
int time;
|
||||
int total_time;
|
||||
AFfilehandle af_fp = afOpenFile(file, "r", NULL);
|
||||
if (af_fp == AF_NULL_FILEHANDLE) {
|
||||
return -1;
|
||||
}
|
||||
time = (int)
|
||||
total_time = (int)
|
||||
((double)afGetFrameCount(af_fp, AF_DEFAULT_TRACK)
|
||||
/ afGetRate(af_fp, AF_DEFAULT_TRACK));
|
||||
afCloseFile(af_fp);
|
||||
return time;
|
||||
return total_time;
|
||||
}
|
||||
|
||||
static int audiofile_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
|
||||
@@ -134,12 +134,12 @@ static int audiofile_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
|
||||
static MpdTag *audiofileTagDup(char *file)
|
||||
{
|
||||
MpdTag *ret = NULL;
|
||||
int time = getAudiofileTotalTime(file);
|
||||
int total_time = getAudiofileTotalTime(file);
|
||||
|
||||
if (time >= 0) {
|
||||
if (total_time >= 0) {
|
||||
if (!ret)
|
||||
ret = newMpdTag();
|
||||
ret->time = time;
|
||||
ret->time = total_time;
|
||||
} else {
|
||||
DEBUG
|
||||
("audiofileTagDup: Failed to get total song time from: %s\n",
|
||||
|
@@ -166,7 +166,7 @@ static void mod_close(mod_Data * data)
|
||||
static int mod_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
|
||||
{
|
||||
mod_Data *data;
|
||||
float time = 0.0;
|
||||
float total_time = 0.0;
|
||||
int ret;
|
||||
float secPerByte;
|
||||
|
||||
@@ -203,10 +203,10 @@ static int mod_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
|
||||
break;
|
||||
|
||||
ret = VC_WriteBytes(data->audio_buffer, MIKMOD_FRAME_SIZE);
|
||||
time += ret * secPerByte;
|
||||
total_time += ret * secPerByte;
|
||||
sendDataToOutputBuffer(cb, NULL, dc, 0,
|
||||
(char *)data->audio_buffer, ret, time,
|
||||
0, NULL);
|
||||
(char *)data->audio_buffer, ret,
|
||||
total_time, 0, NULL);
|
||||
}
|
||||
|
||||
flushOutputBuffer(cb);
|
||||
|
@@ -69,7 +69,7 @@ static signed long audio_linear_dither(unsigned int bits, mad_fixed_t sample,
|
||||
struct audio_dither *dither)
|
||||
{
|
||||
unsigned int scalebits;
|
||||
mad_fixed_t output, mask, random;
|
||||
mad_fixed_t output, mask, rnd;
|
||||
|
||||
enum {
|
||||
MIN = -MAD_F_ONE,
|
||||
@@ -86,10 +86,10 @@ static signed long audio_linear_dither(unsigned int bits, mad_fixed_t sample,
|
||||
scalebits = MAD_F_FRACBITS + 1 - bits;
|
||||
mask = (1L << scalebits) - 1;
|
||||
|
||||
random = prng(dither->random);
|
||||
output += (random & mask) - (dither->random & mask);
|
||||
rnd = prng(dither->random);
|
||||
output += (rnd & mask) - (dither->random & mask);
|
||||
|
||||
dither->random = random;
|
||||
dither->random = rnd;
|
||||
|
||||
if (output > MAX) {
|
||||
output = MAX;
|
||||
@@ -1093,16 +1093,16 @@ static int mp3_decode(OutputBuffer * cb, DecoderControl * dc,
|
||||
static MpdTag *mp3_tagDup(char *file)
|
||||
{
|
||||
MpdTag *ret = NULL;
|
||||
int time;
|
||||
int total_time;
|
||||
|
||||
ret = id3Dup(file);
|
||||
|
||||
time = getMp3TotalTime(file);
|
||||
total_time = getMp3TotalTime(file);
|
||||
|
||||
if (time >= 0) {
|
||||
if (total_time >= 0) {
|
||||
if (!ret)
|
||||
ret = newMpdTag();
|
||||
ret->time = time;
|
||||
ret->time = total_time;
|
||||
} else {
|
||||
DEBUG("mp3_tagDup: Failed to get total song time from: %s\n",
|
||||
file);
|
||||
|
@@ -134,7 +134,7 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
|
||||
unsigned long samplePos = 0;
|
||||
mpc_uint32_t vbrUpdateAcc;
|
||||
mpc_uint32_t vbrUpdateBits;
|
||||
float time;
|
||||
float total_time;
|
||||
int i;
|
||||
ReplayGainInfo *replayGainInfo = NULL;
|
||||
|
||||
@@ -218,7 +218,7 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
|
||||
s16++;
|
||||
|
||||
if (chunkpos >= MPC_CHUNK_SIZE) {
|
||||
time = ((float)samplePos) /
|
||||
total_time = ((float)samplePos) /
|
||||
dc->audioFormat.sampleRate;
|
||||
|
||||
bitRate = vbrUpdateBits *
|
||||
@@ -227,7 +227,7 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
|
||||
sendDataToOutputBuffer(cb, inStream, dc,
|
||||
inStream->seekable,
|
||||
chunk, chunkpos,
|
||||
time,
|
||||
total_time,
|
||||
bitRate, replayGainInfo);
|
||||
|
||||
chunkpos = 0;
|
||||
@@ -241,13 +241,13 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
|
||||
}
|
||||
|
||||
if (!dc->stop && chunkpos > 0) {
|
||||
time = ((float)samplePos) / dc->audioFormat.sampleRate;
|
||||
total_time = ((float)samplePos) / dc->audioFormat.sampleRate;
|
||||
|
||||
bitRate =
|
||||
vbrUpdateBits * dc->audioFormat.sampleRate / 1152 / 1000;
|
||||
|
||||
sendDataToOutputBuffer(cb, NULL, dc, inStream->seekable,
|
||||
chunk, chunkpos, time, bitRate,
|
||||
chunk, chunkpos, total_time, bitRate,
|
||||
replayGainInfo);
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
|
||||
static float mpcGetTime(char *file)
|
||||
{
|
||||
InputStream inStream;
|
||||
float time = -1;
|
||||
float total_time = -1;
|
||||
|
||||
mpc_reader reader;
|
||||
mpc_streaminfo info;
|
||||
@@ -289,19 +289,19 @@ static float mpcGetTime(char *file)
|
||||
return -1;
|
||||
}
|
||||
|
||||
time = mpc_streaminfo_get_length(&info);
|
||||
total_time = mpc_streaminfo_get_length(&info);
|
||||
|
||||
closeInputStream(&inStream);
|
||||
|
||||
return time;
|
||||
return total_time;
|
||||
}
|
||||
|
||||
static MpdTag *mpcTagDup(char *file)
|
||||
{
|
||||
MpdTag *ret = NULL;
|
||||
float time = mpcGetTime(file);
|
||||
float total_time = mpcGetTime(file);
|
||||
|
||||
if (time < 0) {
|
||||
if (total_time < 0) {
|
||||
DEBUG("mpcTagDup: Failed to get Songlength of file: %s\n",
|
||||
file);
|
||||
return NULL;
|
||||
@@ -312,7 +312,7 @@ static MpdTag *mpcTagDup(char *file)
|
||||
ret = id3Dup(file);
|
||||
if (!ret)
|
||||
ret = newMpdTag();
|
||||
ret->time = time;
|
||||
ret->time = total_time;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user