nuke MSG_ReadChar. Other than the sign extention, it's redundant and nothing

a suitable typecast can't take care of.
This commit is contained in:
Bill Currie 2002-07-02 19:15:29 +00:00
parent 5e5fdb7bc2
commit 91dc5b20db
3 changed files with 8 additions and 19 deletions

View file

@ -179,17 +179,6 @@ MSG_GetReadCount (msg_t *msg)
return msg->readcount; return msg->readcount;
} }
// returns -1 and sets msg->badread if no more characters are available
int
MSG_ReadChar (msg_t *msg)
{
if (msg->readcount + 1 <= msg->message->cursize)
return (signed char) msg->message->data[msg->readcount++];
msg->badread = true;
return -1;
}
int int
MSG_ReadByte (msg_t *msg) MSG_ReadByte (msg_t *msg)
{ {
@ -317,14 +306,14 @@ MSG_ReadCoordAngleV (msg_t *msg, vec3_t coord, vec3_t angles)
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
coord[i] = MSG_ReadShort (msg) * (1.0 / 8.0); coord[i] = MSG_ReadShort (msg) * (1.0 / 8.0);
angles[i] = MSG_ReadChar (msg) * (360.0 / 256.0); angles[i] = ((signed char) MSG_ReadByte (msg)) * (360.0 / 256.0);
} }
} }
float float
MSG_ReadAngle (msg_t *msg) MSG_ReadAngle (msg_t *msg)
{ {
return MSG_ReadChar (msg) * (360.0 / 256.0); return ((signed char) MSG_ReadByte (msg)) * (360.0 / 256.0);
} }
void void
@ -333,7 +322,7 @@ MSG_ReadAngleV (msg_t *msg, vec3_t angles)
int i; int i;
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
angles[i] = MSG_ReadChar (msg) * (360.0 / 256.0); angles[i] = ((signed char) MSG_ReadByte (msg)) * (360.0 / 256.0);
} }
float float

View file

@ -509,23 +509,23 @@ CL_ParseClientdata (int bits)
int i, j; int i, j;
if (bits & SU_VIEWHEIGHT) if (bits & SU_VIEWHEIGHT)
cl.viewheight = MSG_ReadChar (net_message); cl.viewheight = ((signed char) MSG_ReadByte (net_message));
else else
cl.viewheight = DEFAULT_VIEWHEIGHT; cl.viewheight = DEFAULT_VIEWHEIGHT;
if (bits & SU_IDEALPITCH) if (bits & SU_IDEALPITCH)
cl.idealpitch = MSG_ReadChar (net_message); cl.idealpitch = ((signed char) MSG_ReadByte (net_message));
else else
cl.idealpitch = 0; cl.idealpitch = 0;
VectorCopy (cl.mvelocity[0], cl.mvelocity[1]); VectorCopy (cl.mvelocity[0], cl.mvelocity[1]);
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (bits & (SU_PUNCH1 << i)) if (bits & (SU_PUNCH1 << i))
cl.punchangle[i] = MSG_ReadChar (net_message); cl.punchangle[i] = ((signed char) MSG_ReadByte (net_message));
else else
cl.punchangle[i] = 0; cl.punchangle[i] = 0;
if (bits & (SU_VELOCITY1 << i)) if (bits & (SU_VELOCITY1 << i))
cl.mvelocity[0][i] = MSG_ReadChar (net_message) * 16; cl.mvelocity[0][i] = ((signed char) MSG_ReadByte (net_message)) * 16;
else else
cl.mvelocity[0][i] = 0; cl.mvelocity[0][i] = 0;
} }

View file

@ -496,7 +496,7 @@ CL_ParseParticleEffect (void)
MSG_ReadCoordV (net_message, org); MSG_ReadCoordV (net_message, org);
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
dir[i] = MSG_ReadChar (net_message) * (15.0 / 16.0); dir[i] = ((signed char) MSG_ReadByte (net_message)) * (15.0 / 16.0);
count = MSG_ReadByte (net_message); count = MSG_ReadByte (net_message);
color = MSG_ReadByte (net_message); color = MSG_ReadByte (net_message);