aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-08-19 22:31:55 -0700
committerChris Robinson <[email protected]>2012-08-19 22:31:55 -0700
commitf5e0500df4ce3852ffaece6bb916c294ed17f525 (patch)
tree36caf96a542963996a5ca5876053c228d393251c
parent37924887e8ff84082bc948b46a664e03663ff670 (diff)
Add a macro to help make a 64-bit value
-rw-r--r--Alc/backends/pulseaudio.c2
-rw-r--r--OpenAL32/Include/alMain.h2
-rw-r--r--OpenAL32/alSource.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c
index 059f841a..accfae73 100644
--- a/Alc/backends/pulseaudio.c
+++ b/Alc/backends/pulseaudio.c
@@ -1390,7 +1390,7 @@ static ALint64 pulse_get_latency(ALCdevice *device)
{
if(neg)
latency = 0;
- return (ALint64)minu64(latency, (((ALuint64)0x7fffffff << 32)|0xffffffff)/1000) * 1000;
+ return (ALint64)minu64(latency, MAKEU64(0x7fffffff,0xffffffff)/1000) * 1000;
}
ERR("Failed to get stream latency!\n");
return 0;
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index ef8b8cb7..303a990b 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -74,6 +74,8 @@ typedef unsigned long long ALuint64;
typedef ptrdiff_t ALintptrEXT;
typedef ptrdiff_t ALsizeiptrEXT;
+#define MAKEU64(x,y) (((ALuint64)(x)<<32)|(ALuint64)(y))
+
#ifdef HAVE_GCC_FORMAT
#define PRINTF_STYLE(x, y) __attribute__((format(printf, (x), (y))))
#else
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 8ff8a3b1..0192b5ef 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -1828,7 +1828,7 @@ static ALint64 GetSourceOffset(ALsource *Source)
BufferList = BufferList->next;
}
- return (ALint64)minu64(readPos, ((ALuint64)0x7fffffff<<32)|0xffffffff);
+ return (ALint64)minu64(readPos, MAKEU64(0x7fffffff,0xffffffff));
}
/* GetSourceOffsets