From f5466fc44cd6848ae815d5e36c6206be0eee273c Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 5 Mar 2015 12:27:16 +0000 Subject: [PATCH] Fix warnings. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12202 d7cf8633-e32d-0410-b094-e92efae38249 --- collision.c | 8 ++++---- collision.h | 2 +- csprogs.c | 2 +- model_brush.h | 11 +++++++++-- netconn.c | 6 +++--- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/collision.c b/collision.c index f440042c..3d148a8b 100644 --- a/collision.c +++ b/collision.c @@ -1374,7 +1374,7 @@ static void Collision_TransformBrush(const matrix4x4_t *matrix, colbrushf_t *bru // now we can transform the data for(i = 0; i < brush->numplanes; ++i) { - Matrix4x4_TransformPositivePlane(matrix, brush->planes[i].normal[0], brush->planes[i].normal[1], brush->planes[i].normal[2], brush->planes[i].dist, brush->planes[i].normal); + Matrix4x4_TransformPositivePlane(matrix, brush->planes[i].normal[0], brush->planes[i].normal[1], brush->planes[i].normal[2], brush->planes[i].dist, brush->planes[i].normal_and_dist); } for(i = 0; i < brush->numedgedirs; ++i) { @@ -1778,7 +1778,7 @@ void Collision_ClipToGenericEntity(trace_t *trace, dp_model_t *model, const fram // transform plane // NOTE: this relies on plane.dist being directly after plane.normal - Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal); + Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal_and_dist); } void Collision_ClipToWorld(trace_t *trace, dp_model_t *model, const vec3_t tstart, const vec3_t mins, const vec3_t maxs, const vec3_t tend, int hitsupercontents, float extend) @@ -1814,7 +1814,7 @@ void Collision_ClipLineToGenericEntity(trace_t *trace, dp_model_t *model, const // transform plane // NOTE: this relies on plane.dist being directly after plane.normal - Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal); + Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal_and_dist); } void Collision_ClipLineToWorld(trace_t *trace, dp_model_t *model, const vec3_t tstart, const vec3_t tend, int hitsupercontents, float extend, qboolean hitsurfaces) @@ -1849,7 +1849,7 @@ void Collision_ClipPointToGenericEntity(trace_t *trace, dp_model_t *model, const VectorCopy(start, trace->endpos); // transform plane // NOTE: this relies on plane.dist being directly after plane.normal - Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal); + Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal_and_dist); } void Collision_ClipPointToWorld(trace_t *trace, dp_model_t *model, const vec3_t start, int hitsupercontents) diff --git a/collision.h b/collision.h index 70fbd485..e0770827 100644 --- a/collision.h +++ b/collision.h @@ -9,7 +9,7 @@ typedef union plane_s vec3_t normal; vec_t dist; }; - vec4_t dist_and_normal; + vec4_t normal_and_dist; } plane_t; diff --git a/csprogs.c b/csprogs.c index 64e21e68..b1598dda 100644 --- a/csprogs.c +++ b/csprogs.c @@ -1242,7 +1242,7 @@ qboolean CL_VM_TransformView(int entnum, matrix4x4_t *viewmatrix, mplane_t *clip Matrix4x4_Invert_Full(&mat, viewmatrix); Matrix4x4_FromVectors(viewmatrix, forward, left, up, origin); Matrix4x4_Concat(&matq, viewmatrix, &mat); - Matrix4x4_TransformPositivePlane(&matq, clipplane->normal[0], clipplane->normal[1], clipplane->normal[2], clipplane->dist, &clipplane->normal[0]); + Matrix4x4_TransformPositivePlane(&matq, clipplane->normal[0], clipplane->normal[1], clipplane->normal[2], clipplane->dist, clipplane->normal_and_dist); } } CSQC_END diff --git a/model_brush.h b/model_brush.h index d103f454..0c070489 100644 --- a/model_brush.h +++ b/model_brush.h @@ -48,8 +48,15 @@ mvertex_t; // plane_t structure typedef struct mplane_s { - vec3_t normal; - float dist; + union + { + struct + { + vec3_t normal; + vec_t dist; + }; + vec4_t normal_and_dist; + }; // for texture axis selection and fast side tests int type; // set by PlaneClassify() int signbits; // set by PlaneClassify() diff --git a/netconn.c b/netconn.c index 9db3a473..9b53ed3f 100755 --- a/netconn.c +++ b/netconn.c @@ -1213,7 +1213,7 @@ static int NetConn_ReceivedMessage(netconn_t *conn, const unsigned char *data, s if (protocol == PROTOCOL_QUAKEWORLD) { unsigned int sequence, sequence_ack; - int reliable_ack, reliable_message; + qboolean reliable_ack, reliable_message; int count; //int qport; @@ -1234,8 +1234,8 @@ static int NetConn_ReceivedMessage(netconn_t *conn, const unsigned char *data, s } conn->packetsReceived++; - reliable_message = (sequence >> 31) & 1; - reliable_ack = (sequence_ack >> 31) & 1; + reliable_message = (sequence >> 31) != 0; + reliable_ack = (sequence_ack >> 31) != 0; sequence &= ~(1<<31); sequence_ack &= ~(1<<31); if (sequence <= conn->qw.incoming_sequence) -- 2.39.2