mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
engine: fix UB on MSG_BigShort
This commit is contained in:
parent
6cc2205321
commit
efaf7ac622
@ -27,7 +27,7 @@ GNU General Public License for more details.
|
|||||||
static dword BitWriteMasks[32][33];
|
static dword BitWriteMasks[32][33];
|
||||||
static dword ExtraMasks[32];
|
static dword ExtraMasks[32];
|
||||||
|
|
||||||
short MSG_BigShort( short swap )
|
unsigned short MSG_BigShort( unsigned short swap )
|
||||||
{
|
{
|
||||||
return (swap >> 8)|(swap << 8);
|
return (swap >> 8)|(swap << 8);
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ void MSG_ExciseBits( sizebuf_t *sb, int startbit, int bitstoremove );
|
|||||||
_inline int MSG_TellBit( sizebuf_t *sb ) { return sb->iCurBit; }
|
_inline int MSG_TellBit( sizebuf_t *sb ) { return sb->iCurBit; }
|
||||||
_inline const char *MSG_GetName( sizebuf_t *sb ) { return sb->pDebugName; }
|
_inline const char *MSG_GetName( sizebuf_t *sb ) { return sb->pDebugName; }
|
||||||
qboolean MSG_CheckOverflow( sizebuf_t *sb );
|
qboolean MSG_CheckOverflow( sizebuf_t *sb );
|
||||||
short MSG_BigShort( short swap );
|
unsigned short MSG_BigShort( unsigned short swap );
|
||||||
|
|
||||||
// init writing
|
// init writing
|
||||||
void MSG_StartWriting( sizebuf_t *sb, void *pData, int nBytes, int iStartBit, int nBits );
|
void MSG_StartWriting( sizebuf_t *sb, void *pData, int nBytes, int iStartBit, int nBits );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user