From f5f36c88f4703aa40546143fc1ed47f7ac47b0e2 Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 8 Sep 2005 01:57:09 +0000 Subject: [PATCH] bracketed a few of the parameters to vector macros. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1289 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/mathlib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/common/mathlib.h b/engine/common/mathlib.h index ac6ec0e15..be5e46540 100644 --- a/engine/common/mathlib.h +++ b/engine/common/mathlib.h @@ -45,10 +45,10 @@ extern int nanmask; #define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask) #define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2]) -#define VectorSubtract(a,b,c) {c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];} -#define VectorAdd(a,b,c) {c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];} +#define VectorSubtract(a,b,c) {(c)[0]=(a)[0]-(b)[0];(c)[1]=(a)[1]-(b)[1];(c)[2]=(a)[2]-(b)[2];} +#define VectorAdd(a,b,c) {(c)[0]=(a)[0]+(b)[0];(c)[1]=(a)[1]+(b)[1];(c)[2]=(a)[2]+(b)[2];} #define VectorCopy(a,b) {(b)[0]=(a)[0];(b)[1]=(a)[1];(b)[2]=(a)[2];} -#define VectorClear(a) (a[0]=a[1]=a[2]=0) +#define VectorClear(a) ((a)[0]=(a)[1]=(a)[2]=0) #define VectorNegate(a,b) ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2]) #define VectorLength(a) Length(a)