win64: misc pointer truncation fixes

This commit is contained in:
HappyDOGE 2023-01-16 11:56:05 +03:00
parent bc909e9f96
commit bfb5b44d38
5 changed files with 6 additions and 6 deletions

View File

@ -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 )

View File

@ -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 )

View File

@ -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() );
}

View File

@ -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,

View File

@ -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:
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);