Skip to content

Commit bfb5b44

Browse files
committed
win64: misc pointer truncation fixes
1 parent bc909e9 commit bfb5b44

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

engine/downloadthread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ DWORD __stdcall DownloadThread( void *voidPtr )
425425
//Thread_DPrintf( "Requesting full download\n%s", headers );
426426
}
427427

428-
rc.hDataResource = InternetOpenUrl(rc.hOpenResource, fullURL, headerPtr, headerLen, flags,(DWORD)(&rc) );
428+
rc.hDataResource = InternetOpenUrl(rc.hOpenResource, fullURL, headerPtr, headerLen, flags, (DWORD_PTR)(&rc) );
429429

430430
// send the request off
431431
if ( !rc.hDataResource )

filesystem/filesystem_stdio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ size_t CWin32ReadOnlyFile::FS_fread( void *dest, size_t destSize, size_t size )
14131413
if ( m_hFileUnbuffered != INVALID_HANDLE_VALUE )
14141414
{
14151415
const int destBaseAlign = ( IsX360() ) ? 4 : m_SectorSize;
1416-
bool bDestBaseIsAligned = ( (DWORD)dest % destBaseAlign == 0 );
1416+
bool bDestBaseIsAligned = ( (DWORD_PTR)dest % destBaseAlign == 0 );
14171417
bool bCanReadUnbufferedDirect = ( bDestBaseIsAligned && ( destSize % m_SectorSize == 0 ) && ( m_ReadPos % m_SectorSize == 0 ) );
14181418

14191419
if ( bCanReadUnbufferedDirect )

game/server/ai_navigator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ float CAI_Navigator::GetPathTimeToGoal()
12221222
AI_PathNode_t CAI_Navigator::GetNearestNode()
12231223
{
12241224
#ifdef WIN32
1225-
COMPILE_TIME_ASSERT( (int)AIN_NO_NODE == NO_NODE );
1225+
COMPILE_TIME_ASSERT( (intp)AIN_NO_NODE == NO_NODE );
12261226
#endif
12271227
return (AI_PathNode_t)(intp)( GetPathfinder()->NearestNodeToNPC() );
12281228
}

materialsystem/CColorCorrection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ ColorCorrectionLookup_t::~ColorCorrectionLookup_t( )
7979
void ColorCorrectionLookup_t::AllocTexture()
8080
{
8181
char name[64];
82-
sprintf( name, "ColorCorrection - %d", m_Handle );
82+
sprintf( name, "ColorCorrection - %p", m_Handle );
8383

8484
m_pColorCorrectionTexture = ITextureInternal::CreateProceduralTexture( name, TEXTURE_GROUP_OTHER,
8585
COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, IMAGE_FORMAT_BGRX8888,

studiorender/r_studiodraw.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ class CProcessMeshWrapper
11381138
if ( nHasSIMD )
11391139
{
11401140
// Precaches the data
1141-
_mm_prefetch( (char*)((int)pGroupToMesh & (~0x1F)), _MM_HINT_NTA );
1141+
_mm_prefetch( (char*)((intp)pGroupToMesh & (~0x1F)), _MM_HINT_NTA );
11421142
}
11431143
#endif
11441144
for ( int i = 0; i < PREFETCH_VERT_COUNT; ++i )
@@ -1165,7 +1165,7 @@ class CProcessMeshWrapper
11651165
if ( nHasSIMD )
11661166
{
11671167
char *pMem = (char*)&pGroupToMesh[j + PREFETCH_VERT_COUNT + 1];
1168-
_mm_prefetch( (char*)((int)pMem & (~0x1F)), _MM_HINT_NTA );
1168+
_mm_prefetch( (char*)((intp)pMem & (~0x1F)), _MM_HINT_NTA );
11691169
}
11701170
#endif
11711171
idx = j & (PREFETCH_VERT_COUNT-1);

0 commit comments

Comments
 (0)