Fix a bunch of issues found by gcc-11

This commit is contained in:
Bill Currie 2021-06-13 14:30:59 +09:00
parent 24fd443ef3
commit 93167279fc
5 changed files with 8 additions and 6 deletions

View file

@ -116,7 +116,7 @@ void Mat3SymEigen (const mat3_t m, vec3_t e);
VectorShear (shear, v, v);
VectorCompMult (scale, v, v);
*/
int Mat3Decompose (const mat4_t mat, quat_t rot, vec3_t shear, vec3_t scale);
int Mat3Decompose (const mat3_t mat, quat_t rot, vec3_t shear, vec3_t scale);
///@}

View file

@ -352,7 +352,7 @@ GNU89INLINE inline
VISIBLE
#endif
vec4f_t
loadvec3f (const float v3[3])
loadvec3f (const float *v3)
{
vec4f_t v4;
@ -381,7 +381,7 @@ GNU89INLINE inline
VISIBLE
#endif
void
storevec3f (float v3[3], vec4f_t v4)
storevec3f (float *v3, vec4f_t v4)
{
v3[0] = v4[0];
v3[1] = v4[1];

View file

@ -112,7 +112,7 @@ void NET_SendPacket (int length, const void *data, netadr_t to);
\param b The second address to compare.
\return True of the addresses match, otherwise false.
*/
qboolean NET_CompareAdr (netadr_t a, netadr_t b) __attribute__((pure));
qboolean NET_CompareAdr (netadr_t a, netadr_t b) __attribute__((const));
/** Compare two network addresses.
@ -122,7 +122,7 @@ qboolean NET_CompareAdr (netadr_t a, netadr_t b) __attribute__((pure));
\param b The second address to compare.
\return True of the addresses match, otherwise false.
*/
qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b) __attribute__((pure));
qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b) __attribute__((const));
/** Convert an address to a string.

View file

@ -171,6 +171,8 @@ ClipWinding (winding_t *in, plane_t *split, qboolean keepon)
// +1 for duplicating the first point
sides = alloca ((in->numpoints + 1) * sizeof (int));
dists = alloca ((in->numpoints + 1) * sizeof (vec_t));
sides[0] = 0;
dists[0] = 0;
// determine sides for each point
for (i = 0; i < in->numpoints; i++) {

View file

@ -124,7 +124,7 @@ WriteNodePlanes (node_t *nodes)
static int
WriteClipNodes_r (node_t *node)
{
dclipnode_t cn;
dclipnode_t cn = { };
int num, c, i;
// FIXME: free more stuff?