Fix warnings.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 5 Mar 2015 12:27:16 +0000 (12:27 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 5 Mar 2015 12:27:16 +0000 (12:27 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12202 d7cf8633-e32d-0410-b094-e92efae38249

collision.c
collision.h
csprogs.c
model_brush.h
netconn.c

index f440042..3d148a8 100644 (file)
@@ -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)
index 70fbd48..e077082 100644 (file)
@@ -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;
 
index 64e21e6..b1598dd 100644 (file)
--- 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
index d103f45..0c07048 100644 (file)
@@ -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()
index 9db3a47..9b53ed3 100755 (executable)
--- 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)