Browse Source

win64: misc pointer truncation fixes

win64
HappyDOGE 1 year ago
parent
commit
bfb5b44d38
  1. 2
      engine/downloadthread.cpp
  2. 2
      filesystem/filesystem_stdio.cpp
  3. 2
      game/server/ai_navigator.cpp
  4. 2
      materialsystem/CColorCorrection.cpp
  5. 4
      studiorender/r_studiodraw.cpp

2
engine/downloadthread.cpp

@ -425,7 +425,7 @@ DWORD __stdcall DownloadThread( void *voidPtr ) @@ -425,7 +425,7 @@ DWORD __stdcall DownloadThread( void *voidPtr )
//Thread_DPrintf( "Requesting full download\n%s", headers );
}
rc.hDataResource = InternetOpenUrl(rc.hOpenResource, fullURL, headerPtr, headerLen, flags,(DWORD)(&rc) );
rc.hDataResource = InternetOpenUrl(rc.hOpenResource, fullURL, headerPtr, headerLen, flags, (DWORD_PTR)(&rc) );
// send the request off
if ( !rc.hDataResource )

2
filesystem/filesystem_stdio.cpp

@ -1413,7 +1413,7 @@ size_t CWin32ReadOnlyFile::FS_fread( void *dest, size_t destSize, size_t size ) @@ -1413,7 +1413,7 @@ size_t CWin32ReadOnlyFile::FS_fread( void *dest, size_t destSize, size_t size )
if ( m_hFileUnbuffered != INVALID_HANDLE_VALUE )
{
const int destBaseAlign = ( IsX360() ) ? 4 : m_SectorSize;
bool bDestBaseIsAligned = ( (DWORD)dest % destBaseAlign == 0 );
bool bDestBaseIsAligned = ( (DWORD_PTR)dest % destBaseAlign == 0 );
bool bCanReadUnbufferedDirect = ( bDestBaseIsAligned && ( destSize % m_SectorSize == 0 ) && ( m_ReadPos % m_SectorSize == 0 ) );
if ( bCanReadUnbufferedDirect )

2
game/server/ai_navigator.cpp

@ -1222,7 +1222,7 @@ float CAI_Navigator::GetPathTimeToGoal() @@ -1222,7 +1222,7 @@ float CAI_Navigator::GetPathTimeToGoal()
AI_PathNode_t CAI_Navigator::GetNearestNode()
{
#ifdef WIN32
COMPILE_TIME_ASSERT( (int)AIN_NO_NODE == NO_NODE );
COMPILE_TIME_ASSERT( (intp)AIN_NO_NODE == NO_NODE );
#endif
return (AI_PathNode_t)(intp)( GetPathfinder()->NearestNodeToNPC() );
}

2
materialsystem/CColorCorrection.cpp

@ -79,7 +79,7 @@ ColorCorrectionLookup_t::~ColorCorrectionLookup_t( ) @@ -79,7 +79,7 @@ ColorCorrectionLookup_t::~ColorCorrectionLookup_t( )
void ColorCorrectionLookup_t::AllocTexture()
{
char name[64];
sprintf( name, "ColorCorrection - %d", m_Handle );
sprintf( name, "ColorCorrection - %p", m_Handle );
m_pColorCorrectionTexture = ITextureInternal::CreateProceduralTexture( name, TEXTURE_GROUP_OTHER,
COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, IMAGE_FORMAT_BGRX8888,

4
studiorender/r_studiodraw.cpp

@ -1138,7 +1138,7 @@ public: @@ -1138,7 +1138,7 @@ public:
if ( nHasSIMD )
{
// Precaches the data
_mm_prefetch( (char*)((int)pGroupToMesh & (~0x1F)), _MM_HINT_NTA );
_mm_prefetch( (char*)((intp)pGroupToMesh & (~0x1F)), _MM_HINT_NTA );
}
#endif
for ( int i = 0; i < PREFETCH_VERT_COUNT; ++i )
@ -1165,7 +1165,7 @@ public: @@ -1165,7 +1165,7 @@ public:
if ( nHasSIMD )
{
char *pMem = (char*)&pGroupToMesh[j + PREFETCH_VERT_COUNT + 1];
_mm_prefetch( (char*)((int)pMem & (~0x1F)), _MM_HINT_NTA );
_mm_prefetch( (char*)((intp)pMem & (~0x1F)), _MM_HINT_NTA );
}
#endif
idx = j & (PREFETCH_VERT_COUNT-1);

Loading…
Cancel
Save