summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)
wpmd->byte_length--;
}
- if (wpmd->byte_length && wpmd->byte_length <= sizeof (wpc->read_buffer)) {
+ if (wpmd->byte_length && wpmd->byte_length <= (long)sizeof (wpc->read_buffer)) {
ulong bytes_to_read = wpmd->byte_length + (wpmd->byte_length & 1);
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 @@
#include <string.h>
#include <math.h>
+#include <stdlib.h>
#define LOSSY_MUTE
@@ -513,6 +514,7 @@ static void fixup_samples (WavpackStream *wps, long *buffer, ulong sample_count)
if (flags & HYBRID_FLAG) {
long min_value, max_value, min_shifted, max_shifted;
+ min_value = max_value = min_shifted = max_shifted = 0;
switch (flags & BYTES_STORED) {
case 0:
@@ -531,8 +533,9 @@ static void fixup_samples (WavpackStream *wps, long *buffer, ulong sample_count)
break;
case 3:
- min_shifted = (min_value = -(long)2147483648 >> shift) << shift;
- max_shifted = (max_value = (long) 2147483647 >> shift) << shift;
+ // 0x80000000 is the same as 2147483648
+ min_shifted = (min_value = -0x80000000 >> shift) << shift;
+ max_shifted = (max_value = 0x80000000 >> shift) << shift;
break;
}
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 @@
// wavpack.h
-#include <sys/types.h>
+#include <inttypes.h>
// This header file contains all the definitions required by WavPack.
+// not sure about them.. testing will bring more light into it..
typedef unsigned char uchar;
-#if !defined(__GNUC__) || defined(WIN32)
typedef unsigned short ushort;
typedef unsigned long ulong;
typedef unsigned int uint;
-#elif defined(__APPLE__)
-typedef unsigned long ulong;
-#endif
// This structure is used to access the individual fields of 32-bit ieee
// floating point numbers. This will not be compatible with compilers that