summaryrefslogtreecommitdiff
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
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
-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)
34{ 34{
35 /* Use the trackname part of the id3 structure as a temporary buffer */ 35 /* Use the trackname part of the id3 structure as a temporary buffer */
36 unsigned char * buf = (unsigned char *)id3->path; 36 unsigned char * buf = (unsigned char *)id3->path;
37 int chanstart, channels, read_bytes; 37 int chanstart, channels;
38 int looping = 0, start_adr = 0, end_adr = 0; 38 int looping = 0, start_adr = 0, end_adr = 0;
39 39
40 /* try to get the basic header */ 40 /* try to get the basic header */
41 if ((lseek(fd, 0, SEEK_SET) < 0) 41 if ((lseek(fd, 0, SEEK_SET) < 0)
42 || ((read_bytes = read(fd, buf, 0x38)) < 0x38)) 42 || (read(fd, buf, 0x38) < 0x38))
43 { 43 {
44 DEBUGF("lseek or read failed\n"); 44 DEBUGF("lseek or read failed\n");
45 return false; 45 return false;
@@ -106,7 +106,7 @@ bool get_adx_metadata(int fd, struct mp3entry* id3)
106 106
107 /* try to get the channel header */ 107 /* try to get the channel header */
108 if ((lseek(fd, chanstart-6, SEEK_SET) < 0) 108 if ((lseek(fd, chanstart-6, SEEK_SET) < 0)
109 || ((read_bytes = read(fd, buf, 6)) < 6)) 109 || (read(fd, buf, 6) < 6))
110 { 110 {
111 return false; 111 return false;
112 } 112 }
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)
40 unsigned long numChannels = 0; 40 unsigned long numChannels = 0;
41 unsigned long numSampleFrames = 0; 41 unsigned long numSampleFrames = 0;
42 unsigned long numbytes = 0; 42 unsigned long numbytes = 0;
43 int read_bytes;
44 bool is_aifc = false; 43 bool is_aifc = false;
45 44
46 if ((lseek(fd, 0, SEEK_SET) < 0) || (read(fd, &buf[0], 12) < 12) || 45 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)
50 return false; 49 return false;
51 } 50 }
52 51
53 while((read_bytes = read(fd, &buf[0], 8)) == 8) 52 while (read(fd, &buf[0], 8) == 8)
54 { 53 {
55 size_t size = get_long_be(&buf[4]); /* chunkSize */ 54 size_t size = get_long_be(&buf[4]); /* chunkSize */
56 55
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)
14{ 14{
15 /* Use the trackname part of the id3 structure as a temporary buffer */ 15 /* Use the trackname part of the id3 structure as a temporary buffer */
16 unsigned char* buf = (unsigned char *)id3->path; 16 unsigned char* buf = (unsigned char *)id3->path;
17 int read_bytes;
18 char *p; 17 char *p;
19 18
20
21 if ((lseek(fd, 0, SEEK_SET) < 0) 19 if ((lseek(fd, 0, SEEK_SET) < 0)
22 || ((read_bytes = read(fd, buf, 110)) < 110)) 20 || (read(fd, buf, 110) < 110))
23 { 21 {
24 return false; 22 return false;
25 } 23 }
@@ -55,7 +53,6 @@ bool get_nsf_metadata(int fd, struct mp3entry* id3)
55 /* Copyright (per codec) */ 53 /* Copyright (per codec) */
56 memcpy(p, &buf[78], 32); 54 memcpy(p, &buf[78], 32);
57 id3->album = p; 55 id3->album = p;
58 p += strlen(p)+1;
59 56
60 return true; 57 return true;
61} 58}
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)
36{ 36{
37 /* Use the trackname part of the id3 structure as a temporary buffer */ 37 /* Use the trackname part of the id3 structure as a temporary buffer */
38 unsigned char* buf = (unsigned char *)id3->path; 38 unsigned char* buf = (unsigned char *)id3->path;
39 int read_bytes;
40 char *p; 39 char *p;
41 40
42 41
43 if ((lseek(fd, 0, SEEK_SET) < 0) 42 if ((lseek(fd, 0, SEEK_SET) < 0)
44 || ((read_bytes = read(fd, buf, 0x80)) < 0x80)) 43 || (read(fd, buf, 0x80) < 0x80))
45 { 44 {
46 return false; 45 return false;
47 } 46 }
@@ -70,7 +69,7 @@ bool get_sid_metadata(int fd, struct mp3entry* id3)
70 /* Copy Album (assumed max 0x1f-0x05 letters + 1 zero byte) */ 69 /* Copy Album (assumed max 0x1f-0x05 letters + 1 zero byte) */
71 id3->album = p; 70 id3->album = p;
72 buf[0x56+0x1f] = 0; 71 buf[0x56+0x1f] = 0;
73 p = iso_decode(&buf[0x5b], p, 0, strlen(&buf[0x5b])+1); 72 iso_decode(&buf[0x5b], p, 0, strlen(&buf[0x5b])+1);
74 73
75 id3->bitrate = 706; 74 id3->bitrate = 706;
76 id3->frequency = 44100; 75 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)
35{ 35{
36 /* Use the trackname part of the id3 structure as a temporary buffer */ 36 /* Use the trackname part of the id3 structure as a temporary buffer */
37 unsigned char * buf = (unsigned char *)id3->path; 37 unsigned char * buf = (unsigned char *)id3->path;
38 int read_bytes;
39 char * p; 38 char * p;
40 39
41 unsigned long length; 40 unsigned long length;
@@ -45,7 +44,7 @@ bool get_spc_metadata(int fd, struct mp3entry* id3)
45 44
46 /* try to get the ID666 tag */ 45 /* try to get the ID666 tag */
47 if ((lseek(fd, 0x2e, SEEK_SET) < 0) 46 if ((lseek(fd, 0x2e, SEEK_SET) < 0)
48 || ((read_bytes = read(fd, buf, 0xD2)) < 0xD2)) 47 || (read(fd, buf, 0xD2) < 0xD2))
49 { 48 {
50 DEBUGF("lseek or read failed\n"); 49 DEBUGF("lseek or read failed\n");
51 return false; 50 return false;
@@ -115,7 +114,7 @@ bool get_spc_metadata(int fd, struct mp3entry* id3)
115 114
116 id3->artist = p; 115 id3->artist = p;
117 buf[31] = 0; 116 buf[31] = 0;
118 p = iso_decode(buf, p, 0, 32); 117 iso_decode(buf, p, 0, 32);
119 118
120 if (length==0) { 119 if (length==0) {
121 length=3*60*1000; /* 3 minutes */ 120 length=3*60*1000; /* 3 minutes */