From a6a60e2e56001f80d67206fde8952a63f9f591be Mon Sep 17 00:00:00 2001 From: sukibaby <163092272+sukibaby@users.noreply.github.com> Date: Sat, 5 Oct 2024 20:48:43 -0700 Subject: [PATCH] Remove std prefix from int types std::int* -> int* --- src/CreateZip.cpp | 2 +- src/Model.cpp | 4 +- src/ModelTypes.h | 4 +- src/NoteDataUtil.cpp | 2 +- src/NoteDisplay.cpp | 2 +- src/RageFile.cpp | 12 ++--- src/RageFile.h | 4 +- src/RageFileDriverDeflate.cpp | 4 +- src/RageSound.cpp | 12 ++--- src/RageSound.h | 12 ++--- src/RageSoundManager.cpp | 2 +- src/RageSoundManager.h | 2 +- src/RageSoundMixBuffer.cpp | 2 +- src/RageSoundMixBuffer.h | 2 +- src/RageSoundPosMap.cpp | 18 ++++---- src/RageSoundPosMap.h | 4 +- src/RageSoundReader_Chain.h | 2 +- src/RageSoundReader_Preload.cpp | 6 +-- src/RageSoundReader_Resample_Good.cpp | 4 +- src/RageSoundReader_Vorbisfile.cpp | 6 +-- src/RageSoundReader_WAV.cpp | 46 +++++++++---------- src/RageSoundReader_WAV.h | 4 +- src/RageSoundUtil.cpp | 4 +- src/RageSoundUtil.h | 4 +- src/RageSurface.cpp | 12 ++--- src/RageSurface.h | 14 +++--- src/RageSurfaceUtils_Dither.cpp | 4 +- src/RageSurfaceUtils_Palettize.cpp | 4 +- src/RageSurface_Load_JPEG.cpp | 2 +- src/RageSurface_Load_PNG.cpp | 2 +- src/RageSurface_Load_XPM.cpp | 6 +-- src/RageTimer.cpp | 10 ++-- src/RageTypes.h | 2 +- src/ScoreKeeperNormal.cpp | 8 ++-- src/arch/ArchHooks/ArchHooks.h | 6 +-- src/arch/ArchHooks/ArchHooksUtil.cpp | 18 ++++---- src/arch/ArchHooks/ArchHooks_MacOSX.mm | 4 +- src/arch/ArchHooks/ArchHooks_Unix.cpp | 8 ++-- src/arch/ArchHooks/ArchHooks_Unix.h | 2 +- src/arch/ArchHooks/ArchHooks_Win32Static.cpp | 2 +- src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 2 +- src/arch/Sound/ALSA9Helpers.cpp | 4 +- src/arch/Sound/ALSA9Helpers.h | 8 ++-- src/arch/Sound/DSoundHelpers.cpp | 4 +- src/arch/Sound/DSoundHelpers.h | 8 ++-- src/arch/Sound/RageSoundDriver.h | 24 +++++----- .../Sound/RageSoundDriver_ALSA9_Software.cpp | 12 ++--- .../Sound/RageSoundDriver_ALSA9_Software.h | 2 +- src/arch/Sound/RageSoundDriver_AU.h | 2 +- src/arch/Sound/RageSoundDriver_AU.mm | 8 ++-- .../Sound/RageSoundDriver_DSound_Software.cpp | 6 +-- .../Sound/RageSoundDriver_DSound_Software.h | 2 +- .../RageSoundDriver_Generic_Software.cpp | 28 +++++------ src/arch/Sound/RageSoundDriver_JACK.cpp | 2 +- src/arch/Sound/RageSoundDriver_JACK.h | 2 +- src/arch/Sound/RageSoundDriver_Null.cpp | 4 +- src/arch/Sound/RageSoundDriver_Null.h | 4 +- src/arch/Sound/RageSoundDriver_OSS.cpp | 6 +-- src/arch/Sound/RageSoundDriver_OSS.h | 2 +- src/arch/Sound/RageSoundDriver_PulseAudio.cpp | 18 ++++---- src/arch/Sound/RageSoundDriver_PulseAudio.h | 6 +-- src/arch/Sound/RageSoundDriver_WDMKS.cpp | 26 +++++------ src/arch/Sound/RageSoundDriver_WDMKS.h | 2 +- src/arch/Sound/RageSoundDriver_WaveOut.cpp | 4 +- src/arch/Sound/RageSoundDriver_WaveOut.h | 2 +- src/archutils/Unix/Backtrace.cpp | 8 ++-- src/archutils/Unix/BacktraceNames.cpp | 8 ++-- src/archutils/Unix/BacktraceNames.h | 2 +- src/archutils/Win32/CrashHandlerChild.cpp | 10 ++-- src/archutils/Win32/GotoURL.cpp | 2 +- src/tests/test_audio_readers.cpp | 26 +++++------ 71 files changed, 256 insertions(+), 256 deletions(-) diff --git a/src/CreateZip.cpp b/src/CreateZip.cpp index 139b96d2fb..b662ab7e29 100644 --- a/src/CreateZip.cpp +++ b/src/CreateZip.cpp @@ -340,7 +340,7 @@ typedef unsigned IPos; // A Pos is an index in the character window. Pos is used -typedef std::int64_t lutime_t; // define it ourselves since we don't include time.h +typedef int64_t lutime_t; // define it ourselves since we don't include time.h typedef struct iztimes { lutime_t atime,mtime,ctime; diff --git a/src/Model.cpp b/src/Model.cpp index 880fc57fba..19a3295966 100644 --- a/src/Model.cpp +++ b/src/Model.cpp @@ -544,7 +544,7 @@ void Model::PlayAnimation( const RString &sAniName, float fPlayRate ) { // int iBoneIndex = (pMesh->m_iBoneIndex!=-1) ? pMesh->m_iBoneIndex : bone; RageVector3 &pos = Vertices[j].p; - std::int8_t bone = Vertices[j].bone; + int8_t bone = Vertices[j].bone; if( bone != -1 ) { pos[0] -= m_vpBones[bone].m_Absolute.m[3][0]; @@ -701,7 +701,7 @@ void Model::UpdateTempGeometry() RageVector3 &tempNormal = tempVertices[j].n; const RageVector3 &originalPos = origVertices[j].p; const RageVector3 &originalNormal = origVertices[j].n; - std::int8_t bone = origVertices[j].bone; + int8_t bone = origVertices[j].bone; if( bone == -1 ) { diff --git a/src/ModelTypes.h b/src/ModelTypes.h index dae1caddad..4171beb5d5 100644 --- a/src/ModelTypes.h +++ b/src/ModelTypes.h @@ -17,14 +17,14 @@ struct msTriangle struct msMesh { RString sName; - std::int8_t nMaterialIndex; + int8_t nMaterialIndex; std::vector Vertices; // OPTIMIZATION: If all verts in a mesh are transformed by the same bone, // then send the transform to the graphics card for the whole mesh instead // of transforming each vertex on the CPU; - std::int8_t m_iBoneIndex; // -1 = no bone + int8_t m_iBoneIndex; // -1 = no bone std::vector Triangles; }; diff --git a/src/NoteDataUtil.cpp b/src/NoteDataUtil.cpp index 06ba566eec..a5ac6f543c 100644 --- a/src/NoteDataUtil.cpp +++ b/src/NoteDataUtil.cpp @@ -147,7 +147,7 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS int iHeadRow; if( !out.IsHoldNoteAtRow( iTrack, iIndex, &iHeadRow ) ) { - int n = std::intptr_t(endLine) - std::intptr_t(beginLine); + int n = intptr_t(endLine) - intptr_t(beginLine); LOG->Warn( "Unmatched 3 in \"%.*s\"", n, beginLine ); } else diff --git a/src/NoteDisplay.cpp b/src/NoteDisplay.cpp index 9be77bb913..0fc9500095 100644 --- a/src/NoteDisplay.cpp +++ b/src/NoteDisplay.cpp @@ -1361,7 +1361,7 @@ void NoteDisplay::DrawActor(const TapNote& tn, Actor* pActor, NotePart part, break; case NoteColorType_ProgressAlternate: fScaledBeat = fBeat * cache->m_iNoteColorCount[part]; - if( fScaledBeat - std::int64_t(fScaledBeat) == 0.0f ) + if( fScaledBeat - int64_t(fScaledBeat) == 0.0f ) //we're on a boundary, so move to the previous frame. //doing it this way ensures that fScaledBeat is never negative so std::fmod works. fScaledBeat += cache->m_iNoteColorCount[part] - 1; diff --git a/src/RageFile.cpp b/src/RageFile.cpp index 115312dce3..9dbc2f5414 100644 --- a/src/RageFile.cpp +++ b/src/RageFile.cpp @@ -287,10 +287,10 @@ uint16_t FileReading::read_u16_le( RageFileBasic &f, RString &sError ) return 0; } -std::int16_t FileReading::read_16_le( RageFileBasic &f, RString &sError ) +int16_t FileReading::read_16_le( RageFileBasic &f, RString &sError ) { - std::int16_t val; - ReadBytes( f, &val, sizeof(std::int16_t), sError ); + int16_t val; + ReadBytes( f, &val, sizeof(int16_t), sError ); if( sError.size() == 0 ) return Swap16LE( val ); else @@ -307,10 +307,10 @@ uint32_t FileReading::read_u32_le( RageFileBasic &f, RString &sError ) return 0; } -std::int32_t FileReading::read_32_le( RageFileBasic &f, RString &sError ) +int32_t FileReading::read_32_le( RageFileBasic &f, RString &sError ) { - std::int32_t val; - ReadBytes( f, &val, sizeof(std::int32_t), sError ); + int32_t val; + ReadBytes( f, &val, sizeof(int32_t), sError ); if( sError.size() == 0 ) return Swap32LE( val ); else diff --git a/src/RageFile.h b/src/RageFile.h index d7d41dae7b..c0e76eb422 100644 --- a/src/RageFile.h +++ b/src/RageFile.h @@ -104,9 +104,9 @@ namespace FileReading void Seek( RageFileBasic &f, int iOffset, RString &sError ); RString ReadString( RageFileBasic &f, int size, RString &sError ); uint8_t read_8( RageFileBasic &f, RString &sError ); - std::int16_t read_16_le( RageFileBasic &f, RString &sError ); + int16_t read_16_le( RageFileBasic &f, RString &sError ); uint16_t read_u16_le( RageFileBasic &f, RString &sError ); - std::int32_t read_32_le( RageFileBasic &f, RString &sError ); + int32_t read_32_le( RageFileBasic &f, RString &sError ); uint32_t read_u32_le( RageFileBasic &f, RString &sError ); }; diff --git a/src/RageFileDriverDeflate.cpp b/src/RageFileDriverDeflate.cpp index 1dfe86e574..91fd3bd2d2 100644 --- a/src/RageFileDriverDeflate.cpp +++ b/src/RageFileDriverDeflate.cpp @@ -366,7 +366,7 @@ RageFileObjInflate *GunzipFile( RageFileBasic *pFile_, RString &sError, uint32_t if( iFlags & FEXTRA ) { - std::int16_t iSize = FileReading::read_16_le( *pFile, sError ); + int16_t iSize = FileReading::read_16_le( *pFile, sError ); FileReading::SkipBytes( *pFile, iSize, sError ); } @@ -386,7 +386,7 @@ RageFileObjInflate *GunzipFile( RageFileBasic *pFile_, RString &sError, uint32_t ASSERT( bOK ); uint16_t iExpectedCRC16 = FileReading::read_u16_le( *pFile, sError ); - uint16_t iActualCRC16 = std::int16_t( iActualCRC32 & 0xFFFF ); + uint16_t iActualCRC16 = int16_t( iActualCRC32 & 0xFFFF ); if( sError != "" ) return nullptr; diff --git a/src/RageSound.cpp b/src/RageSound.cpp index 1c3bd07d98..04d5dfe435 100644 --- a/src/RageSound.cpp +++ b/src/RageSound.cpp @@ -266,7 +266,7 @@ void RageSound::LoadSoundReader( RageSoundReader *pSound ) * conditions are masked and will be seen on the next call. Otherwise, the requested * number of frames will always be returned. */ -int RageSound::GetDataToPlay( float *pBuffer, int iFrames, std::int64_t &iStreamFrame, int &iFramesStored ) +int RageSound::GetDataToPlay( float *pBuffer, int iFrames, int64_t &iStreamFrame, int &iFramesStored ) { /* We only update m_iStreamFrame; only take a shared lock, so we don't block the main thread. */ // LockMut(m_Mutex); @@ -316,7 +316,7 @@ int RageSound::GetDataToPlay( float *pBuffer, int iFrames, std::int64_t &iStream } /* Indicate that a block of audio data has been written to the device. */ -void RageSound::CommitPlayingPosition( std::int64_t iHardwareFrame, std::int64_t iStreamFrame, int iGotFrames ) +void RageSound::CommitPlayingPosition( int64_t iHardwareFrame, int64_t iStreamFrame, int iGotFrames ) { m_Mutex.Lock(); m_HardwareToStreamMap.Insert( iHardwareFrame, iGotFrames, iStreamFrame ); @@ -371,7 +371,7 @@ void RageSound::SoundIsFinishedPlaying() return; /* Get our current hardware position. */ - std::int64_t iCurrentHardwareFrame = SOUNDMAN->GetPosition(nullptr); + int64_t iCurrentHardwareFrame = SOUNDMAN->GetPosition(nullptr); m_Mutex.Lock(); @@ -473,12 +473,12 @@ float RageSound::GetLengthSeconds() return iLength / 1000.f; // ms -> secs } -int RageSound::GetSourceFrameFromHardwareFrame( std::int64_t iHardwareFrame ) const +int RageSound::GetSourceFrameFromHardwareFrame( int64_t iHardwareFrame ) const { if( m_HardwareToStreamMap.IsEmpty() || m_StreamToSourceMap.IsEmpty() ) return 0; - std::int64_t iStreamFrame = m_HardwareToStreamMap.Search( iHardwareFrame ); + int64_t iStreamFrame = m_HardwareToStreamMap.Search( iHardwareFrame ); return static_cast(m_StreamToSourceMap.Search( iStreamFrame )); } @@ -492,7 +492,7 @@ int RageSound::GetSourceFrameFromHardwareFrame( std::int64_t iHardwareFrame ) co float RageSound::GetPositionSeconds( RageTimer *pTimestamp ) const { // Get our current hardware position. - std::int64_t iCurrentHardwareFrame = SOUNDMAN->GetPosition(pTimestamp); + int64_t iCurrentHardwareFrame = SOUNDMAN->GetPosition(pTimestamp); // Lock the mutex after calling SOUNDMAN->GetPosition(). LockMut(m_Mutex); diff --git a/src/RageSound.h b/src/RageSound.h index 164d5f8505..852d897d47 100644 --- a/src/RageSound.h +++ b/src/RageSound.h @@ -18,8 +18,8 @@ class RageSoundBase public: virtual ~RageSoundBase() { } virtual void SoundIsFinishedPlaying() = 0; - virtual int GetDataToPlay( float *buffer, int size, std::int64_t &iStreamFrame, int &got_bytes ) = 0; - virtual void CommitPlayingPosition( std::int64_t iFrameno, std::int64_t iPosition, int iBytesRead ) = 0; + virtual int GetDataToPlay( float *buffer, int size, int64_t &iStreamFrame, int &got_bytes ) = 0; + virtual void CommitPlayingPosition( int64_t iFrameno, int64_t iPosition, int iBytesRead ) = 0; virtual RageTimer GetStartTime() const { return RageZeroTimer; } virtual RString GetLoadedFilePath() const = 0; }; @@ -161,7 +161,7 @@ private: /* Current position of the output sound, in frames. If < 0, nothing will play * until it becomes positive. */ - std::int64_t m_iStreamFrame; + int64_t m_iStreamFrame; /* Hack: When we stop a playing sound, we can't ask the driver the position * (we're not playing); and we can't seek back to the current playing position @@ -175,7 +175,7 @@ private: RString m_sError; - int GetSourceFrameFromHardwareFrame( std::int64_t iHardwareFrame ) const; + int GetSourceFrameFromHardwareFrame( int64_t iHardwareFrame ) const; bool SetPositionFrames( int frames = -1 ); RageSoundParams::StopMode_t GetStopMode() const; // resolves M_AUTO @@ -189,8 +189,8 @@ public: * it signals the stream to stop; once it's flushed, SoundStopped will be * called. Until then, SOUNDMAN->GetPosition can still be called; the sound * is still playing. */ - int GetDataToPlay( float *pBuffer, int iSize, std::int64_t &iStreamFrame, int &iBytesRead ); - void CommitPlayingPosition( std::int64_t iHardwareFrame, std::int64_t iStreamFrame, int iGotFrames ); + int GetDataToPlay( float *pBuffer, int iSize, int64_t &iStreamFrame, int &iBytesRead ); + void CommitPlayingPosition( int64_t iHardwareFrame, int64_t iStreamFrame, int iGotFrames ); }; #endif diff --git a/src/RageSoundManager.cpp b/src/RageSoundManager.cpp index e4770cc950..dcc426344a 100644 --- a/src/RageSoundManager.cpp +++ b/src/RageSoundManager.cpp @@ -89,7 +89,7 @@ bool RageSoundManager::Pause( RageSoundBase *pSound, bool bPause ) return m_pDriver->PauseMixing( pSound, bPause ); } -std::int64_t RageSoundManager::GetPosition( RageTimer *pTimer ) const +int64_t RageSoundManager::GetPosition( RageTimer *pTimer ) const { if( m_pDriver == nullptr ) return 0; diff --git a/src/RageSoundManager.h b/src/RageSoundManager.h index c5cb0f8fe4..5f79560193 100644 --- a/src/RageSoundManager.h +++ b/src/RageSoundManager.h @@ -39,7 +39,7 @@ public: void StartMixing( RageSoundBase *snd ); /* used by RageSound */ void StopMixing( RageSoundBase *snd ); /* used by RageSound */ bool Pause( RageSoundBase *snd, bool bPause ); /* used by RageSound */ - std::int64_t GetPosition( RageTimer *pTimer ) const; /* used by RageSound */ + int64_t GetPosition( RageTimer *pTimer ) const; /* used by RageSound */ float GetPlayLatency() const; int GetDriverSampleRate() const; diff --git a/src/RageSoundMixBuffer.cpp b/src/RageSoundMixBuffer.cpp index 741984d965..49f887ff20 100644 --- a/src/RageSoundMixBuffer.cpp +++ b/src/RageSoundMixBuffer.cpp @@ -72,7 +72,7 @@ void RageSoundMixBuffer::write( const float *pBuf, unsigned iSize, int iSourceSt } } -void RageSoundMixBuffer::read( std::int16_t *pBuf ) +void RageSoundMixBuffer::read( int16_t *pBuf ) { for( unsigned iPos = 0; iPos < m_iBufUsed; ++iPos ) { diff --git a/src/RageSoundMixBuffer.h b/src/RageSoundMixBuffer.h index 9307cb6ca7..b2d1b078b1 100644 --- a/src/RageSoundMixBuffer.h +++ b/src/RageSoundMixBuffer.h @@ -20,7 +20,7 @@ public: // Extend the buffer as if write() was called with a buffer of silence. void Extend( unsigned iSamples ); - void read( std::int16_t *pBuf ); + void read( int16_t *pBuf ); void read( float *pBuf ); void read_deinterlace( float **pBufs, int channels ); float *read() { return m_pMixbuf; } diff --git a/src/RageSoundPosMap.cpp b/src/RageSoundPosMap.cpp index 5208f2049e..ac2788e448 100644 --- a/src/RageSoundPosMap.cpp +++ b/src/RageSoundPosMap.cpp @@ -18,9 +18,9 @@ static int pos_map_backlog_frames = 80000; struct pos_map_t { - std::int64_t m_iSourceFrame; - std::int64_t m_iDestFrame; - std::int64_t m_iFrames; + int64_t m_iSourceFrame; + int64_t m_iDestFrame; + int64_t m_iFrames; double m_fSourceToDestRatio; pos_map_t() { m_iSourceFrame = 0; m_iDestFrame = 0; m_iFrames = 0; m_fSourceToDestRatio = 1.0; } @@ -59,7 +59,7 @@ pos_map_queue &pos_map_queue::operator=( const pos_map_queue &rhs ) return *this; } -void pos_map_queue::Insert(std::int64_t iSourceFrame, std::int64_t iFrames, std::int64_t iDestFrame, double fSourceToDestRatio) +void pos_map_queue::Insert(int64_t iSourceFrame, int64_t iFrames, int64_t iDestFrame, double fSourceToDestRatio) { bool merged = false; if (!m_pImpl->m_Queue.empty()) @@ -95,7 +95,7 @@ void pos_map_queue::Insert(std::int64_t iSourceFrame, std::int64_t iFrames, std: void pos_map_impl::Cleanup() { std::list::iterator it = m_Queue.end(); - std::int64_t iTotalFrames = 0; + int64_t iTotalFrames = 0; // Scan backwards until we have at least pos_map_backlog_frames. while (iTotalFrames < pos_map_backlog_frames) { @@ -108,7 +108,7 @@ void pos_map_impl::Cleanup() m_Queue.erase(m_Queue.begin(), it); } -std::int64_t pos_map_queue::Search( std::int64_t iSourceFrame ) const +int64_t pos_map_queue::Search( int64_t iSourceFrame ) const { if( IsEmpty() ) { @@ -116,7 +116,7 @@ std::int64_t pos_map_queue::Search( std::int64_t iSourceFrame ) const } // iSourceFrame is probably in pos_map. Search to figure out what position it maps to. - std::int64_t iClosestPosition = 0, iClosestPositionDist = std::numeric_limits::max(); + int64_t iClosestPosition = 0, iClosestPositionDist = std::numeric_limits::max(); for (pos_map_t const &pm : m_pImpl->m_Queue) { // Loop over the queue until we know generally where iSourceFrame is @@ -124,13 +124,13 @@ std::int64_t pos_map_queue::Search( std::int64_t iSourceFrame ) const iSourceFrame < pm.m_iSourceFrame+pm.m_iFrames ) { // If we are in the correct block, calculate its current position - std::int64_t iDiff = static_cast(iSourceFrame - pm.m_iSourceFrame); + int64_t iDiff = static_cast(iSourceFrame - pm.m_iSourceFrame); iDiff = static_cast(( iDiff * pm.m_fSourceToDestRatio) + 0.5 ); return pm.m_iDestFrame + iDiff; } // See if the current position is close to the beginning of this block. - std::int64_t dist = llabs( pm.m_iSourceFrame - iSourceFrame ); + int64_t dist = llabs( pm.m_iSourceFrame - iSourceFrame ); if( dist < iClosestPositionDist ) { iClosestPositionDist = dist; diff --git a/src/RageSoundPosMap.h b/src/RageSoundPosMap.h index 9bfedaf1cb..79c32cb4c1 100644 --- a/src/RageSoundPosMap.h +++ b/src/RageSoundPosMap.h @@ -16,10 +16,10 @@ public: /* Insert a mapping from iSourceFrame to iDestFrame, containing iFrames. * The double type is used to prevent precision loss leading to sync drift the longer the game runs. -sukibaby */ - void Insert( std::int64_t iSourceFrame, std::int64_t iFrames, std::int64_t iDestFrame, double fSourceToDestRatio = 1.0 ); + void Insert( int64_t iSourceFrame, int64_t iFrames, int64_t iDestFrame, double fSourceToDestRatio = 1.0 ); /* Return the iDestFrame for the given iSourceFrame. */ - std::int64_t Search( std::int64_t iSourceFrame ) const; + int64_t Search( int64_t iSourceFrame ) const; /* Erase all mappings. */ void Clear(); diff --git a/src/RageSoundReader_Chain.h b/src/RageSoundReader_Chain.h index 27d53cc687..0187a5fefc 100644 --- a/src/RageSoundReader_Chain.h +++ b/src/RageSoundReader_Chain.h @@ -62,7 +62,7 @@ private: float fPan; RageSoundReader *pSound; // nullptr if not activated - int GetOffsetFrame( int iSampleRate ) const { return int( std::int64_t(iOffsetMS) * iSampleRate / 1000 ); } + int GetOffsetFrame( int iSampleRate ) const { return int( int64_t(iOffsetMS) * iSampleRate / 1000 ); } bool operator<( const Sound &rhs ) const { return iOffsetMS < rhs.iOffsetMS; } }; std::vector m_aSounds; diff --git a/src/RageSoundReader_Preload.cpp b/src/RageSoundReader_Preload.cpp index 0ecc44f3c2..1c5fffc953 100644 --- a/src/RageSoundReader_Preload.cpp +++ b/src/RageSoundReader_Preload.cpp @@ -18,7 +18,7 @@ Preference g_bSoundPreload16bit( "SoundPreload16bit", true ); /* If a sound is smaller than this, we'll load it entirely into memory. */ Preference g_iSoundPreloadMaxSamples( "SoundPreloadMaxSamples", 1024*1024 ); -#define samplesize (m_bBufferIs16Bit? sizeof(std::int16_t):sizeof(float)) +#define samplesize (m_bBufferIs16Bit? sizeof(int16_t):sizeof(float)) #define framesize (samplesize * m_iChannels) bool RageSoundReader_Preload::PreloadSound( RageSoundReader *&pSound ) @@ -93,7 +93,7 @@ bool RageSoundReader_Preload::Open( RageSoundReader *pSource ) /* Add the buffer. */ if( m_bBufferIs16Bit ) { - std::int16_t buffer16[1024]; + int16_t buffer16[1024]; RageSoundUtil::ConvertFloatToNativeInt16( buffer, buffer16, iCnt*m_iChannels ); m_Buffer.Get()->append( (char *) buffer16, (char *) (buffer16+iCnt*m_iChannels) ); } @@ -152,7 +152,7 @@ int RageSoundReader_Preload::Read( float *pBuffer, int iFrames ) return END_OF_FILE; if( m_bBufferIs16Bit ) { - const std::int16_t *pIn = (const std::int16_t *) (m_Buffer->data() + (m_iPosition * framesize)); + const int16_t *pIn = (const int16_t *) (m_Buffer->data() + (m_iPosition * framesize)); RageSoundUtil::ConvertNativeInt16ToFloat( pIn, pBuffer, iFrames * m_iChannels ); } else diff --git a/src/RageSoundReader_Resample_Good.cpp b/src/RageSoundReader_Resample_Good.cpp index 641102fa6e..2c5fb8f272 100644 --- a/src/RageSoundReader_Resample_Good.cpp +++ b/src/RageSoundReader_Resample_Good.cpp @@ -548,7 +548,7 @@ private: int RageSoundReader_Resample_Good::GetNextSourceFrame() const { - std::int64_t iPosition = m_pSource->GetNextSourceFrame(); + int64_t iPosition = m_pSource->GetNextSourceFrame(); iPosition -= m_apResamplers[0]->GetFilled(); iPosition *= m_iSampleRate; @@ -648,7 +648,7 @@ RageSoundReader_Resample_Good::~RageSoundReader_Resample_Good() int RageSoundReader_Resample_Good::SetPosition( int iFrame ) { Reset(); - iFrame = (int) SCALE( iFrame, 0, (std::int64_t) m_iSampleRate, 0, (std::int64_t) m_pSource->GetSampleRate() ); + iFrame = (int) SCALE( iFrame, 0, (int64_t) m_iSampleRate, 0, (int64_t) m_pSource->GetSampleRate() ); return m_pSource->SetPosition( iFrame ); } diff --git a/src/RageSoundReader_Vorbisfile.cpp b/src/RageSoundReader_Vorbisfile.cpp index f238fd3e27..8090d73d78 100644 --- a/src/RageSoundReader_Vorbisfile.cpp +++ b/src/RageSoundReader_Vorbisfile.cpp @@ -185,7 +185,7 @@ int RageSoundReader_Vorbisfile::Read( float *buf, int iFrames ) { int bstream; #if defined(INTEGER_VORBIS) - int ret = ov_read( vf, (char *) buf, iFrames * channels * sizeof(std::int16_t), &bstream ); + int ret = ov_read( vf, (char *) buf, iFrames * channels * sizeof(int16_t), &bstream ); #else // float vorbis decoder float **pcm; int ret = ov_read_float( vf, &pcm, iFrames, &bstream ); @@ -218,11 +218,11 @@ int RageSoundReader_Vorbisfile::Read( float *buf, int iFrames ) #if defined(INTEGER_VORBIS) if( ret > 0 ) { - int iSamplesRead = ret / sizeof(std::int16_t); + int iSamplesRead = ret / sizeof(int16_t); iFramesRead = iSamplesRead / channels; /* Convert in reverse, so we can do it in-place. */ - const std::int16_t *pIn = (std::int16_t *) buf; + const int16_t *pIn = (int16_t *) buf; float *pOut = (float *) buf; for( int i = iSamplesRead-1; i >= 0; --i ) pOut[i] = pIn[i] / 32768.0f; diff --git a/src/RageSoundReader_WAV.cpp b/src/RageSoundReader_WAV.cpp index f4a1132981..9cfd9661d8 100644 --- a/src/RageSoundReader_WAV.cpp +++ b/src/RageSoundReader_WAV.cpp @@ -41,11 +41,11 @@ namespace void ConvertLittleEndian16BitToFloat( void *pBuf, int iSamples ) { /* Convert in reverse, so we can do it in-place. */ - const std::int16_t *pIn = (std::int16_t *) pBuf; + const int16_t *pIn = (int16_t *) pBuf; float *pOut = (float *) pBuf; for( int i = iSamples-1; i >= 0; --i ) { - std::int16_t iSample = Swap16LE( pIn[i] ); + int16_t iSample = Swap16LE( pIn[i] ); pOut[i] = iSample / 32768.0f; } } @@ -60,7 +60,7 @@ namespace { pIn -= 3; - std::int32_t iSample = + int32_t iSample = (int(pIn[0]) << 0) | (int(pIn[1]) << 8) | (int(pIn[2]) << 16); @@ -76,11 +76,11 @@ namespace void ConvertLittleEndian32BitToFloat( void *pBuf, int iSamples ) { /* Convert in reverse, so we can do it in-place. */ - const std::int32_t *pIn = (std::int32_t *) pBuf; + const int32_t *pIn = (int32_t *) pBuf; float *pOut = (float *) pBuf; for( int i = iSamples-1; i >= 0; --i ) { - std::int32_t iSample = Swap32LE( pIn[i] ); + int32_t iSample = Swap32LE( pIn[i] ); pOut[i] = iSample / 2147483648.0f; } } @@ -167,13 +167,13 @@ struct WavReaderPCM: public WavReader int GetLength() const { const int iBytesPerSec = m_WavData.m_iSampleRate * m_WavData.m_iChannels * m_WavData.m_iBitsPerSample / 8; - std::int64_t iMS = (std::int64_t(m_WavData.m_iDataChunkSize) * 1000) / iBytesPerSec; + int64_t iMS = (int64_t(m_WavData.m_iDataChunkSize) * 1000) / iBytesPerSec; return (int) iMS; } int SetPosition( int iFrame ) { - int iByte = (int) (std::int64_t(iFrame) * m_WavData.m_iChannels * m_WavData.m_iBitsPerSample / 8); + int iByte = (int) (int64_t(iFrame) * m_WavData.m_iChannels * m_WavData.m_iBitsPerSample / 8); if( iByte > m_WavData.m_iDataChunkSize ) { m_File.Seek( m_WavData.m_iDataChunkSize+m_WavData.m_iDataChunkPos ); @@ -196,8 +196,8 @@ struct WavReaderPCM: public WavReader struct WavReaderADPCM: public WavReader { public: - std::vector m_iaCoef1, m_iaCoef2; - std::int16_t m_iFramesPerBlock; + std::vector m_iaCoef1, m_iaCoef2; + int16_t m_iFramesPerBlock; float *m_pBuffer; int m_iBufferAvail, m_iBufferUsed; @@ -223,7 +223,7 @@ public: m_File.Seek( m_WavData.m_iExtraFmtPos ); m_iFramesPerBlock = FileReading::read_16_le( m_File, m_sError ); - std::int16_t iNumCoef = FileReading::read_16_le( m_File, m_sError ); + int16_t iNumCoef = FileReading::read_16_le( m_File, m_sError ); m_iaCoef1.resize( iNumCoef ); m_iaCoef2.resize( iNumCoef ); for( int i = 0; i < iNumCoef; ++i ) @@ -259,8 +259,8 @@ public: if( m_File.Tell() >= m_WavData.m_iDataChunkSize+m_WavData.m_iDataChunkPos || m_File.AtEOF() ) return true; /* past the data chunk */ - std::int8_t iPredictor[2]; - std::int16_t iDelta[2], iSamp1[2], iSamp2[2]; + int8_t iPredictor[2]; + int16_t iDelta[2], iSamp1[2], iSamp2[2]; for( int i = 0; i < m_WavData.m_iChannels; ++i ) iPredictor[i] = FileReading::read_8( m_File, m_sError ); for( int i = 0; i < m_WavData.m_iChannels; ++i ) @@ -304,11 +304,11 @@ public: } for( int i = 0; i < m_WavData.m_iChannels; ++i ) - pBuffer[m_iBufferAvail++] = (std::int16_t)iSamp2[i] / 32768.0f; + pBuffer[m_iBufferAvail++] = (int16_t)iSamp2[i] / 32768.0f; for( int i = 0; i < m_WavData.m_iChannels; ++i ) - pBuffer[m_iBufferAvail++] = (std::int16_t)iSamp1[i] / 32768.0f; + pBuffer[m_iBufferAvail++] = (int16_t)iSamp1[i] / 32768.0f; - std::int8_t iBufSize = 0; + int8_t iBufSize = 0; uint8_t iBuf = 0; bool bDone = false; @@ -330,24 +330,24 @@ public: } /* Store the nibble in signed char, so we get an arithmetic shift. */ - std::int8_t iErrorDelta = (std::int8_t)(iBuf) >> 4; + int8_t iErrorDelta = (int8_t)(iBuf) >> 4; uint8_t iErrorDeltaUnsigned = iBuf >> 4; iBuf <<= 4; --iBufSize; - std::int32_t iPredSample = (iSamp1[c] * iCoef1[c] + iSamp2[c] * iCoef2[c]) / (1<<8); + int32_t iPredSample = (iSamp1[c] * iCoef1[c] + iSamp2[c] * iCoef2[c]) / (1<<8); if( iPredSample < -32768 ) iPredSample = -32768; if( iPredSample > 32767 ) iPredSample = 32767; - std::int16_t iNewSample = (std::int16_t)iPredSample + (iDelta[c] * iErrorDelta); + int16_t iNewSample = (int16_t)iPredSample + (iDelta[c] * iErrorDelta); pBuffer[m_iBufferAvail++] = iNewSample / 32768.0f; static const int aAdaptionTable[] = { 230, 230, 230, 230, 307, 409, 512, 614, 768, 614, 512, 409, 307, 230, 230, 230 }; - iDelta[c] = std::int16_t( (iDelta[c] * aAdaptionTable[iErrorDeltaUnsigned]) / (1<<8) ); - iDelta[c] = std::max( (std::int16_t) 16, iDelta[c] ); + iDelta[c] = int16_t( (iDelta[c] * aAdaptionTable[iErrorDeltaUnsigned]) / (1<<8) ); + iDelta[c] = std::max( (int16_t) 16, iDelta[c] ); iSamp2[c] = iSamp1[c]; iSamp1[c] = iNewSample; @@ -402,7 +402,7 @@ public: iFrames += 2+iExtraADPCMFrames; } - int iMS = int((std::int64_t(iFrames)*1000)/m_WavData.m_iSampleRate); + int iMS = int((int64_t(iFrames)*1000)/m_WavData.m_iSampleRate); return iMS; } @@ -445,7 +445,7 @@ public: int iFrame = iBlock * m_iFramesPerBlock; int iBufferRemainingBytes = m_iBufferAvail - m_iBufferUsed; - int iBufferRemainingFrames = iBufferRemainingBytes / (m_WavData.m_iChannels * sizeof(std::int16_t)); + int iBufferRemainingFrames = iBufferRemainingBytes / (m_WavData.m_iChannels * sizeof(int16_t)); iFrame -= iBufferRemainingFrames; return iFrame; @@ -496,7 +496,7 @@ RageSoundReader_FileReader::OpenResult RageSoundReader_WAV::Open( RageFileBasic while( !bGotFormatChunk || !bGotDataChunk ) { RString ChunkID = ReadString( *m_pFile, 4, sError ); - std::int32_t iChunkSize = FileReading::read_32_le( *m_pFile, sError ); + int32_t iChunkSize = FileReading::read_32_le( *m_pFile, sError ); if( sError.size() != 0 ) { diff --git a/src/RageSoundReader_WAV.h b/src/RageSoundReader_WAV.h index 9b03dc915f..d9895e7a45 100644 --- a/src/RageSoundReader_WAV.h +++ b/src/RageSoundReader_WAV.h @@ -30,8 +30,8 @@ public: struct WavData { - std::int32_t m_iDataChunkPos, m_iDataChunkSize, m_iExtraFmtPos, m_iSampleRate, m_iFormatTag; - std::int16_t m_iChannels, m_iBitsPerSample, m_iBlockAlign, m_iExtraFmtBytes; + int32_t m_iDataChunkPos, m_iDataChunkSize, m_iExtraFmtPos, m_iSampleRate, m_iFormatTag; + int16_t m_iChannels, m_iBitsPerSample, m_iBlockAlign, m_iExtraFmtBytes; }; private: diff --git a/src/RageSoundUtil.cpp b/src/RageSoundUtil.cpp index 892bd8839d..bdc0aa1e5b 100644 --- a/src/RageSoundUtil.cpp +++ b/src/RageSoundUtil.cpp @@ -82,7 +82,7 @@ void RageSoundUtil::ConvertMonoToStereoInPlace( float *data, int iFrames ) } } -void RageSoundUtil::ConvertNativeInt16ToFloat( const std::int16_t *pFrom, float *pTo, int iSamples ) +void RageSoundUtil::ConvertNativeInt16ToFloat( const int16_t *pFrom, float *pTo, int iSamples ) { for( int i = 0; i < iSamples; ++i ) { @@ -90,7 +90,7 @@ void RageSoundUtil::ConvertNativeInt16ToFloat( const std::int16_t *pFrom, float } } -void RageSoundUtil::ConvertFloatToNativeInt16( const float *pFrom, std::int16_t *pTo, int iSamples ) +void RageSoundUtil::ConvertFloatToNativeInt16( const float *pFrom, int16_t *pTo, int iSamples ) { for( int i = 0; i < iSamples; ++i ) { diff --git a/src/RageSoundUtil.h b/src/RageSoundUtil.h index 067d3f72e4..2c2c94a11e 100644 --- a/src/RageSoundUtil.h +++ b/src/RageSoundUtil.h @@ -10,8 +10,8 @@ namespace RageSoundUtil void Pan( float *pBuffer, int iFrames, float fPos ); void Fade( float *pBuffer, int iFrames, int iChannels, float fStartVolume, float fEndVolume ); void ConvertMonoToStereoInPlace( float *pBuffer, int iFrames ); - void ConvertNativeInt16ToFloat( const std::int16_t *pFrom, float *pTo, int iSamples ); - void ConvertFloatToNativeInt16( const float *pFrom, std::int16_t *pTo, int iSamples ); + void ConvertNativeInt16ToFloat( const int16_t *pFrom, float *pTo, int iSamples ); + void ConvertFloatToNativeInt16( const float *pFrom, int16_t *pTo, int iSamples ); }; #endif diff --git a/src/RageSurface.cpp b/src/RageSurface.cpp index 4ea91b93c8..9615184c91 100644 --- a/src/RageSurface.cpp +++ b/src/RageSurface.cpp @@ -7,7 +7,7 @@ #include -std::int32_t RageSurfacePalette::FindColor( const RageSurfaceColor &color ) const +int32_t RageSurfacePalette::FindColor( const RageSurfaceColor &color ) const { for( int i = 0; i < ncolors; ++i ) if( colors[i] == color ) @@ -16,7 +16,7 @@ std::int32_t RageSurfacePalette::FindColor( const RageSurfaceColor &color ) cons } /* XXX: untested */ -std::int32_t RageSurfacePalette::FindClosestColor( const RageSurfaceColor &color ) const +int32_t RageSurfacePalette::FindClosestColor( const RageSurfaceColor &color ) const { int iBest = -1; int iBestDist = INT_MAX; @@ -70,9 +70,9 @@ void RageSurfaceFormat::GetRGB( uint32_t val, uint8_t *r, uint8_t *g, uint8_t *b *g = palette->colors[val].g; *b = palette->colors[val].b; } else { - *r = std::int8_t( (val & Mask[0]) >> Shift[0] << Loss[0] ); - *g = std::int8_t( (val & Mask[1]) >> Shift[1] << Loss[1] ); - *b = std::int8_t( (val & Mask[2]) >> Shift[2] << Loss[2] ); + *r = int8_t( (val & Mask[0]) >> Shift[0] << Loss[0] ); + *g = int8_t( (val & Mask[1]) >> Shift[1] << Loss[1] ); + *b = int8_t( (val & Mask[2]) >> Shift[2] << Loss[2] ); } } @@ -81,7 +81,7 @@ bool RageSurfaceFormat::MapRGBA( uint8_t r, uint8_t g, uint8_t b, uint8_t a, uin if( BytesPerPixel == 1 ) { RageSurfaceColor c( r, g, b, a ); - std::int32_t n = palette->FindColor( c ); + int32_t n = palette->FindColor( c ); if( n == -1 ) return false; val = (uint32_t) n; diff --git a/src/RageSurface.h b/src/RageSurface.h index 932fbf973f..d57abd4f41 100644 --- a/src/RageSurface.h +++ b/src/RageSurface.h @@ -33,11 +33,11 @@ inline bool operator!=(RageSurfaceColor const &lhs, RageSurfaceColor const &rhs) struct RageSurfacePalette { RageSurfaceColor colors[256]; - std::int32_t ncolors; + int32_t ncolors; /* Find the exact color; returns -1 if not found. */ - std::int32_t FindColor( const RageSurfaceColor &color ) const; - std::int32_t FindClosestColor( const RageSurfaceColor &color ) const; + int32_t FindColor( const RageSurfaceColor &color ) const; + int32_t FindClosestColor( const RageSurfaceColor &color ) const; }; struct RageSurfaceFormat @@ -46,8 +46,8 @@ struct RageSurfaceFormat RageSurfaceFormat( const RageSurfaceFormat &cpy ); ~RageSurfaceFormat() = default; - std::int32_t BytesPerPixel; - std::int32_t BitsPerPixel; + int32_t BytesPerPixel; + int32_t BitsPerPixel; std::array Mask; std::array Shift; std::array Loss; @@ -79,8 +79,8 @@ struct RageSurface uint8_t *pixels; bool pixels_owned; - std::int32_t w, h, pitch; - std::int32_t flags; + int32_t w, h, pitch; + int32_t flags; RageSurface(); RageSurface( const RageSurface &cpy ); diff --git a/src/RageSurfaceUtils_Dither.cpp b/src/RageSurfaceUtils_Dither.cpp index 9f8f82c942..c4ec8337c9 100644 --- a/src/RageSurfaceUtils_Dither.cpp +++ b/src/RageSurfaceUtils_Dither.cpp @@ -132,7 +132,7 @@ void RageSurfaceUtils::OrderedDither( const RageSurface *src, RageSurface *dst ) } -static uint8_t EDDitherPixel( int x, int y, int intensity, int conv, std::int32_t &accumError ) +static uint8_t EDDitherPixel( int x, int y, int intensity, int conv, int32_t &accumError ) { // Convert the number to the destination range. int out_intensity = intensity * conv; @@ -195,7 +195,7 @@ void RageSurfaceUtils::ErrorDiffusionDither( const RageSurface *src, RageSurface // For each row: for(int row = 0; row < src->h; ++row) { - std::int32_t accumError[4] = { 0, 0, 0, 0 }; // accum error values are reset every row + int32_t accumError[4] = { 0, 0, 0, 0 }; // accum error values are reset every row const uint8_t *srcp = src->pixels + row * src->pitch; uint8_t *dstp = dst->pixels + row * dst->pitch; diff --git a/src/RageSurfaceUtils_Palettize.cpp b/src/RageSurfaceUtils_Palettize.cpp index 17eaade155..ba43e2fd95 100644 --- a/src/RageSurfaceUtils_Palettize.cpp +++ b/src/RageSurfaceUtils_Palettize.cpp @@ -210,7 +210,7 @@ void RageSurfaceUtils::Palettize( RageSurface *&pImg, int iColors, bool bDither do { - std::int32_t sc[4]; + int32_t sc[4]; uint8_t pixel[4] = { pIn[0], pIn[1], pIn[2], pIn[3] }; if( bDither ) { @@ -218,7 +218,7 @@ void RageSurfaceUtils::Palettize( RageSurface *&pImg, int iColors, bool bDither for( int c = 0; c < 4; ++c ) { sc[c] = pixel[c] + thiserr[col + 1].c[c] / FS_SCALE; - sc[c] = std::clamp( sc[c], 0, (std::int32_t) maxval ); + sc[c] = std::clamp( sc[c], 0, (int32_t) maxval ); } PAM_ASSIGN( pixel, (uint8_t)sc[0], (uint8_t)sc[1], (uint8_t)sc[2], (uint8_t)sc[3] ); diff --git a/src/RageSurface_Load_JPEG.cpp b/src/RageSurface_Load_JPEG.cpp index fd64d2d681..2f7e387c7e 100644 --- a/src/RageSurface_Load_JPEG.cpp +++ b/src/RageSurface_Load_JPEG.cpp @@ -170,7 +170,7 @@ static RageSurface *RageSurface_Load_JPEG( RageFile *f, const char *fn, char err for( int i = 0; i < 256; ++i ) { RageSurfaceColor color; - color.r = color.g = color.b = (std::int8_t) i; + color.r = color.g = color.b = (int8_t) i; color.a = 0xFF; img->fmt.palette->colors[i] = color; } diff --git a/src/RageSurface_Load_PNG.cpp b/src/RageSurface_Load_PNG.cpp index a3d62222f4..f3a267eafe 100644 --- a/src/RageSurface_Load_PNG.cpp +++ b/src/RageSurface_Load_PNG.cpp @@ -144,7 +144,7 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro /* Fake PNG_COLOR_TYPE_GRAY. */ for( int i = 0; i < 256; ++i ) { - colors[i].r = colors[i].g = colors[i].b = (std::int8_t) i; + colors[i].r = colors[i].g = colors[i].b = (int8_t) i; colors[i].a = 0xFF; } diff --git a/src/RageSurface_Load_XPM.cpp b/src/RageSurface_Load_XPM.cpp index 41ccda6a81..7b12aead04 100644 --- a/src/RageSurface_Load_XPM.cpp +++ b/src/RageSurface_Load_XPM.cpp @@ -91,9 +91,9 @@ RageSurface *RageSurface_Load_XPM( char * const *xpm, RString &error ) return nullptr; } - std::int8_t *p = (std::int8_t *) img->pixels; + int8_t *p = (int8_t *) img->pixels; p += y * img->pitch; - std::int32_t *p32 = (std::int32_t *) p; + int32_t *p32 = (int32_t *) p; for( int x = 0; x < width; ++x ) { RString color_name = row.substr( x*color_length, color_length ); @@ -108,7 +108,7 @@ RageSurface *RageSurface_Load_XPM( char * const *xpm, RString &error ) if( colors.size() <= 256 ) { - p[x] = (std::int8_t) it->second; + p[x] = (int8_t) it->second; } else { const RageSurfaceColor &color = colors[it->second]; p32[x] = (color.r << 24) + (color.g << 16) + (color.b << 8); diff --git a/src/RageTimer.cpp b/src/RageTimer.cpp index 213184bf6b..04be5d27fe 100644 --- a/src/RageTimer.cpp +++ b/src/RageTimer.cpp @@ -31,7 +31,7 @@ #include const uint64_t ONE_SECOND_IN_MICROSECONDS_ULL = 1000000ULL; -const std::int64_t ONE_SECOND_IN_MICROSECONDS_LL = 1000000LL; +const int64_t ONE_SECOND_IN_MICROSECONDS_LL = 1000000LL; const uint_fast64_t ONE_SECOND_IN_MICROSECONDS_FAST_ULL = 1000000ULL; const double ONE_SECOND_IN_MICROSECONDS_DBL = 1000000.0; @@ -128,8 +128,8 @@ RageTimer RageTimer::Sum(const RageTimer& lhs, float tm) /* Calculate the seconds and microseconds from the time: * tm == 5.25 -> secs = 5, us = 5.25 - ( 5) = .25 * tm == -1.25 -> secs = -2, us = -1.25 - (-2) = .75 */ - std::int64_t seconds = std::floor(tm); - std::int64_t us = static_cast((tm - seconds) * ONE_SECOND_IN_MICROSECONDS_LL); + int64_t seconds = std::floor(tm); + int64_t us = static_cast((tm - seconds) * ONE_SECOND_IN_MICROSECONDS_LL); // Prevent unnecessarily checking the time RageTimer ret(0, 0); @@ -151,8 +151,8 @@ RageTimer RageTimer::Sum(const RageTimer& lhs, float tm) double RageTimer::Difference(const RageTimer& lhs, const RageTimer& rhs) { // Calculate the difference in seconds and microseconds respectively - std::int64_t secs = lhs.m_secs - rhs.m_secs; - std::int64_t us = lhs.m_us - rhs.m_us; + int64_t secs = lhs.m_secs - rhs.m_secs; + int64_t us = lhs.m_us - rhs.m_us; // Adjust seconds and microseconds if microseconds is negative if ( us < 0 ) diff --git a/src/RageTypes.h b/src/RageTypes.h index 0dcb0a3d93..9f3301590f 100644 --- a/src/RageTypes.h +++ b/src/RageTypes.h @@ -360,7 +360,7 @@ struct RageModelVertex // doesn't have color. Relies on material color RageVector3 p; // position RageVector3 n; // normal RageVector2 t; // texture coordinates - std::int8_t bone; + int8_t bone; RageVector2 TextureMatrixScale; // usually 1,1 }; diff --git a/src/ScoreKeeperNormal.cpp b/src/ScoreKeeperNormal.cpp index bf097dc083..b19e1e1298 100644 --- a/src/ScoreKeeperNormal.cpp +++ b/src/ScoreKeeperNormal.cpp @@ -203,7 +203,7 @@ void ScoreKeeperNormal::OnNextSong( int iSongInCourseIndex, const Steps* pSteps, GAMESTATE->SetProcessedTimingData(nullptr); } -static int GetScore(int p, int Z, std::int64_t S, int n) +static int GetScore(int p, int Z, int64_t S, int n) { /* There's a problem with the scoring system described below. Z/S is truncated * to an int. However, in some cases we can end up with very small base scores. @@ -221,7 +221,7 @@ static int GetScore(int p, int Z, std::int64_t S, int n) return p * (Z / S) * n; #elif 1 // This doesn't round down Z/S. - return int(std::int64_t(p) * n * Z / S); + return int(int64_t(p) * n * Z / S); #else // This also doesn't round down Z/S. Use this if you don't have 64-bit ints. return int(p * n * (float(Z) / S)); @@ -282,8 +282,8 @@ void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score ) m_iTapNotesHit++; - const std::int64_t N = uint64_t(m_iNumTapsAndHolds); - const std::int64_t sum = (N * (N + 1)) / 2; + const int64_t N = uint64_t(m_iNumTapsAndHolds); + const int64_t sum = (N * (N + 1)) / 2; const int Z = m_iMaxPossiblePoints/10; // Don't use a multiplier if the player has failed diff --git a/src/arch/ArchHooks/ArchHooks.h b/src/arch/ArchHooks/ArchHooks.h index 8adb419f83..b378444cbd 100644 --- a/src/arch/ArchHooks/ArchHooks.h +++ b/src/arch/ArchHooks/ArchHooks.h @@ -87,7 +87,7 @@ public: * underlying timers may be 32-bit, but implementations should try to avoid * wrapping if possible. */ - static std::int64_t GetSystemTimeInMicroseconds(); + static int64_t GetSystemTimeInMicroseconds(); /* * Add file search paths, higher priority first. @@ -131,8 +131,8 @@ public: private: /* This are helpers for GetSystemTimeInMicroseconds on systems with a timer * that may loop or move backwards. */ - static std::int64_t FixupTimeIfLooped( std::int64_t usecs ); - static std::int64_t FixupTimeIfBackwards( std::int64_t usecs ); + static int64_t FixupTimeIfLooped( int64_t usecs ); + static int64_t FixupTimeIfBackwards( int64_t usecs ); static bool g_bQuitting; static bool g_bToggleWindowed; diff --git a/src/arch/ArchHooks/ArchHooksUtil.cpp b/src/arch/ArchHooks/ArchHooksUtil.cpp index 8546c54ae1..35c33f3654 100644 --- a/src/arch/ArchHooks/ArchHooksUtil.cpp +++ b/src/arch/ArchHooks/ArchHooksUtil.cpp @@ -27,15 +27,15 @@ * bAccurate == false. */ -std::int64_t ArchHooks::FixupTimeIfLooped( std::int64_t usecs ) +int64_t ArchHooks::FixupTimeIfLooped( int64_t usecs ) { - static std::int64_t last = 0; - static std::int64_t offset_us = 0; + static int64_t last = 0; + static int64_t offset_us = 0; /* The time has wrapped if the last time was very high and the current time is very low. */ - const std::int64_t i32BitMaxMs = uint64_t(1) << 32; - const std::int64_t i32BitMaxUs = i32BitMaxMs*1000; - const std::int64_t one_day = uint64_t(24*60*60)*1000000; + const int64_t i32BitMaxMs = uint64_t(1) << 32; + const int64_t i32BitMaxUs = i32BitMaxMs*1000; + const int64_t one_day = uint64_t(24*60*60)*1000000; if( last > (i32BitMaxUs-one_day) && usecs < one_day ) offset_us += i32BitMaxUs; @@ -44,10 +44,10 @@ std::int64_t ArchHooks::FixupTimeIfLooped( std::int64_t usecs ) return usecs + offset_us; } -std::int64_t ArchHooks::FixupTimeIfBackwards( std::int64_t usecs ) +int64_t ArchHooks::FixupTimeIfBackwards( int64_t usecs ) { - static std::int64_t last = 0; - static std::int64_t offset_us = 0; + static int64_t last = 0; + static int64_t offset_us = 0; if( usecs < last ) { diff --git a/src/arch/ArchHooks/ArchHooks_MacOSX.mm b/src/arch/ArchHooks/ArchHooks_MacOSX.mm index 3829b68550..7c19aa7edf 100644 --- a/src/arch/ArchHooks/ArchHooks_MacOSX.mm +++ b/src/arch/ArchHooks/ArchHooks_MacOSX.mm @@ -258,7 +258,7 @@ bool ArchHooks_MacOSX::GoToURL( RString sUrl ) return result == 0; } -std::int64_t ArchHooks::GetSystemTimeInMicroseconds() +int64_t ArchHooks::GetSystemTimeInMicroseconds() { // http://developer.apple.com/qa/qa2004/qa1398.html static double factor = 0.0; @@ -270,7 +270,7 @@ std::int64_t ArchHooks::GetSystemTimeInMicroseconds() mach_timebase_info( &timeBase ); factor = timeBase.numer / ( 1000.0 * timeBase.denom ); } - return std::int64_t( mach_absolute_time() * factor ); + return int64_t( mach_absolute_time() * factor ); } #include "RageFileManager.h" diff --git a/src/arch/ArchHooks/ArchHooks_Unix.cpp b/src/arch/ArchHooks/ArchHooks_Unix.cpp index 3926cfcc50..feb4b5d484 100644 --- a/src/arch/ArchHooks/ArchHooks_Unix.cpp +++ b/src/arch/ArchHooks/ArchHooks_Unix.cpp @@ -149,25 +149,25 @@ clockid_t ArchHooks_Unix::GetClock() return g_Clock; } -std::int64_t ArchHooks::GetSystemTimeInMicroseconds() +int64_t ArchHooks::GetSystemTimeInMicroseconds() { OpenGetTime(); timespec ts; clock_gettime( g_Clock, &ts ); - std::int64_t iRet = std::int64_t(ts.tv_sec) * 1000000 + std::int64_t(ts.tv_nsec)/1000; + int64_t iRet = int64_t(ts.tv_sec) * 1000000 + int64_t(ts.tv_nsec)/1000; if( g_Clock != CLOCK_MONOTONIC ) iRet = ArchHooks::FixupTimeIfBackwards( iRet ); return iRet; } #else -std::int64_t ArchHooks::GetSystemTimeInMicroseconds() +int64_t ArchHooks::GetSystemTimeInMicroseconds() { struct timeval tv; gettimeofday( &tv, nullptr ); - std::int64_t iRet = std::int64_t(tv.tv_sec) * 1000000 + std::int64_t(tv.tv_usec); + int64_t iRet = int64_t(tv.tv_sec) * 1000000 + int64_t(tv.tv_usec); ret = FixupTimeIfBackwards( ret ); return iRet; } diff --git a/src/arch/ArchHooks/ArchHooks_Unix.h b/src/arch/ArchHooks/ArchHooks_Unix.h index 472bfc005c..29d9b0f6ec 100644 --- a/src/arch/ArchHooks/ArchHooks_Unix.h +++ b/src/arch/ArchHooks/ArchHooks_Unix.h @@ -13,7 +13,7 @@ public: void DumpDebugInfo(); void SetTime( tm newtime ); - std::int64_t GetSystemTimeInMicroseconds(); + int64_t GetSystemTimeInMicroseconds(); void MountInitialFilesystems( const RString &sDirOfExecutable ); float GetDisplayAspectRatio() { return 4.0f/3; } diff --git a/src/arch/ArchHooks/ArchHooks_Win32Static.cpp b/src/arch/ArchHooks/ArchHooks_Win32Static.cpp index 4c25f01680..6939764e5e 100644 --- a/src/arch/ArchHooks/ArchHooks_Win32Static.cpp +++ b/src/arch/ArchHooks/ArchHooks_Win32Static.cpp @@ -39,7 +39,7 @@ static void InitTimer() QueryPerformanceFrequency(&g_liFrequency); } -std::int64_t ArchHooks::GetSystemTimeInMicroseconds() +int64_t ArchHooks::GetSystemTimeInMicroseconds() { // Make sure the timer is initialized. if (!g_bTimerInitialized) { diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index e573cbc4b2..0a23297530 100644 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -506,7 +506,7 @@ static int AVIORageFile_ReadPacket(void* opaque, uint8_t* buf, int buf_size) return n; } -static std::int64_t AVIORageFile_Seek(void* opaque, std::int64_t offset, int whence) +static int64_t AVIORageFile_Seek(void* opaque, int64_t offset, int whence) { RageFile* f = (RageFile*)opaque; if (whence == AVSEEK_SIZE) diff --git a/src/arch/Sound/ALSA9Helpers.cpp b/src/arch/Sound/ALSA9Helpers.cpp index ffccb871f9..68bd468a95 100644 --- a/src/arch/Sound/ALSA9Helpers.cpp +++ b/src/arch/Sound/ALSA9Helpers.cpp @@ -337,7 +337,7 @@ bool Alsa9Buf::WaitUntilFramesCanBeFilled( int timeout_ms ) return err == 1; } -void Alsa9Buf::Write( const std::int16_t *buffer, int frames ) +void Alsa9Buf::Write( const int16_t *buffer, int frames ) { /* We should be able to write it all. If we don't, treat it as an error. */ int wrote; @@ -388,7 +388,7 @@ bool Alsa9Buf::Recover( int r ) return false; } -std::int64_t Alsa9Buf::GetPosition() const +int64_t Alsa9Buf::GetPosition() const { if( dsnd_pcm_state(pcm) == SND_PCM_STATE_PREPARED ) return last_cursor_pos; diff --git a/src/arch/Sound/ALSA9Helpers.h b/src/arch/Sound/ALSA9Helpers.h index e59d8a2c84..9c5deb7dfb 100644 --- a/src/arch/Sound/ALSA9Helpers.h +++ b/src/arch/Sound/ALSA9Helpers.h @@ -13,7 +13,7 @@ private: int channels, samplebits; unsigned samplerate; int buffersize; - std::int64_t last_cursor_pos; + int64_t last_cursor_pos; snd_pcm_uframes_t preferred_writeahead, preferred_chunksize; snd_pcm_uframes_t writeahead, chunksize; @@ -40,15 +40,15 @@ public: int GetNumFramesToFill(); bool WaitUntilFramesCanBeFilled( int timeout_ms ); - void Write( const std::int16_t *buffer, int frames ); + void Write( const int16_t *buffer, int frames ); void Play(); void Stop(); void SetVolume(float vol); int GetSampleRate() const { return samplerate; } - std::int64_t GetPosition() const; - std::int64_t GetPlayPos() const { return last_cursor_pos; } + int64_t GetPosition() const; + int64_t GetPlayPos() const { return last_cursor_pos; } }; #endif diff --git a/src/arch/Sound/DSoundHelpers.cpp b/src/arch/Sound/DSoundHelpers.cpp index 2357877beb..d365be84f9 100644 --- a/src/arch/Sound/DSoundHelpers.cpp +++ b/src/arch/Sound/DSoundHelpers.cpp @@ -559,7 +559,7 @@ void DSoundBuf::release_output_buf( char *pBuffer, unsigned iBufferSize ) m_bBufferLocked = false; } -std::int64_t DSoundBuf::GetPosition() const +int64_t DSoundBuf::GetPosition() const { DWORD iCursor, iJunk; HRESULT hr = m_pBuffer->GetCurrentPosition( &iCursor, &iJunk ); @@ -589,7 +589,7 @@ std::int64_t DSoundBuf::GetPosition() const if( iFramesBehind < 0 ) iFramesBehind += buffersize_frames(); /* unwrap */ - std::int64_t iRet = m_iWriteCursorPos - iFramesBehind; + int64_t iRet = m_iWriteCursorPos - iFramesBehind; /* Failsafe: never return a value smaller than we've already returned. * This can happen once in a while in underrun conditions. */ diff --git a/src/arch/Sound/DSoundHelpers.h b/src/arch/Sound/DSoundHelpers.h index 5b7c49f100..90916e6b78 100644 --- a/src/arch/Sound/DSoundHelpers.h +++ b/src/arch/Sound/DSoundHelpers.h @@ -51,8 +51,8 @@ public: int GetSampleRate() const { return m_iSampleRate; } ~DSoundBuf(); - std::int64_t GetPosition() const; - std::int64_t GetOutputPosition() const { return m_iWriteCursorPos; } + int64_t GetPosition() const; + int64_t GetOutputPosition() const { return m_iWriteCursorPos; } private: int buffersize_frames() const { return m_iBufferSize / bytes_per_frame(); } @@ -70,8 +70,8 @@ private: int m_iWriteCursor, m_iBufferBytesFilled; /* bytes */ int m_iExtraWriteahead; - std::int64_t m_iWriteCursorPos; /* frames */ - mutable std::int64_t m_iLastPosition; + int64_t m_iWriteCursorPos; /* frames */ + mutable int64_t m_iLastPosition; bool m_bPlaying; bool m_bBufferLocked; diff --git a/src/arch/Sound/RageSoundDriver.h b/src/arch/Sound/RageSoundDriver.h index 28325222b2..22309b5948 100644 --- a/src/arch/Sound/RageSoundDriver.h +++ b/src/arch/Sound/RageSoundDriver.h @@ -50,8 +50,8 @@ public: /* Get the current hardware frame position, in the same time base as passed to * RageSound::CommitPlayingPosition. */ - std::int64_t GetHardwareFrame( RageTimer *pTimer ) const; - virtual std::int64_t GetPosition() const = 0; + int64_t GetHardwareFrame( RageTimer *pTimer ) const; + virtual int64_t GetPosition() const = 0; /* When a sound is finished playing (GetDataToPlay returns 0) and the sound has * been completely flushed (so GetPosition is no longer meaningful), call @@ -96,10 +96,10 @@ protected: * This function only mixes data; it will not lock any mutexes or do any file access, and * is safe to call from a realtime thread. */ - void Mix( std::int16_t *pBuf, int iFrames, std::int64_t iFrameNumber, std::int64_t iCurrentFrame ); - void Mix( float *pBuf, int iFrames, std::int64_t iFrameNumber, std::int64_t iCurrentFrame ); + void Mix( int16_t *pBuf, int iFrames, int64_t iFrameNumber, int64_t iCurrentFrame ); + void Mix( float *pBuf, int iFrames, int64_t iFrameNumber, int64_t iCurrentFrame ); - void MixDeinterlaced( float **pBufs, int iChannels, int iFrames, std::int64_t iFrameNumber, std::int64_t iCurrentFrame ); + void MixDeinterlaced( float **pBufs, int iChannels, int iFrames, int64_t iFrameNumber, int64_t iCurrentFrame ); private: /* This mutex is used for serializing with the decoder thread. Locking this mutex @@ -156,7 +156,7 @@ private: float m_Buffer[samples_per_block]; float *m_BufferNext; // beginning of the unread data int m_FramesInBuffer; // total number of frames at m_BufferNext - std::int64_t m_iPosition; // stream frame of m_BufferNext + int64_t m_iPosition; // stream frame of m_BufferNext sound_block(): m_BufferNext(m_Buffer), m_FramesInBuffer(0), m_iPosition(0) {} }; @@ -176,8 +176,8 @@ private: struct QueuedPosMap { int iFrames; - std::int64_t iStreamFrame; - std::int64_t iHardwareFrame; + int64_t iStreamFrame; + int64_t iHardwareFrame; }; CircBuf m_PosMapQueue; @@ -201,15 +201,15 @@ private: /* List of currently playing sounds: XXX no vector */ Sound m_Sounds[32]; - std::int64_t ClampHardwareFrame( std::int64_t iHardwareFrame ) const; - mutable std::int64_t m_iMaxHardwareFrame; - mutable std::int64_t m_iVMaxHardwareFrame; + int64_t ClampHardwareFrame( int64_t iHardwareFrame ) const; + mutable int64_t m_iMaxHardwareFrame; + mutable int64_t m_iVMaxHardwareFrame; bool m_bShutdownDecodeThread; static int DecodeThread_start( void *p ); void DecodeThread(); - RageSoundMixBuffer &MixIntoBuffer( int iFrames, std::int64_t iFrameNumber, std::int64_t iCurrentFrame ); + RageSoundMixBuffer &MixIntoBuffer( int iFrames, int64_t iFrameNumber, int64_t iCurrentFrame ); RageThread m_DecodeThread; int GetDataForSound( Sound &s ); diff --git a/src/arch/Sound/RageSoundDriver_ALSA9_Software.cpp b/src/arch/Sound/RageSoundDriver_ALSA9_Software.cpp index ce4afc9cfb..496f99cb31 100644 --- a/src/arch/Sound/RageSoundDriver_ALSA9_Software.cpp +++ b/src/arch/Sound/RageSoundDriver_ALSA9_Software.cpp @@ -19,7 +19,7 @@ REGISTER_SOUND_DRIVER_CLASS2( ALSA-sw, ALSA9_Software ); static const int channels = 2; static const int samples_per_frame = channels; -static const int bytes_per_frame = sizeof(std::int16_t) * samples_per_frame; +static const int bytes_per_frame = sizeof(int16_t) * samples_per_frame; /* Linux 2.6 has a fine-grained scheduler. We can almost always use a smaller buffer * size than in 2.4. XXX: Some cards can handle smaller buffer sizes than others. */ @@ -54,7 +54,7 @@ bool RageSoundDriver_ALSA9_Software::GetData() if( frames_to_fill <= 0 ) return false; - static std::int16_t *buf = nullptr; + static int16_t *buf = nullptr; static int bufsize = 0; if( buf && bufsize < frames_to_fill ) { @@ -63,12 +63,12 @@ bool RageSoundDriver_ALSA9_Software::GetData() } if( !buf ) { - buf = new std::int16_t[frames_to_fill*samples_per_frame]; + buf = new int16_t[frames_to_fill*samples_per_frame]; bufsize = frames_to_fill; } - const std::int64_t play_pos = m_pPCM->GetPlayPos(); - const std::int64_t cur_play_pos = m_pPCM->GetPosition(); + const int64_t play_pos = m_pPCM->GetPlayPos(); + const int64_t cur_play_pos = m_pPCM->GetPosition(); this->Mix( buf, frames_to_fill, play_pos, cur_play_pos ); m_pPCM->Write( buf, frames_to_fill ); @@ -77,7 +77,7 @@ bool RageSoundDriver_ALSA9_Software::GetData() } -std::int64_t RageSoundDriver_ALSA9_Software::GetPosition() const +int64_t RageSoundDriver_ALSA9_Software::GetPosition() const { return m_pPCM->GetPosition(); } diff --git a/src/arch/Sound/RageSoundDriver_ALSA9_Software.h b/src/arch/Sound/RageSoundDriver_ALSA9_Software.h index 81a1efad85..82daa6841c 100644 --- a/src/arch/Sound/RageSoundDriver_ALSA9_Software.h +++ b/src/arch/Sound/RageSoundDriver_ALSA9_Software.h @@ -16,7 +16,7 @@ public: RString Init(); /* virtuals: */ - std::int64_t GetPosition() const; + int64_t GetPosition() const; float GetPlayLatency() const; int GetSampleRate() const { return m_iSampleRate; } diff --git a/src/arch/Sound/RageSoundDriver_AU.h b/src/arch/Sound/RageSoundDriver_AU.h index 286b14818a..b32115b4a3 100644 --- a/src/arch/Sound/RageSoundDriver_AU.h +++ b/src/arch/Sound/RageSoundDriver_AU.h @@ -16,7 +16,7 @@ public: ~RageSoundDriver_AU(); float GetPlayLatency() const; int GetSampleRate() const { return m_iSampleRate; } - std::int64_t GetPosition() const; + int64_t GetPosition() const; protected: void SetupDecodingThread(); diff --git a/src/arch/Sound/RageSoundDriver_AU.mm b/src/arch/Sound/RageSoundDriver_AU.mm index 3dfa0e9b60..28366266be 100644 --- a/src/arch/Sound/RageSoundDriver_AU.mm +++ b/src/arch/Sound/RageSoundDriver_AU.mm @@ -205,9 +205,9 @@ RageSoundDriver_AU::~RageSoundDriver_AU() delete m_pNotificationThread; } -std::int64_t RageSoundDriver_AU::GetPosition() const +int64_t RageSoundDriver_AU::GetPosition() const { - return std::int64_t( m_TimeScale * AudioGetCurrentHostTime() ); + return int64_t( m_TimeScale * AudioGetCurrentHostTime() ); } @@ -350,8 +350,8 @@ OSStatus RageSoundDriver_AU::Render( void *inRefCon, This->m_pIOThread = new RageThreadRegister( "HAL I/O thread" ); AudioBuffer &buf = ioData->mBuffers[0]; - std::int64_t now = std::int64_t( This->m_TimeScale * AudioGetCurrentHostTime() ); - std::int64_t next = std::int64_t( This->m_TimeScale * inTimeStamp->mHostTime ); + int64_t now = int64_t( This->m_TimeScale * AudioGetCurrentHostTime() ); + int64_t next = int64_t( This->m_TimeScale * inTimeStamp->mHostTime ); This->Mix( (float *)buf.mData, inNumberFrames, next, now ); if( unlikely(This->m_bDone) ) diff --git a/src/arch/Sound/RageSoundDriver_DSound_Software.cpp b/src/arch/Sound/RageSoundDriver_DSound_Software.cpp index 3ace157c65..128cf5a20b 100644 --- a/src/arch/Sound/RageSoundDriver_DSound_Software.cpp +++ b/src/arch/Sound/RageSoundDriver_DSound_Software.cpp @@ -44,7 +44,7 @@ void RageSoundDriver_DSound_Software::MixerThread() { char *pLockedBuf; unsigned iLen; - const std::int64_t iPlayPos = m_pPCM->GetOutputPosition(); /* must be called before get_output_buf */ + const int64_t iPlayPos = m_pPCM->GetOutputPosition(); /* must be called before get_output_buf */ if( !m_pPCM->get_output_buf(&pLockedBuf, &iLen, chunksize()) ) { @@ -52,7 +52,7 @@ void RageSoundDriver_DSound_Software::MixerThread() continue; } - this->Mix( (std::int16_t *) pLockedBuf, iLen/bytes_per_frame, iPlayPos, m_pPCM->GetPosition() ); + this->Mix( (int16_t *) pLockedBuf, iLen/bytes_per_frame, iPlayPos, m_pPCM->GetPosition() ); m_pPCM->release_output_buf( pLockedBuf, iLen ); } @@ -62,7 +62,7 @@ void RageSoundDriver_DSound_Software::MixerThread() m_pPCM->Stop(); } -std::int64_t RageSoundDriver_DSound_Software::GetPosition() const +int64_t RageSoundDriver_DSound_Software::GetPosition() const { return m_pPCM->GetPosition(); } diff --git a/src/arch/Sound/RageSoundDriver_DSound_Software.h b/src/arch/Sound/RageSoundDriver_DSound_Software.h index 190a1f6fdf..ba5b0c09d7 100644 --- a/src/arch/Sound/RageSoundDriver_DSound_Software.h +++ b/src/arch/Sound/RageSoundDriver_DSound_Software.h @@ -14,7 +14,7 @@ public: virtual ~RageSoundDriver_DSound_Software(); RString Init(); - std::int64_t GetPosition() const; + int64_t GetPosition() const; float GetPlayLatency() const; int GetSampleRate() const; diff --git a/src/arch/Sound/RageSoundDriver_Generic_Software.cpp b/src/arch/Sound/RageSoundDriver_Generic_Software.cpp index 2f40c18f84..85a864148b 100644 --- a/src/arch/Sound/RageSoundDriver_Generic_Software.cpp +++ b/src/arch/Sound/RageSoundDriver_Generic_Software.cpp @@ -56,14 +56,14 @@ int RageSoundDriver::DecodeThread_start( void *p ) return 0; } -static std::int64_t g_iTotalAhead = 0; +static int64_t g_iTotalAhead = 0; static int g_iTotalAheadCount = 0; -RageSoundMixBuffer &RageSoundDriver::MixIntoBuffer( int iFrames, std::int64_t iFrameNumber, std::int64_t iCurrentFrame ) +RageSoundMixBuffer &RageSoundDriver::MixIntoBuffer( int iFrames, int64_t iFrameNumber, int64_t iCurrentFrame ) { ASSERT_M( m_DecodeThread.IsCreated(), "RageSoundDriver::StartDecodeThread() was never called" ); - std::int64_t frameDifference = iFrameNumber - iCurrentFrame + static_cast(iFrames); + int64_t frameDifference = iFrameNumber - iCurrentFrame + static_cast(iFrames); if (frameDifference > 0) { g_iTotalAhead += frameDifference; @@ -100,9 +100,9 @@ RageSoundMixBuffer &RageSoundDriver::MixIntoBuffer( int iFrames, std::int64_t iF if( !s.m_StartTime.IsZero() && iCurrentFrame != -1 ) { /* If the sound is supposed to start at a time past this buffer, insert silence. */ - const std::int64_t iFramesUntilThisBuffer = iFrameNumber - iCurrentFrame; + const int64_t iFramesUntilThisBuffer = iFrameNumber - iCurrentFrame; const float fSecondsBeforeStart = -s.m_StartTime.Ago(); - const std::int64_t iFramesBeforeStart = std::int64_t(fSecondsBeforeStart * GetSampleRate()); + const int64_t iFramesBeforeStart = int64_t(fSecondsBeforeStart * GetSampleRate()); const int iSilentFramesInThisBuffer = std::clamp( int(iFramesBeforeStart-iFramesUntilThisBuffer), 0, iFramesLeft ); iGotFrames += iSilentFramesInThisBuffer; @@ -170,19 +170,19 @@ RageSoundMixBuffer &RageSoundDriver::MixIntoBuffer( int iFrames, std::int64_t iF return mix; } -void RageSoundDriver::Mix( std::int16_t *pBuf, int iFrames, std::int64_t iFrameNumber, std::int64_t iCurrentFrame ) +void RageSoundDriver::Mix( int16_t *pBuf, int iFrames, int64_t iFrameNumber, int64_t iCurrentFrame ) { - memset( pBuf, 0, iFrames*channels*sizeof(std::int16_t) ); + memset( pBuf, 0, iFrames*channels*sizeof(int16_t) ); MixIntoBuffer( iFrames, iFrameNumber, iCurrentFrame ).read( pBuf ); } -void RageSoundDriver::Mix( float *pBuf, int iFrames, std::int64_t iFrameNumber, std::int64_t iCurrentFrame ) +void RageSoundDriver::Mix( float *pBuf, int iFrames, int64_t iFrameNumber, int64_t iCurrentFrame ) { memset( pBuf, 0, iFrames*channels*sizeof(float) ); MixIntoBuffer( iFrames, iFrameNumber, iCurrentFrame ).read( pBuf ); } -void RageSoundDriver::MixDeinterlaced( float **pBufs, int iChannels, int iFrames, std::int64_t iFrameNumber, std::int64_t iCurrentFrame ) +void RageSoundDriver::MixDeinterlaced( float **pBufs, int iChannels, int iFrames, int64_t iFrameNumber, int64_t iCurrentFrame ) { for (int i = 0; i < iChannels; ++i ) memset( pBufs[i], 0, iFrames*sizeof(float) ); @@ -478,7 +478,7 @@ RageSoundDriver::~RageSoundDriver() } } -std::int64_t RageSoundDriver::ClampHardwareFrame( std::int64_t iHardwareFrame ) const +int64_t RageSoundDriver::ClampHardwareFrame( int64_t iHardwareFrame ) const { /* It's sometimes possible for the hardware position to move backwards, usually * on underrun. We can try to prevent this in each driver, but it's an obscure @@ -487,8 +487,8 @@ std::int64_t RageSoundDriver::ClampHardwareFrame( std::int64_t iHardwareFrame ) { /* Clamp the output to one per second, so one underruns don't cascade due to * output spam. */ - static std::int64_t lastTime = 0; - std::int64_t currentTime = RageTimer::GetTimeSinceStartMicroseconds(); + static int64_t lastTime = 0; + int64_t currentTime = RageTimer::GetTimeSinceStartMicroseconds(); if( lastTime == 0 || (currentTime - lastTime) > 1000000 ) { LOG->Trace("RageSoundDriver: driver returned a lesser position (%" PRId64 " < %" PRId64 ")", iHardwareFrame, m_iMaxHardwareFrame); @@ -503,7 +503,7 @@ std::int64_t RageSoundDriver::ClampHardwareFrame( std::int64_t iHardwareFrame ) return m_iMaxHardwareFrame; } -std::int64_t RageSoundDriver::GetHardwareFrame( RageTimer *pTimestamp=nullptr ) const +int64_t RageSoundDriver::GetHardwareFrame( RageTimer *pTimestamp=nullptr ) const { if( pTimestamp == nullptr ) return ClampHardwareFrame( GetPosition() ); @@ -518,7 +518,7 @@ std::int64_t RageSoundDriver::GetHardwareFrame( RageTimer *pTimestamp=nullptr ) * severe performance problems, anyway. */ int iTries = 3; - std::int64_t iPositionFrames; + int64_t iPositionFrames; uint64_t iStartTime; const uint64_t iThreshold = 2000ULL; diff --git a/src/arch/Sound/RageSoundDriver_JACK.cpp b/src/arch/Sound/RageSoundDriver_JACK.cpp index 2820dd18ee..0dd0522834 100644 --- a/src/arch/Sound/RageSoundDriver_JACK.cpp +++ b/src/arch/Sound/RageSoundDriver_JACK.cpp @@ -186,7 +186,7 @@ RString RageSoundDriver_JACK::ConnectPorts() return ret; } -std::int64_t RageSoundDriver_JACK::GetPosition() const +int64_t RageSoundDriver_JACK::GetPosition() const { return jack_frame_time(client); } diff --git a/src/arch/Sound/RageSoundDriver_JACK.h b/src/arch/Sound/RageSoundDriver_JACK.h index b7fe3fb687..4300b0e616 100644 --- a/src/arch/Sound/RageSoundDriver_JACK.h +++ b/src/arch/Sound/RageSoundDriver_JACK.h @@ -18,7 +18,7 @@ public: RString Init(); int GetSampleRate() const; - std::int64_t GetPosition() const; + int64_t GetPosition() const; private: jack_client_t *client; diff --git a/src/arch/Sound/RageSoundDriver_Null.cpp b/src/arch/Sound/RageSoundDriver_Null.cpp index 2045441ce8..f8a7124a58 100644 --- a/src/arch/Sound/RageSoundDriver_Null.cpp +++ b/src/arch/Sound/RageSoundDriver_Null.cpp @@ -15,7 +15,7 @@ void RageSoundDriver_Null::Update() /* "Play" frames. */ while( m_iLastCursorPos < GetPosition()+1024*4 ) { - std::int16_t buf[256*channels]; + int16_t buf[256*channels]; this->Mix( buf, 256, m_iLastCursorPos, GetPosition() ); m_iLastCursorPos += 256; } @@ -23,7 +23,7 @@ void RageSoundDriver_Null::Update() RageSoundDriver::Update(); } -std::int64_t RageSoundDriver_Null::GetPosition() const +int64_t RageSoundDriver_Null::GetPosition() const { return (RageTimer::GetTimeSinceStartMicroseconds() * m_iSampleRate) / 1000000; } diff --git a/src/arch/Sound/RageSoundDriver_Null.h b/src/arch/Sound/RageSoundDriver_Null.h index d5d35143b3..d2f7682223 100644 --- a/src/arch/Sound/RageSoundDriver_Null.h +++ b/src/arch/Sound/RageSoundDriver_Null.h @@ -9,12 +9,12 @@ class RageSoundDriver_Null: public RageSoundDriver { public: RageSoundDriver_Null(); - std::int64_t GetPosition() const; + int64_t GetPosition() const; int GetSampleRate() const; void Update(); private: - std::int64_t m_iLastCursorPos; + int64_t m_iLastCursorPos; int m_iSampleRate; }; #define USE_RAGE_SOUND_NULL diff --git a/src/arch/Sound/RageSoundDriver_OSS.cpp b/src/arch/Sound/RageSoundDriver_OSS.cpp index 9f89d88866..0bec4a5958 100644 --- a/src/arch/Sound/RageSoundDriver_OSS.cpp +++ b/src/arch/Sound/RageSoundDriver_OSS.cpp @@ -83,9 +83,9 @@ bool RageSoundDriver_OSS::GetData() const int chunksize = ab.fragsize; - static std::int16_t *buf = nullptr; + static int16_t *buf = nullptr; if(!buf) - buf = new std::int16_t[chunksize / sizeof(std::int16_t)]; + buf = new int16_t[chunksize / sizeof(int16_t)]; this->Mix( buf, chunksize/bytes_per_frame, last_cursor_pos, GetPosition() ); @@ -101,7 +101,7 @@ bool RageSoundDriver_OSS::GetData() /* XXX: There's a race on last_cursor_pos here: new data might be written after the * ioctl returns, incrementing last_cursor_pos. */ -std::int64_t RageSoundDriver_OSS::GetPosition() const +int64_t RageSoundDriver_OSS::GetPosition() const { ASSERT( fd != -1 ); diff --git a/src/arch/Sound/RageSoundDriver_OSS.h b/src/arch/Sound/RageSoundDriver_OSS.h index f1e61c4889..ad643d3540 100644 --- a/src/arch/Sound/RageSoundDriver_OSS.h +++ b/src/arch/Sound/RageSoundDriver_OSS.h @@ -26,7 +26,7 @@ public: int GetSampleRate() const { return samplerate; } /* virtuals: */ - std::int64_t GetPosition() const; + int64_t GetPosition() const; float GetPlayLatency() const; void SetupDecodingThread(); diff --git a/src/arch/Sound/RageSoundDriver_PulseAudio.cpp b/src/arch/Sound/RageSoundDriver_PulseAudio.cpp index 1c56307fa3..d171fae3ca 100644 --- a/src/arch/Sound/RageSoundDriver_PulseAudio.cpp +++ b/src/arch/Sound/RageSoundDriver_PulseAudio.cpp @@ -306,15 +306,15 @@ void RageSoundDriver_PulseAudio::StreamStateCb(pa_stream *s) } } -std::int64_t RageSoundDriver_PulseAudio::GetPosition() const +int64_t RageSoundDriver_PulseAudio::GetPosition() const { pa_threaded_mainloop_lock(m_PulseMainLoop); - std::int64_t position = GetPositionUnlocked(); + int64_t position = GetPositionUnlocked(); pa_threaded_mainloop_unlock(m_PulseMainLoop); return position; } -std::int64_t RageSoundDriver_PulseAudio::GetPositionUnlocked() const +int64_t RageSoundDriver_PulseAudio::GetPositionUnlocked() const { pa_usec_t usec; if(pa_stream_get_time(m_PulseStream, &usec) < 0) @@ -329,12 +329,12 @@ std::int64_t RageSoundDriver_PulseAudio::GetPositionUnlocked() const } size_t length = pa_usec_to_bytes(usec, &m_ss); - return length / (sizeof(std::int16_t) * 2); /* we use 16-bit frames and 2 channels */ + return length / (sizeof(int16_t) * 2); /* we use 16-bit frames and 2 channels */ } void RageSoundDriver_PulseAudio::StreamWriteCb(pa_stream *s, size_t length) { - std::int64_t curPos = GetPositionUnlocked(); + int64_t curPos = GetPositionUnlocked(); while(length > 0) { void* buf; @@ -344,10 +344,10 @@ void RageSoundDriver_PulseAudio::StreamWriteCb(pa_stream *s, size_t length) RageException::Throw("Pulse: pa_stream_begin_write() failed: %s", pa_strerror(pa_context_errno(m_PulseCtx))); } - const size_t nbframes = bufsize / sizeof(std::int16_t); /* we use 16-bit frames */ - std::int64_t pos1 = m_LastPosition; - std::int64_t pos2 = pos1 + nbframes/2; /* Mix() position in stereo frames */ - this->Mix( reinterpret_cast(buf), pos2-pos1, pos1, curPos); + const size_t nbframes = bufsize / sizeof(int16_t); /* we use 16-bit frames */ + int64_t pos1 = m_LastPosition; + int64_t pos2 = pos1 + nbframes/2; /* Mix() position in stereo frames */ + this->Mix( reinterpret_cast(buf), pos2-pos1, pos1, curPos); if(pa_stream_write(m_PulseStream, buf, bufsize, nullptr, 0, PA_SEEK_RELATIVE) < 0) { diff --git a/src/arch/Sound/RageSoundDriver_PulseAudio.h b/src/arch/Sound/RageSoundDriver_PulseAudio.h index 4bfb2dff38..8b170715c3 100644 --- a/src/arch/Sound/RageSoundDriver_PulseAudio.h +++ b/src/arch/Sound/RageSoundDriver_PulseAudio.h @@ -18,13 +18,13 @@ public: RString Init(); - std::int64_t GetPosition() const; + int64_t GetPosition() const; inline int GetSampleRate() const { return m_ss.rate; }; protected: - std::int64_t GetPositionUnlocked() const; + int64_t GetPositionUnlocked() const; - std::int64_t m_LastPosition; + int64_t m_LastPosition; pa_sample_spec m_ss; char *m_Error; diff --git a/src/arch/Sound/RageSoundDriver_WDMKS.cpp b/src/arch/Sound/RageSoundDriver_WDMKS.cpp index 84cb1437b5..a93cc23a80 100644 --- a/src/arch/Sound/RageSoundDriver_WDMKS.cpp +++ b/src/arch/Sound/RageSoundDriver_WDMKS.cpp @@ -1025,7 +1025,7 @@ bool WinWdmStream::SubmitPacket( int iPacket, RString &sError ) #include namespace { - void MapChannels( const std::int16_t *pIn, std::int16_t *pOut, int iInChannels, int iOutChannels, int iFrames, const int *pChannelMap ) + void MapChannels( const int16_t *pIn, int16_t *pOut, int iInChannels, int iOutChannels, int iFrames, const int *pChannelMap ) { for( int i = 0; i < iFrames; ++i ) { @@ -1049,7 +1049,7 @@ namespace } } - void MapChannels( const std::int16_t *pIn, std::int16_t *pOut, int iInChannels, int iOutChannels, int iFrames ) + void MapChannels( const int16_t *pIn, int16_t *pOut, int iInChannels, int iOutChannels, int iFrames ) { static const int i1ChannelMap[] = { -2 }; static const int i4ChannelMap[] = { 0, 1, 0, 1 }; @@ -1067,7 +1067,7 @@ namespace MapChannels( pIn, pOut, iInChannels, iOutChannels, iFrames, pChannelMap ); } - void MapSampleFormatFromInt16( const std::int16_t *pIn, void *pOut, int iSamples, DeviceSampleFormat FromFormat ) + void MapSampleFormatFromInt16( const int16_t *pIn, void *pOut, int iSamples, DeviceSampleFormat FromFormat ) { switch( FromFormat ) { @@ -1092,7 +1092,7 @@ namespace } case DeviceSampleFormat_Int32: { - std::int16_t *pOutBuf = (std::int16_t *) pOut; + int16_t *pOutBuf = (int16_t *) pOut; for( int i = 0; i < iSamples; ++i ) { *pOutBuf++ = 0; @@ -1112,29 +1112,29 @@ void RageSoundDriver_WDMKS::Read( void *pData, int iFrames, int iLastCursorPos, if( m_pStream->m_iDeviceOutputChannels == iChannels && m_pStream->m_DeviceSampleFormat == DeviceSampleFormat_Int16 ) { - std::int16_t *pBuf = (std::int16_t *) pData; + int16_t *pBuf = (int16_t *) pData; this->Mix( pBuf, iFrames, iLastCursorPos, iCurrentFrame ); return; } - std::int16_t *pBuf = (std::int16_t *) alloca( iFrames * iChannels * sizeof(std::int16_t) ); - this->Mix( (std::int16_t *) pBuf, iFrames, iLastCursorPos, iCurrentFrame ); + int16_t *pBuf = (int16_t *) alloca( iFrames * iChannels * sizeof(int16_t) ); + this->Mix( (int16_t *) pBuf, iFrames, iLastCursorPos, iCurrentFrame ); /* If the device has other than 2 channels, convert. */ if( m_pStream->m_iDeviceOutputChannels != iChannels ) { - std::int16_t *pTempBuf = (std::int16_t *) alloca( iFrames * m_pStream->m_iBytesPerOutputSample * m_pStream->m_iDeviceOutputChannels ); - MapChannels( (std::int16_t *) pBuf, pTempBuf, iChannels, m_pStream->m_iDeviceOutputChannels, iFrames ); + int16_t *pTempBuf = (int16_t *) alloca( iFrames * m_pStream->m_iBytesPerOutputSample * m_pStream->m_iDeviceOutputChannels ); + MapChannels( (int16_t *) pBuf, pTempBuf, iChannels, m_pStream->m_iDeviceOutputChannels, iFrames ); pBuf = pTempBuf; } - /* If the device format isn't std::int16_t, convert. */ + /* If the device format isn't int16_t, convert. */ if( m_pStream->m_DeviceSampleFormat != DeviceSampleFormat_Int16 ) { int iSamples = iFrames * m_pStream->m_iDeviceOutputChannels; void *pTempBuf = alloca( iSamples * m_pStream->m_iBytesPerOutputSample ); - MapSampleFormatFromInt16( (std::int16_t *) pBuf, pTempBuf, iSamples, m_pStream->m_DeviceSampleFormat ); - pBuf = (std::int16_t *) pTempBuf; + MapSampleFormatFromInt16( (int16_t *) pBuf, pTempBuf, iSamples, m_pStream->m_DeviceSampleFormat ); + pBuf = (int16_t *) pTempBuf; } memcpy( pData, pBuf, iFrames * m_pStream->m_iDeviceOutputChannels * m_pStream->m_iBytesPerOutputSample ); @@ -1236,7 +1236,7 @@ void RageSoundDriver_WDMKS::SetupDecodingThread() LOG->Warn( werr_ssprintf(GetLastError(), "Failed to set sound thread priority") ); } -std::int64_t RageSoundDriver_WDMKS::GetPosition() const +int64_t RageSoundDriver_WDMKS::GetPosition() const { KSAUDIO_POSITION pos; diff --git a/src/arch/Sound/RageSoundDriver_WDMKS.h b/src/arch/Sound/RageSoundDriver_WDMKS.h index 2f3ffa6564..3908d42ebc 100644 --- a/src/arch/Sound/RageSoundDriver_WDMKS.h +++ b/src/arch/Sound/RageSoundDriver_WDMKS.h @@ -18,7 +18,7 @@ public: ~RageSoundDriver_WDMKS(); RString Init(); - std::int64_t GetPosition() const; + int64_t GetPosition() const; float GetPlayLatency() const; int GetSampleRate() const; diff --git a/src/arch/Sound/RageSoundDriver_WaveOut.cpp b/src/arch/Sound/RageSoundDriver_WaveOut.cpp index 0b70c2f916..c40f7b7626 100644 --- a/src/arch/Sound/RageSoundDriver_WaveOut.cpp +++ b/src/arch/Sound/RageSoundDriver_WaveOut.cpp @@ -75,7 +75,7 @@ bool RageSoundDriver_WaveOut::GetData() return false; /* Call the callback. */ - this->Mix( (std::int16_t *) m_aBuffers[b].lpData, CHUNKSIZE_FRAMES, m_iLastCursorPos, GetPosition() ); + this->Mix( (int16_t *) m_aBuffers[b].lpData, CHUNKSIZE_FRAMES, m_iLastCursorPos, GetPosition() ); MMRESULT ret = waveOutWrite( m_hWaveOut, &m_aBuffers[b], sizeof(m_aBuffers[b]) ); if( ret != MMSYSERR_NOERROR ) @@ -99,7 +99,7 @@ void RageSoundDriver_WaveOut::SetupDecodingThread() LOG->Warn( werr_ssprintf(GetLastError(), "Failed to set sound thread priority") ); } -std::int64_t RageSoundDriver_WaveOut::GetPosition() const +int64_t RageSoundDriver_WaveOut::GetPosition() const { MMTIME tm; tm.wType = TIME_SAMPLES; diff --git a/src/arch/Sound/RageSoundDriver_WaveOut.h b/src/arch/Sound/RageSoundDriver_WaveOut.h index 6b38b216be..c3be49d477 100644 --- a/src/arch/Sound/RageSoundDriver_WaveOut.h +++ b/src/arch/Sound/RageSoundDriver_WaveOut.h @@ -15,7 +15,7 @@ public: RageSoundDriver_WaveOut(); ~RageSoundDriver_WaveOut(); RString Init(); - std::int64_t GetPosition() const; + int64_t GetPosition() const; float GetPlayLatency() const; int GetSampleRate() const { return m_iSampleRate; } static const int NUM_BUFFERS = 32; diff --git a/src/archutils/Unix/Backtrace.cpp b/src/archutils/Unix/Backtrace.cpp index 3121ef8117..95d291aa43 100644 --- a/src/archutils/Unix/Backtrace.cpp +++ b/src/archutils/Unix/Backtrace.cpp @@ -39,9 +39,9 @@ static const char *itoa(unsigned n) return p; } -static std::intptr_t xtoi( const char *hex ) +static intptr_t xtoi( const char *hex ) { - std::intptr_t ret = 0; + intptr_t ret = 0; for(;;) { int val = -1; @@ -502,7 +502,7 @@ static bool PointsToValidCall( vm_address_t start, const void *ptr ) /* We're reading buf backwards, between buf[-7] and buf[-1]. Find out how * far we can read. */ - const int len = std::min(std::intptr_t(ptr) - start, 7); + const int len = std::min(intptr_t(ptr) - start, 7); // Permissible CALL sequences that we care about: // @@ -639,7 +639,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx ) buf[i++] = p; } } - frame = (Frame *)(std::intptr_t(frame)+4); + frame = (Frame *)(intptr_t(frame)+4); continue; } // Valid. diff --git a/src/archutils/Unix/BacktraceNames.cpp b/src/archutils/Unix/BacktraceNames.cpp index f3de602f75..a297e510dc 100644 --- a/src/archutils/Unix/BacktraceNames.cpp +++ b/src/archutils/Unix/BacktraceNames.cpp @@ -101,7 +101,7 @@ RString BacktraceNames::Format() const #include void BacktraceNames::FromAddr( void * const p ) { - Address = (std::intptr_t) p; + Address = (intptr_t) p; /* * When calling a function that doesn't return, gcc will truncate a function. @@ -226,7 +226,7 @@ static const char *osx_find_link_edit( const struct mach_header *header ) void BacktraceNames::FromAddr( void * const p ) { - Address = (std::intptr_t) p; + Address = (intptr_t) p; /* Find the image with the given pointer. */ int index = osx_find_image( p ); @@ -298,7 +298,7 @@ void BacktraceNames::FromAddr( void * const p ) #include void BacktraceNames::FromAddr( void * const p ) { - Address = (std::intptr_t) p; + Address = (intptr_t) p; char **foo = backtrace_symbols(&p, 1); if( foo == nullptr ) @@ -346,7 +346,7 @@ void BacktraceNames::FromString( RString s ) #warning Undefined BACKTRACE_LOOKUP_METHOD_* void BacktraceNames::FromAddr( void * const p ) { - Address = std::intptr_t(p); + Address = intptr_t(p); Offset = 0; Symbol = ""; File = ""; diff --git a/src/archutils/Unix/BacktraceNames.h b/src/archutils/Unix/BacktraceNames.h index 896c90a0b0..ca237ac406 100644 --- a/src/archutils/Unix/BacktraceNames.h +++ b/src/archutils/Unix/BacktraceNames.h @@ -6,7 +6,7 @@ struct BacktraceNames { RString Symbol, File; - std::intptr_t Address; + intptr_t Address; int Offset; void FromAddr( void * const p ); void FromString( RString str ); diff --git a/src/archutils/Win32/CrashHandlerChild.cpp b/src/archutils/Win32/CrashHandlerChild.cpp index c20110bb2f..3dffc421ee 100644 --- a/src/archutils/Win32/CrashHandlerChild.cpp +++ b/src/archutils/Win32/CrashHandlerChild.cpp @@ -189,7 +189,7 @@ namespace VDDebugInfo return heap; } - std::intptr_t VDDebugInfoLookupRVA( const Context *pctx, uintptr_t rva, char *buf, int buflen ) + intptr_t VDDebugInfoLookupRVA( const Context *pctx, uintptr_t rva, char *buf, int buflen ) { if( !PointerIsInAnySegment(pctx, rva) ) return -1; @@ -201,7 +201,7 @@ namespace VDDebugInfo // Linearly unpack RVA deltas and find lower_bound rva -= pctx->nFirstRVA; - if( static_cast(rva) < 0 ) + if( static_cast(rva) < 0 ) return -1; while( pr < pr_limit ) @@ -218,7 +218,7 @@ namespace VDDebugInfo rva -= diff; - if (static_cast(rva) < 0) { + if (static_cast(rva) < 0) { rva += diff; break; } @@ -237,7 +237,7 @@ namespace VDDebugInfo strncpy( buf, fn_name, buflen ); buf[buflen-1] = 0; - return static_cast(rva); + return static_cast(rva); } } @@ -370,7 +370,7 @@ namespace SymbolLookup VirtualQueryEx( g_hParent, ptr, &meminfo, sizeof meminfo ); char tmp[512]; - std::intptr_t iAddress = VDDebugInfo::VDDebugInfoLookupRVA(pctx, reinterpret_cast(ptr), tmp, sizeof(tmp)); + intptr_t iAddress = VDDebugInfo::VDDebugInfoLookupRVA(pctx, reinterpret_cast(ptr), tmp, sizeof(tmp)); if( iAddress >= 0 ) { wsprintf( buf, "%" ADDRESS_ZEROS "Ix: %s [%" ADDRESS_ZEROS "Ix+%Ix+%Ix]", reinterpret_cast(ptr), Demangle(tmp), diff --git a/src/archutils/Win32/GotoURL.cpp b/src/archutils/Win32/GotoURL.cpp index 5af5ab8651..6fe07bdb8c 100644 --- a/src/archutils/Win32/GotoURL.cpp +++ b/src/archutils/Win32/GotoURL.cpp @@ -28,7 +28,7 @@ static LONG GetRegKey( HKEY key, RString subkey, LPTSTR retdata ) bool GotoURL( RString sUrl ) { // First try ShellExecute() - std::intptr_t iRet = reinterpret_cast(ShellExecute( nullptr, "open", sUrl, nullptr, nullptr, SW_SHOWDEFAULT )); + intptr_t iRet = reinterpret_cast(ShellExecute( nullptr, "open", sUrl, nullptr, nullptr, SW_SHOWDEFAULT )); // If it failed, get the .htm regkey and lookup the program if( iRet > 32 ) diff --git a/src/tests/test_audio_readers.cpp b/src/tests/test_audio_readers.cpp index cc3f2145bb..535b346b41 100644 --- a/src/tests/test_audio_readers.cpp +++ b/src/tests/test_audio_readers.cpp @@ -46,7 +46,7 @@ void dump_bin( const char *fn, const char *buf, int size ) close( fd ); } -void dump( const char *fn, const std::int16_t *buf, int samples ) +void dump( const char *fn, const int16_t *buf, int samples ) { FILE *f = fopen( fn, "w+"); ASSERT( f ); @@ -72,7 +72,7 @@ void dump( const char *buf, int size ) printf("\n\n"); } -void dump( const std::int16_t *buf, int samples ) +void dump( const int16_t *buf, int samples ) { for( int i = 0; i < samples; ++i ) printf( "0x%04hx,", buf[i] ); @@ -86,11 +86,11 @@ void dump( const float *buf, int samples ) printf( "\n" ); } -bool compare( const float *m1, const std::int16_t *m2, int iSamples ) +bool compare( const float *m1, const int16_t *m2, int iSamples ) { for( int i = 0; i < iSamples; ++i ) { - std::int16_t iSample1 = std::lrint(m1[i]*32768); + int16_t iSample1 = std::lrint(m1[i]*32768); if( iSample1 != m2[i] ) return false; } @@ -99,7 +99,7 @@ bool compare( const float *m1, const std::int16_t *m2, int iSamples ) } -void compare_buffers( const std::int16_t *expect, const std::int16_t *got, int frames, +void compare_buffers( const int16_t *expect, const int16_t *got, int frames, int &NumInaccurateSamplesAtStart, int &NumInaccurateSamples ) { @@ -125,7 +125,7 @@ void compare_buffers( const std::int16_t *expect, const std::int16_t *got, int f } -bool compare_buffers( const std::int16_t *expect, const std::int16_t *got, int frames, int channels ) +bool compare_buffers( const int16_t *expect, const int16_t *got, int frames, int channels ) { /* * Compare each channel separately. Try to figure out if @@ -165,8 +165,8 @@ bool test_read( RageSoundReader *snd, float *expected_data, int frames ) int got = snd->Read( buf, frames ); ASSERT( got == frames ); - //compare_buffers( (const std::int16_t *) expected_data, - // (const std::int16_t *) buf, + //compare_buffers( (const int16_t *) expected_data, + // (const int16_t *) buf, // bytes/2, // 2 ); @@ -258,7 +258,7 @@ const int TestDataSize = 2; /* Find "haystack" in "needle". Start looking at "expect" and move outward; find * the closest. */ void *xmemsearch( const float *haystack, size_t iHaystackSamples, - const std::int16_t *needle, size_t iNeedleSamples, + const int16_t *needle, size_t iNeedleSamples, int expect ) { if( !iNeedleSamples ) @@ -301,10 +301,10 @@ struct TestFile int SilentFrames; /* The first two frames (four samples): */ - std::int16_t initial[TestDataSize*2]; + int16_t initial[TestDataSize*2]; /* Frames of data half a second in: */ - std::int16_t later[TestDataSize*2]; + int16_t later[TestDataSize*2]; }; const int channels = 2; @@ -378,7 +378,7 @@ bool RunTests( RageSoundReader *snd, const TestFile &tf ) dump( LaterData, 16 ); /* See if we can find the half second data. */ - float *p = (float *) xmemsearch( sdata, one_second_bytes, tf.later, sizeof(tf.later), LaterOffsetSamples*sizeof(std::int16_t) ); + float *p = (float *) xmemsearch( sdata, one_second_bytes, tf.later, sizeof(tf.later), LaterOffsetSamples*sizeof(int16_t) ); if( p ) { int SamplesOff = p-sdata; @@ -387,7 +387,7 @@ bool RunTests( RageSoundReader *snd, const TestFile &tf ) FramesOff, LaterOffsetFrames, FramesOff-LaterOffsetFrames ); } // else -// dump( "foo", sdata, one_second/sizeof(std::int16_t) ); +// dump( "foo", sdata, one_second/sizeof(int16_t) ); } }