summaryrefslogtreecommitdiff
path: root/apps/codecs/libwavpack
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2005-02-25 17:19:32 +0000
committerChristian Gmeiner <christian.gmeiner@gmail.com>2005-02-25 17:19:32 +0000
commitc3e55c01a53f005b8f6042755a83bb7059f98e7b (patch)
tree2c3f7f99844f852a52283ce6df8614e513910c49 /apps/codecs/libwavpack
parente449d88b3e6b584998f8f38ed61467c35ca74466 (diff)
downloadrockbox-c3e55c01a53f005b8f6042755a83bb7059f98e7b.tar.gz
rockbox-c3e55c01a53f005b8f6042755a83bb7059f98e7b.zip
changes to compile without warnings
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6057 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwavpack')
-rw-r--r--apps/codecs/libwavpack/metadata.c2
-rw-r--r--apps/codecs/libwavpack/unpack.c7
-rw-r--r--apps/codecs/libwavpack/wavpack.h7
3 files changed, 8 insertions, 8 deletions
diff --git a/apps/codecs/libwavpack/metadata.c b/apps/codecs/libwavpack/metadata.c
index 40ede99cd4..661b25edc8 100644
--- a/apps/codecs/libwavpack/metadata.c
+++ b/apps/codecs/libwavpack/metadata.c
@@ -40,7 +40,7 @@ int read_metadata_buff (WavpackContext *wpc, WavpackMetadata *wpmd)
40 wpmd->byte_length--; 40 wpmd->byte_length--;
41 } 41 }
42 42
43 if (wpmd->byte_length && wpmd->byte_length <= sizeof (wpc->read_buffer)) { 43 if (wpmd->byte_length && wpmd->byte_length <= (long)sizeof (wpc->read_buffer)) {
44 ulong bytes_to_read = wpmd->byte_length + (wpmd->byte_length & 1); 44 ulong bytes_to_read = wpmd->byte_length + (wpmd->byte_length & 1);
45 45
46 if (wpc->infile (wpc->read_buffer, bytes_to_read) != (long) bytes_to_read) { 46 if (wpc->infile (wpc->read_buffer, bytes_to_read) != (long) bytes_to_read) {
diff --git a/apps/codecs/libwavpack/unpack.c b/apps/codecs/libwavpack/unpack.c
index e2e27b4999..917f487b20 100644
--- a/apps/codecs/libwavpack/unpack.c
+++ b/apps/codecs/libwavpack/unpack.c
@@ -17,6 +17,7 @@
17 17
18#include <string.h> 18#include <string.h>
19#include <math.h> 19#include <math.h>
20#include <stdlib.h>
20 21
21#define LOSSY_MUTE 22#define LOSSY_MUTE
22 23
@@ -513,6 +514,7 @@ static void fixup_samples (WavpackStream *wps, long *buffer, ulong sample_count)
513 514
514 if (flags & HYBRID_FLAG) { 515 if (flags & HYBRID_FLAG) {
515 long min_value, max_value, min_shifted, max_shifted; 516 long min_value, max_value, min_shifted, max_shifted;
517 min_value = max_value = min_shifted = max_shifted = 0;
516 518
517 switch (flags & BYTES_STORED) { 519 switch (flags & BYTES_STORED) {
518 case 0: 520 case 0:
@@ -531,8 +533,9 @@ static void fixup_samples (WavpackStream *wps, long *buffer, ulong sample_count)
531 break; 533 break;
532 534
533 case 3: 535 case 3:
534 min_shifted = (min_value = -(long)2147483648 >> shift) << shift; 536 // 0x80000000 is the same as 2147483648
535 max_shifted = (max_value = (long) 2147483647 >> shift) << shift; 537 min_shifted = (min_value = -0x80000000 >> shift) << shift;
538 max_shifted = (max_value = 0x80000000 >> shift) << shift;
536 break; 539 break;
537 } 540 }
538 541
diff --git a/apps/codecs/libwavpack/wavpack.h b/apps/codecs/libwavpack/wavpack.h
index af9d88dfe6..98dba8631b 100644
--- a/apps/codecs/libwavpack/wavpack.h
+++ b/apps/codecs/libwavpack/wavpack.h
@@ -8,18 +8,15 @@
8 8
9// wavpack.h 9// wavpack.h
10 10
11#include <sys/types.h> 11#include <inttypes.h>
12 12
13// This header file contains all the definitions required by WavPack. 13// This header file contains all the definitions required by WavPack.
14 14
15// not sure about them.. testing will bring more light into it..
15typedef unsigned char uchar; 16typedef unsigned char uchar;
16#if !defined(__GNUC__) || defined(WIN32)
17typedef unsigned short ushort; 17typedef unsigned short ushort;
18typedef unsigned long ulong; 18typedef unsigned long ulong;
19typedef unsigned int uint; 19typedef unsigned int uint;
20#elif defined(__APPLE__)
21typedef unsigned long ulong;
22#endif
23 20
24// This structure is used to access the individual fields of 32-bit ieee 21// This structure is used to access the individual fields of 32-bit ieee
25// floating point numbers. This will not be compatible with compilers that 22// floating point numbers. This will not be compatible with compilers that