Use a simpler U64 macro to make 64-bit constants

This commit is contained in:
Chris Robinson 2013-10-06 04:21:03 -07:00
parent 69e64e1ed2
commit 9ee3d01f6e
3 changed files with 13 additions and 3 deletions

View File

@ -1426,7 +1426,7 @@ static ALint64 pulse_get_latency(ALCdevice *device)
{
if(neg)
latency = 0;
return (ALint64)minu64(latency, MAKEU64(0x7fffffff,0xffffffff)/1000) * 1000;
return (ALint64)minu64(latency, U64(0x7fffffffffffffff)/1000) * 1000;
}
ERR("Failed to get stream latency!\n");
return 0;

View File

@ -46,7 +46,17 @@ typedef unsigned long long ALuint64;
typedef ptrdiff_t ALintptrEXT;
typedef ptrdiff_t ALsizeiptrEXT;
#define MAKEU64(x,y) (((ALuint64)(x)<<32)|(ALuint64)(y))
#ifndef U64
#if !defined(_MSC_VER)
#if SIZEOF_LONG_LONG == 8
#define U64(x) ((ALuint64)(x##ull))
#elif SIZEOF_LONG == 8
#define U64(x) ((ALuint64)(x##ul))
#endif
#else
#define U64(x) ((ALuint64)(x##ui64))
#endif
#endif
#ifdef HAVE_GCC_FORMAT
#define PRINTF_STYLE(x, y) __attribute__((format(printf, (x), (y))))

View File

@ -2430,7 +2430,7 @@ static ALint64 GetSourceOffset(const ALsource *Source)
BufferList = BufferList->next;
}
return (ALint64)minu64(readPos, MAKEU64(0x7fffffff,0xffffffff));
return (ALint64)minu64(readPos, U64(0x7fffffffffffffff));
}
/* GetSourceSecOffset