mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-26 04:05:53 +01:00
Fix pointer truncation on 64-bit
Use size_t instead of int for arithmetic on pointers, to avoid truncation on ILP64 architectures (like amd64).
This commit is contained in:
parent
26f1a33749
commit
3adda272b7
|
@ -147,7 +147,7 @@ void CSoundObject::Set3DParameters( FLOAT fFalloff, FLOAT fHotSpot,
|
|||
//CPrintF("SET3D: ");
|
||||
CEntity *pen = so_penEntity->GetPredictionTail();
|
||||
if (pen!=so_penEntity) {
|
||||
pso = (CSoundObject *)( ((UBYTE*)pen) + (int(this)-int(so_penEntity)) );
|
||||
pso = (CSoundObject *)( ((UBYTE*)pen) + (size_t(this)-size_t(so_penEntity)) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ CSoundObject *CSoundObject::GetPredictionTail(ULONG ulTypeID, ULONG ulEventID)
|
|||
// it must not play the sound
|
||||
return NULL;
|
||||
}
|
||||
SLONG slOffset = int(this)-int(so_penEntity);
|
||||
SLONG slOffset = size_t(this)-size_t(so_penEntity);
|
||||
|
||||
ULONG ulCRC;
|
||||
CRC_Start(ulCRC);
|
||||
|
|
Loading…
Reference in New Issue
Block a user