summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/libmusepack/internal.h9
-rw-r--r--apps/codecs/wav.c2
-rw-r--r--apps/metadata.c4
-rw-r--r--apps/plugins/midi/guspat.c7
4 files changed, 6 insertions, 16 deletions
diff --git a/apps/codecs/libmusepack/internal.h b/apps/codecs/libmusepack/internal.h
index a912bfc0ab..27656d5a54 100644
--- a/apps/codecs/libmusepack/internal.h
+++ b/apps/codecs/libmusepack/internal.h
@@ -42,15 +42,6 @@ enum {
42 MPC_DECODER_SYNTH_DELAY = 481 42 MPC_DECODER_SYNTH_DELAY = 481
43}; 43};
44 44
45/// Big/little endian 32 bit byte swapping routine.
46static inline
47mpc_uint32_t swap32(mpc_uint32_t val) {
48 const unsigned char* src = (const unsigned char*)&val;
49 return
50 (mpc_uint32_t)src[0] |
51 ((mpc_uint32_t)src[1] << 8) | ((mpc_uint32_t)src[2] << 16) | ((mpc_uint32_t)src[3] << 24);
52}
53
54/// Searches for a ID3v2-tag and reads the length (in bytes) of it. 45/// Searches for a ID3v2-tag and reads the length (in bytes) of it.
55/// \param reader supplying raw stream data 46/// \param reader supplying raw stream data
56/// \return size of tag, in bytes 47/// \return size of tag, in bytes
diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c
index 36076caf25..2806409dd5 100644
--- a/apps/codecs/wav.c
+++ b/apps/codecs/wav.c
@@ -482,7 +482,7 @@ enum codec_status codec_start(struct codec_api* api)
482 else if (bitspersample > 8) { 482 else if (bitspersample > 8) {
483 /* Byte-swap data. */ 483 /* Byte-swap data. */
484 for (i=0;i<n/2;i++) { 484 for (i=0;i<n/2;i++) {
485 int16_samples[i]=(int16_t)SWAB16(wavbuf[i]); 485 int16_samples[i]=(int16_t)letoh16(wavbuf[i]);
486 } 486 }
487 wavbufsize = n; 487 wavbufsize = n;
488 } 488 }
diff --git a/apps/metadata.c b/apps/metadata.c
index 0cf0890886..86e0887231 100644
--- a/apps/metadata.c
+++ b/apps/metadata.c
@@ -152,7 +152,7 @@ static void convert_endian(void *data, const char *format)
152 { 152 {
153 long* d = (long*) data; 153 long* d = (long*) data;
154 154
155 *d = SWAB32(*d); 155 *d = letoh32(*d);
156 data = d + 1; 156 data = d + 1;
157 } 157 }
158 158
@@ -162,7 +162,7 @@ static void convert_endian(void *data, const char *format)
162 { 162 {
163 short* d = (short*) data; 163 short* d = (short*) data;
164 164
165 *d = SWAB16(*d); 165 *d = letoh16(*d);
166 data = d + 1; 166 data = d + 1;
167 } 167 }
168 168
diff --git a/apps/plugins/midi/guspat.c b/apps/plugins/midi/guspat.c
index 23b6811542..6f1866cd58 100644
--- a/apps/plugins/midi/guspat.c
+++ b/apps/plugins/midi/guspat.c
@@ -97,12 +97,11 @@ struct GWaveform * loadWaveform(int file)
97 */ 97 */
98 98
99 99
100 /* Iriver needs byteswapping.. big endian, go figure. Gus files are little endian */ 100#ifdef ROCKBOX_BIG_ENDIAN
101 101 /* Byte-swap if necessary. Gus files are little endian */
102#if !defined(SIMULATOR)
103 for(a=0; a<wav->numSamples; a++) 102 for(a=0; a<wav->numSamples; a++)
104 { 103 {
105 ((unsigned short *) wav->data)[a] = SWAB16(((unsigned short *) wav->data)[a]); 104 ((unsigned short *) wav->data)[a] = letoh16(((unsigned short *) wav->data)[a]);
106 } 105 }
107#endif 106#endif
108 107