summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2011-04-06 21:08:31 +0000
committerBjörn Stenberg <bjorn@haxx.se>2011-04-06 21:08:31 +0000
commit2d00f0c8b25d4a513ac9e4a78f25b528a01cb0fc (patch)
tree5aac90ad9ea5356d8fc6510619a9e14b0eb016aa /apps
parent2c297760df2d512841d6ad1cb38d09b574530cef (diff)
downloadrockbox-2d00f0c8b25d4a513ac9e4a78f25b528a01cb0fc.tar.gz
rockbox-2d00f0c8b25d4a513ac9e4a78f25b528a01cb0fc.zip
Removed some dead code identified by clang-analyzer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29685 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/metadata/adx.c6
-rw-r--r--apps/metadata/aiff.c3
-rw-r--r--apps/metadata/nsf.c5
-rw-r--r--apps/metadata/sid.c5
-rw-r--r--apps/metadata/spc.c5
5 files changed, 9 insertions, 15 deletions
diff --git a/apps/metadata/adx.c b/apps/metadata/adx.c
index a903a6d053..4e18254d79 100644
--- a/apps/metadata/adx.c
+++ b/apps/metadata/adx.c
@@ -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;
}
diff --git a/apps/metadata/aiff.c b/apps/metadata/aiff.c
index 6c16a3c226..654f37cf98 100644
--- a/apps/metadata/aiff.c
+++ b/apps/metadata/aiff.c
@@ -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 */
diff --git a/apps/metadata/nsf.c b/apps/metadata/nsf.c
index e1ad331d75..abb4e6fd80 100644
--- a/apps/metadata/nsf.c
+++ b/apps/metadata/nsf.c
@@ -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;
}
diff --git a/apps/metadata/sid.c b/apps/metadata/sid.c
index d4e6627778..50b879b56d 100644
--- a/apps/metadata/sid.c
+++ b/apps/metadata/sid.c
@@ -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;
diff --git a/apps/metadata/spc.c b/apps/metadata/spc.c
index f1fcb81707..1c0206205d 100644
--- a/apps/metadata/spc.c
+++ b/apps/metadata/spc.c
@@ -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 */