diff options
author | Nils Wallménius <nils@rockbox.org> | 2009-02-08 11:09:55 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2009-02-08 11:09:55 +0000 |
commit | 5a55772201829dc0055cc8d3022cc475ccbc2643 (patch) | |
tree | 65440f5944388c9db3a439df7f37a75e5431709d /apps/metadata/metadata_common.c | |
parent | eda5ed06244abba643e09a775d71542d91691d4d (diff) | |
download | rockbox-5a55772201829dc0055cc8d3022cc475ccbc2643.tar.gz rockbox-5a55772201829dc0055cc8d3022cc475ccbc2643.zip |
Small code reuse improvement
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19943 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/metadata/metadata_common.c')
-rw-r--r-- | apps/metadata/metadata_common.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/apps/metadata/metadata_common.c b/apps/metadata/metadata_common.c index 94ff212cea..09f0f94a88 100644 --- a/apps/metadata/metadata_common.c +++ b/apps/metadata/metadata_common.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "metadata_common.h" | 29 | #include "metadata_common.h" |
30 | #include "metadata_parsers.h" | 30 | #include "metadata_parsers.h" |
31 | #include "replaygain.h" | 31 | #include "replaygain.h" |
32 | #include "misc.h" | ||
32 | 33 | ||
33 | /* Skip an ID3v2 tag if it can be found. We assume the tag is located at the | 34 | /* Skip an ID3v2 tag if it can be found. We assume the tag is located at the |
34 | * start of the file, which should be true in all cases where we need to skip it. | 35 | * start of the file, which should be true in all cases where we need to skip it. |
@@ -173,16 +174,6 @@ long get_slong(void* buf) | |||
173 | return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); | 174 | return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); |
174 | } | 175 | } |
175 | 176 | ||
176 | static char* skip_space(char* str) | ||
177 | { | ||
178 | while (isspace(*str)) | ||
179 | { | ||
180 | str++; | ||
181 | } | ||
182 | |||
183 | return str; | ||
184 | } | ||
185 | |||
186 | unsigned long get_itunes_int32(char* value, int count) | 177 | unsigned long get_itunes_int32(char* value, int count) |
187 | { | 178 | { |
188 | static const char hexdigits[] = "0123456789ABCDEF"; | 179 | static const char hexdigits[] = "0123456789ABCDEF"; |
@@ -191,7 +182,7 @@ unsigned long get_itunes_int32(char* value, int count) | |||
191 | 182 | ||
192 | while (count-- > 0) | 183 | while (count-- > 0) |
193 | { | 184 | { |
194 | value = skip_space(value); | 185 | value = skip_whitespace(value); |
195 | 186 | ||
196 | while (*value && !isspace(*value)) | 187 | while (*value && !isspace(*value)) |
197 | { | 188 | { |
@@ -199,7 +190,7 @@ unsigned long get_itunes_int32(char* value, int count) | |||
199 | } | 190 | } |
200 | } | 191 | } |
201 | 192 | ||
202 | value = skip_space(value); | 193 | value = skip_whitespace(value); |
203 | 194 | ||
204 | while (*value && ((c = strchr(hexdigits, toupper(*value))) != NULL)) | 195 | while (*value && ((c = strchr(hexdigits, toupper(*value))) != NULL)) |
205 | { | 196 | { |