mirror of
https://github.com/nillerusr/source-engine.git
synced 2024-12-22 14:16:50 +00:00
win64: misc pointer truncation fixes
This commit is contained in:
parent
bc909e9f96
commit
bfb5b44d38
@ -425,7 +425,7 @@ DWORD __stdcall DownloadThread( void *voidPtr )
|
|||||||
//Thread_DPrintf( "Requesting full download\n%s", headers );
|
//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
|
// send the request off
|
||||||
if ( !rc.hDataResource )
|
if ( !rc.hDataResource )
|
||||||
|
@ -1413,7 +1413,7 @@ size_t CWin32ReadOnlyFile::FS_fread( void *dest, size_t destSize, size_t size )
|
|||||||
if ( m_hFileUnbuffered != INVALID_HANDLE_VALUE )
|
if ( m_hFileUnbuffered != INVALID_HANDLE_VALUE )
|
||||||
{
|
{
|
||||||
const int destBaseAlign = ( IsX360() ) ? 4 : m_SectorSize;
|
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 ) );
|
bool bCanReadUnbufferedDirect = ( bDestBaseIsAligned && ( destSize % m_SectorSize == 0 ) && ( m_ReadPos % m_SectorSize == 0 ) );
|
||||||
|
|
||||||
if ( bCanReadUnbufferedDirect )
|
if ( bCanReadUnbufferedDirect )
|
||||||
|
@ -1222,7 +1222,7 @@ float CAI_Navigator::GetPathTimeToGoal()
|
|||||||
AI_PathNode_t CAI_Navigator::GetNearestNode()
|
AI_PathNode_t CAI_Navigator::GetNearestNode()
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
COMPILE_TIME_ASSERT( (int)AIN_NO_NODE == NO_NODE );
|
COMPILE_TIME_ASSERT( (intp)AIN_NO_NODE == NO_NODE );
|
||||||
#endif
|
#endif
|
||||||
return (AI_PathNode_t)(intp)( GetPathfinder()->NearestNodeToNPC() );
|
return (AI_PathNode_t)(intp)( GetPathfinder()->NearestNodeToNPC() );
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ ColorCorrectionLookup_t::~ColorCorrectionLookup_t( )
|
|||||||
void ColorCorrectionLookup_t::AllocTexture()
|
void ColorCorrectionLookup_t::AllocTexture()
|
||||||
{
|
{
|
||||||
char name[64];
|
char name[64];
|
||||||
sprintf( name, "ColorCorrection - %d", m_Handle );
|
sprintf( name, "ColorCorrection - %p", m_Handle );
|
||||||
|
|
||||||
m_pColorCorrectionTexture = ITextureInternal::CreateProceduralTexture( name, TEXTURE_GROUP_OTHER,
|
m_pColorCorrectionTexture = ITextureInternal::CreateProceduralTexture( name, TEXTURE_GROUP_OTHER,
|
||||||
COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, IMAGE_FORMAT_BGRX8888,
|
COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, IMAGE_FORMAT_BGRX8888,
|
||||||
|
@ -1138,7 +1138,7 @@ public:
|
|||||||
if ( nHasSIMD )
|
if ( nHasSIMD )
|
||||||
{
|
{
|
||||||
// Precaches the data
|
// Precaches the data
|
||||||
_mm_prefetch( (char*)((int)pGroupToMesh & (~0x1F)), _MM_HINT_NTA );
|
_mm_prefetch( (char*)((intp)pGroupToMesh & (~0x1F)), _MM_HINT_NTA );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
for ( int i = 0; i < PREFETCH_VERT_COUNT; ++i )
|
for ( int i = 0; i < PREFETCH_VERT_COUNT; ++i )
|
||||||
@ -1165,7 +1165,7 @@ public:
|
|||||||
if ( nHasSIMD )
|
if ( nHasSIMD )
|
||||||
{
|
{
|
||||||
char *pMem = (char*)&pGroupToMesh[j + PREFETCH_VERT_COUNT + 1];
|
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
|
#endif
|
||||||
idx = j & (PREFETCH_VERT_COUNT-1);
|
idx = j & (PREFETCH_VERT_COUNT-1);
|
||||||
|
Loading…
Reference in New Issue
Block a user