mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
change the value type for MSG_Write(Byte|Short|Long) from unsigned int to
int to avoid float -> unsigned int conversion problems
This commit is contained in:
parent
3431b7ce82
commit
451eaba2e1
2 changed files with 12 additions and 12 deletions
|
@ -30,9 +30,9 @@
|
|||
|
||||
#include "QF/sizebuf.h"
|
||||
|
||||
void MSG_WriteByte (sizebuf_t *sb, unsigned int c);
|
||||
void MSG_WriteShort (sizebuf_t *sb, unsigned int c);
|
||||
void MSG_WriteLong (sizebuf_t *sb, unsigned int c);
|
||||
void MSG_WriteByte (sizebuf_t *sb, int c);
|
||||
void MSG_WriteShort (sizebuf_t *sb, int c);
|
||||
void MSG_WriteLong (sizebuf_t *sb, int c);
|
||||
void MSG_WriteFloat (sizebuf_t *sb, float f);
|
||||
void MSG_WriteString (sizebuf_t *sb, const char *s);
|
||||
void MSG_WriteCoord (sizebuf_t *sb, float coord);
|
||||
|
|
|
@ -52,7 +52,7 @@ static const char rcsid[] =
|
|||
// writing functions ==========================================================
|
||||
|
||||
void
|
||||
MSG_WriteByte (sizebuf_t *sb, unsigned int c)
|
||||
MSG_WriteByte (sizebuf_t *sb, int c)
|
||||
{
|
||||
byte *buf;
|
||||
|
||||
|
@ -61,25 +61,25 @@ MSG_WriteByte (sizebuf_t *sb, unsigned int c)
|
|||
}
|
||||
|
||||
void
|
||||
MSG_WriteShort (sizebuf_t *sb, unsigned int c)
|
||||
MSG_WriteShort (sizebuf_t *sb, int c)
|
||||
{
|
||||
byte *buf;
|
||||
|
||||
buf = SZ_GetSpace (sb, 2);
|
||||
*buf++ = c & 0xff;
|
||||
*buf = c >> 8;
|
||||
*buf++ = ((unsigned int) c) & 0xff;
|
||||
*buf = ((unsigned int) c) >> 8;
|
||||
}
|
||||
|
||||
void
|
||||
MSG_WriteLong (sizebuf_t *sb, unsigned int c)
|
||||
MSG_WriteLong (sizebuf_t *sb, int c)
|
||||
{
|
||||
byte *buf;
|
||||
|
||||
buf = SZ_GetSpace (sb, 4);
|
||||
*buf++ = c & 0xff;
|
||||
*buf++ = (c >> 8) & 0xff;
|
||||
*buf++ = (c >> 16) & 0xff;
|
||||
*buf = c >> 24;
|
||||
*buf++ = ((unsigned int) c) & 0xff;
|
||||
*buf++ = (((unsigned int) c) >> 8) & 0xff;
|
||||
*buf++ = (((unsigned int) c) >> 16) & 0xff;
|
||||
*buf = ((unsigned int) c) >> 24;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue