Removed some dead code identified by clang-analyzer.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29685 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2011-04-06 21:08:31 +00:00
parent 2c297760df
commit 2d00f0c8b2
5 changed files with 9 additions and 15 deletions

View File

@ -34,12 +34,12 @@ bool get_adx_metadata(int fd, struct mp3entry* id3)
{
/* Use the trackname part of the id3 structure as a temporary buffer */
unsigned char * buf = (unsigned char *)id3->path;
int chanstart, channels, read_bytes;
int chanstart, channels;
int looping = 0, start_adr = 0, end_adr = 0;
/* try to get the basic header */
if ((lseek(fd, 0, SEEK_SET) < 0)
|| ((read_bytes = read(fd, buf, 0x38)) < 0x38))
|| (read(fd, buf, 0x38) < 0x38))
{
DEBUGF("lseek or read failed\n");
return false;
@ -106,7 +106,7 @@ bool get_adx_metadata(int fd, struct mp3entry* id3)
/* try to get the channel header */
if ((lseek(fd, chanstart-6, SEEK_SET) < 0)
|| ((read_bytes = read(fd, buf, 6)) < 6))
|| (read(fd, buf, 6) < 6))
{
return false;
}

View File

@ -40,7 +40,6 @@ bool get_aiff_metadata(int fd, struct mp3entry* id3)
unsigned long numChannels = 0;
unsigned long numSampleFrames = 0;
unsigned long numbytes = 0;
int read_bytes;
bool is_aifc = false;
if ((lseek(fd, 0, SEEK_SET) < 0) || (read(fd, &buf[0], 12) < 12) ||
@ -50,7 +49,7 @@ bool get_aiff_metadata(int fd, struct mp3entry* id3)
return false;
}
while((read_bytes = read(fd, &buf[0], 8)) == 8)
while (read(fd, &buf[0], 8) == 8)
{
size_t size = get_long_be(&buf[4]); /* chunkSize */

View File

@ -14,12 +14,10 @@ bool get_nsf_metadata(int fd, struct mp3entry* id3)
{
/* Use the trackname part of the id3 structure as a temporary buffer */
unsigned char* buf = (unsigned char *)id3->path;
int read_bytes;
char *p;
if ((lseek(fd, 0, SEEK_SET) < 0)
|| ((read_bytes = read(fd, buf, 110)) < 110))
|| (read(fd, buf, 110) < 110))
{
return false;
}
@ -55,7 +53,6 @@ bool get_nsf_metadata(int fd, struct mp3entry* id3)
/* Copyright (per codec) */
memcpy(p, &buf[78], 32);
id3->album = p;
p += strlen(p)+1;
return true;
}

View File

@ -36,12 +36,11 @@ bool get_sid_metadata(int fd, struct mp3entry* id3)
{
/* Use the trackname part of the id3 structure as a temporary buffer */
unsigned char* buf = (unsigned char *)id3->path;
int read_bytes;
char *p;
if ((lseek(fd, 0, SEEK_SET) < 0)
|| ((read_bytes = read(fd, buf, 0x80)) < 0x80))
|| (read(fd, buf, 0x80) < 0x80))
{
return false;
}
@ -70,7 +69,7 @@ bool get_sid_metadata(int fd, struct mp3entry* id3)
/* Copy Album (assumed max 0x1f-0x05 letters + 1 zero byte) */
id3->album = p;
buf[0x56+0x1f] = 0;
p = iso_decode(&buf[0x5b], p, 0, strlen(&buf[0x5b])+1);
iso_decode(&buf[0x5b], p, 0, strlen(&buf[0x5b])+1);
id3->bitrate = 706;
id3->frequency = 44100;

View File

@ -35,7 +35,6 @@ bool get_spc_metadata(int fd, struct mp3entry* id3)
{
/* Use the trackname part of the id3 structure as a temporary buffer */
unsigned char * buf = (unsigned char *)id3->path;
int read_bytes;
char * p;
unsigned long length;
@ -45,7 +44,7 @@ bool get_spc_metadata(int fd, struct mp3entry* id3)
/* try to get the ID666 tag */
if ((lseek(fd, 0x2e, SEEK_SET) < 0)
|| ((read_bytes = read(fd, buf, 0xD2)) < 0xD2))
|| (read(fd, buf, 0xD2) < 0xD2))
{
DEBUGF("lseek or read failed\n");
return false;
@ -115,7 +114,7 @@ bool get_spc_metadata(int fd, struct mp3entry* id3)
id3->artist = p;
buf[31] = 0;
p = iso_decode(buf, p, 0, 32);
iso_decode(buf, p, 0, 32);
if (length==0) {
length=3*60*1000; /* 3 minutes */