aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-05-15 01:20:39 -0700
committerChris Robinson <[email protected]>2018-05-15 01:20:39 -0700
commit197e88cdcc62ac1c9e8be2240c52c4f108ac27b6 (patch)
tree2d0c42563e77612bba4dc51caf70358ffd54f083
parent4ac488991265ce212109e7b419f18399d3b75ee9 (diff)
Avoid using unsigned values for signed
-rw-r--r--Alc/effects/pshifter.c2
-rw-r--r--OpenAL32/Include/alMain.h10
2 files changed, 11 insertions, 1 deletions
diff --git a/Alc/effects/pshifter.c b/Alc/effects/pshifter.c
index 7411f705..9c2bb2e9 100644
--- a/Alc/effects/pshifter.c
+++ b/Alc/effects/pshifter.c
@@ -125,7 +125,7 @@ static inline ALint double2int(ALdouble d)
if(UNLIKELY(shift >= 63 || shift < -52))
return 0;
- mant = (conv.i64&U64(0xfffffffffffff)) | U64(0x10000000000000);
+ mant = (conv.i64&I64(0xfffffffffffff)) | I64(0x10000000000000);
if(LIKELY(shift < 0))
return (ALint)(mant >> -shift) * sign;
return (ALint)(mant << shift) * sign;
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 14deb227..886f3ab1 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -115,6 +115,16 @@ typedef ALuint64SOFT ALuint64;
#endif
#endif
+#ifndef I64
+#if defined(_MSC_VER)
+#define I64(x) ((ALint64)(x##i64))
+#elif SIZEOF_LONG == 8
+#define I64(x) ((ALint64)(x##l))
+#elif SIZEOF_LONG_LONG == 8
+#define I64(x) ((ALint64)(x##ll))
+#endif
+#endif
+
/* Define a CTZ64 macro (count trailing zeros, for 64-bit integers). The result
* is *UNDEFINED* if the value is 0.
*/