mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-01 09:02:08 +00:00
[build] Fix a pile of gcc 10 issues
gcc got stricter about array accesses, complicating progs macros, and much better at detecting buffer overflows.
This commit is contained in:
parent
af814ff9a8
commit
ab04a1915e
30 changed files with 125 additions and 107 deletions
|
@ -142,7 +142,12 @@ extern const vec_t *const vec3_origin;
|
|||
} while (0)
|
||||
|
||||
#define VectorIsZero(a) (!(a)[0] && !(a)[1] && !(a)[2])
|
||||
#define VectorZero(a) ((a)[2] = (a)[1] = (a)[0] = 0);
|
||||
#define VectorZero(a) \
|
||||
do { \
|
||||
(a)[0] = 0; \
|
||||
(a)[1] = 0; \
|
||||
(a)[2] = 0; \
|
||||
} while (0)
|
||||
#define VectorSet(a,b,c,d) \
|
||||
do { \
|
||||
(d)[0] = a; \
|
||||
|
|
|
@ -474,8 +474,8 @@ typedef union pr_type_u {
|
|||
string_t string_var;
|
||||
func_t func_var;
|
||||
pr_int_t entity_var;
|
||||
float vector_var[0]; // really 3, but this structure must be 32 bits
|
||||
float quat_var[0]; // really 4, but this structure must be 32 bits
|
||||
float vector_var; // really [3], but this structure must be 32 bits
|
||||
float quat_var; // really [4], but this structure must be 32 bits
|
||||
pr_int_t integer_var;
|
||||
pointer_t pointer_var;
|
||||
pr_uint_t uinteger_var;
|
||||
|
|
|
@ -445,7 +445,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
|
||||
\hideinitializer
|
||||
*/
|
||||
#define G_VECTOR(p,o) G_var (p, o, vector)
|
||||
#define G_VECTOR(p,o) (&G_var (p, o, vector))
|
||||
|
||||
/** Access a quaternion global. Can be assigned to.
|
||||
|
||||
|
@ -457,7 +457,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
|
||||
\hideinitializer
|
||||
*/
|
||||
#define G_QUAT(p,o) G_var (p, o, quat)
|
||||
#define G_QUAT(p,o) (&G_var (p, o, quat))
|
||||
|
||||
/** Access a string index global. Can be assigned to.
|
||||
|
||||
|
@ -661,7 +661,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
|
||||
\hideinitializer
|
||||
*/
|
||||
#define P_VECTOR(p,n) P_var (p, n, vector)
|
||||
#define P_VECTOR(p,n) (&P_var (p, n, vector))
|
||||
|
||||
/** Access a quaterion parameter. Can be used any way a quat_t variable can.
|
||||
|
||||
|
@ -673,7 +673,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
|
||||
\hideinitializer
|
||||
*/
|
||||
#define P_QUAT(p,n) P_var (p, n, quat)
|
||||
#define P_QUAT(p,n) (&P_var (p, n, quat))
|
||||
|
||||
/** Access a string index parameter. Can be assigned to.
|
||||
|
||||
|
@ -873,7 +873,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
|
||||
\hideinitializer
|
||||
*/
|
||||
#define R_VECTOR(p) R_var (p, vector)
|
||||
#define R_VECTOR(p) (&R_var (p, vector))
|
||||
|
||||
/** Access the VM function return value as a \c ::quat_t quaternion.
|
||||
|
||||
|
@ -884,7 +884,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
|
||||
\hideinitializer
|
||||
*/
|
||||
#define R_QUAT(p) R_var (p, quat)
|
||||
#define R_QUAT(p) (&R_var (p, quat))
|
||||
|
||||
/** Access the VM function return value as a ::string_t (a VM string reference).
|
||||
|
||||
|
@ -1054,7 +1054,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_
|
|||
|
||||
\hideinitializer
|
||||
*/
|
||||
#define E_VECTOR(e,o) E_var (e, o, vector)
|
||||
#define E_VECTOR(e,o) (&E_var (e, o, vector))
|
||||
|
||||
/** Access a quaternion entity field. Can be used any way a quat_t variable
|
||||
can.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue