- removed some long longs, to reduce that type's use to the necessary minimum

.
This commit is contained in:
Christoph Oelckers 2017-03-09 20:05:22 +01:00
parent d2beacfc5f
commit a17685f3fd
5 changed files with 24 additions and 24 deletions

View file

@ -85,7 +85,7 @@ void gl_CalculateCPUSpeed ()
{
LARGE_INTEGER count1, count2;
unsigned minDiff;
long long ClockCalibration = 0;
int64_t ClockCalibration = 0;
// Count cycles for at least 55 milliseconds.
// The performance counter is very low resolution compared to CPU

View file

@ -12,7 +12,7 @@ extern double gl_MillisecPerCycle;
#ifdef _MSC_VER
__forceinline long long GetClockCycle ()
__forceinline int64_t GetClockCycle ()
{
#if _M_X64
return __rdtsc();
@ -23,18 +23,18 @@ __forceinline long long GetClockCycle ()
#elif defined __APPLE__ && (defined __i386__ || defined __x86_64__)
inline long long GetClockCycle()
inline int64_t GetClockCycle()
{
return __builtin_ia32_rdtsc();
}
#elif defined(__GNUG__) && defined(__i386__)
inline long long GetClockCycle()
inline int64_t GetClockCycle()
{
if (CPU.bRDTSC)
{
long long res;
int64_t res;
asm volatile ("rdtsc" : "=A" (res));
return res;
}
@ -46,7 +46,7 @@ inline long long GetClockCycle()
#else
inline long long GetClockCycle ()
inline int64_t GetClockCycle ()
{
return 0;
}
@ -71,13 +71,13 @@ public:
// Not using QueryPerformanceCounter directly, so we don't need
// to pull in the Windows headers for every single file that
// wants to do some profiling.
long long time = (gl_benching? GetClockCycle() : 0);
int64_t time = (gl_benching? GetClockCycle() : 0);
Counter -= time;
}
__forceinline void Unclock()
{
long long time = (gl_benching? GetClockCycle() : 0);
int64_t time = (gl_benching? GetClockCycle() : 0);
Counter += time;
}
@ -92,7 +92,7 @@ public:
}
private:
long long Counter;
int64_t Counter;
};
extern glcycle_t RenderWall,SetupWall,ClipWall;

View file

@ -2159,7 +2159,7 @@ FISoundChannel *FMODSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener *
void FMODSoundRenderer::MarkStartTime(FISoundChannel *chan)
{
#if FMOD_STUDIO
unsigned long long int dsp_time;
uint64_t dsp_time;
((FMOD::Channel *)chan->SysChannel)->getDSPClock(&dsp_time,NULL);
chan->StartTime.Lo = dsp_time & 0xFFFFFFFF;
chan->StartTime.Hi = dsp_time >> 32;
@ -2186,7 +2186,7 @@ bool FMODSoundRenderer::HandleChannelDelay(FMOD::Channel *chan, FISoundChannel *
// it would be in now if it had never been evicted.
QWORD_UNION nowtime;
#if FMOD_STUDIO
unsigned long long int delay;
uint64_t delay;
chan->getDelay(&delay,NULL,NULL);
nowtime.Lo = delay & 0xFFFFFFFF;
nowtime.Hi = delay >> 32;
@ -2332,7 +2332,7 @@ FISoundChannel *FMODSoundRenderer::CommonChannelSetup(FMOD::Channel *chan, FISou
{
schan = S_GetChannel(chan);
#if FMOD_STUDIO
unsigned long long int time;
uint64_t time;
chan->getDelay(&time,NULL,NULL);
schan->StartTime.Lo = time & 0xFFFFFFFF;
schan->StartTime.Hi = time >> 32;
@ -2701,7 +2701,7 @@ void FMODSoundRenderer::Sync(bool sync)
{
Sys->lockDSP();
#if FMOD_STUDIO
unsigned long long int clock;
uint64_t clock;
SfxGroup->getDSPClock(&clock,NULL);
DSPClock.Lo = clock & 0xFFFFFFFF;
DSPClock.Hi = clock >> 32;
@ -2726,7 +2726,7 @@ void FMODSoundRenderer::UpdateSounds()
// Any sounds played between now and the next call to this function
// will start exactly one tic from now.
#if FMOD_STUDIO
unsigned long long int clock;
uint64_t clock;
SfxGroup->getDSPClock(&clock,NULL);
DSPClock.Lo = clock & 0xFFFFFFFF;
DSPClock.Hi = clock >> 32;

View file

@ -124,16 +124,16 @@ inline unsigned __int64 rdtsc()
return 0;
}
#else
inline unsigned long long rdtsc()
inline uint64_t rdtsc()
{
#ifdef __amd64__
unsigned long long tsc;
uint64_t tsc;
asm volatile ("rdtsc; shlq $32, %%rdx; orq %%rdx, %%rax" : "=a" (tsc) :: "%rdx");
return tsc;
#else // i386
if (CPU.bRDTSC)
{
unsigned long long tsc;
uint64_t tsc;
asm volatile ("\trdtsc\n" : "=A" (tsc));
return tsc;
}
@ -158,13 +158,13 @@ public:
void Clock()
{
long long time = rdtsc();
int64_t time = rdtsc();
Counter -= time;
}
void Unclock()
{
long long time = rdtsc();
int64_t time = rdtsc();
Counter += time;
}
@ -178,13 +178,13 @@ public:
return Counter * PerfToMillisec;
}
long long GetRawCounter()
int64_t GetRawCounter()
{
return Counter;
}
private:
long long Counter;
int64_t Counter;
};
#endif

View file

@ -285,14 +285,14 @@ void DoBlending_SSE2(const PalEntry *from, PalEntry *to, int count, int r, int g
unaligned = ((size_t)from | (size_t)to) & 0xF;
#if defined(__amd64__) || defined(_M_X64)
long long color;
int64_t color;
blending256 = _mm_set_epi64x(0x10001000100ll, 0x10001000100ll);
color = ((long long)r << 32) | (g << 16) | b;
color = ((int64_t)r << 32) | (g << 16) | b;
blendcolor = _mm_set_epi64x(color, color);
color = ((long long)a << 32) | (a << 16) | a;
color = ((int64_t)a << 32) | (a << 16) | a;
blendalpha = _mm_set_epi64x(color, color);
#else
int color;