From 3d71dc6b3c36b9ae98ecdcb30edd8c8a7515e553 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 18 Feb 2010 06:23:28 +0000 Subject: [PATCH] move RESTRICT keyword define to qtypes.h and add it to all the AnimateVertices functions to hush a warning in MSVC git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9983 d7cf8633-e32d-0410-b094-e92efae38249 --- model_alias.c | 10 ++-------- model_shared.h | 2 +- qtypes.h | 6 ++++++ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/model_alias.c b/model_alias.c index 9fd4d1cc..d3082288 100644 --- a/model_alias.c +++ b/model_alias.c @@ -109,12 +109,6 @@ void Mod_Skeletal_FreeBuffers(void) bonepose = NULL; } -#if defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1400) -#define RESTRICT __restrict -#else -#define RESTRICT -#endif - void Mod_Skeletal_AnimateVertices(const dp_model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) { // vertex weighted skeletal @@ -314,7 +308,7 @@ void Mod_Skeletal_AnimateVertices(const dp_model_t * RESTRICT model, const frame } } -void Mod_MD3_AnimateVertices(const dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, float *vertex3f, float *normal3f, float *svector3f, float *tvector3f) +void Mod_MD3_AnimateVertices(const dp_model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) { // vertex morph int i, numblends, blendnum; @@ -403,7 +397,7 @@ void Mod_MD3_AnimateVertices(const dp_model_t *model, const frameblend_t *frameb } } -void Mod_MDL_AnimateVertices(const dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, float *vertex3f, float *normal3f, float *svector3f, float *tvector3f) +void Mod_MDL_AnimateVertices(const dp_model_t * RESTRICT model, const frameblend_t * RESTRICT frameblend, const skeleton_t *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f) { // vertex morph int i, numblends, blendnum; diff --git a/model_shared.h b/model_shared.h index e1bad622..bcb34f1b 100644 --- a/model_shared.h +++ b/model_shared.h @@ -912,7 +912,7 @@ typedef struct model_s // data type of model const char *modeldatatypestring; // generates vertex data for a given frameblend - void(*AnimateVertices)(const struct model_s *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, float *vertex3f, float *normal3f, float *svector3f, float *tvector3f); + void(*AnimateVertices)(const struct model_s * RESTRICT model, const struct frameblend_s * RESTRICT frameblend, const struct skeleton_s *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f); // draw the model's sky polygons (only used by brush models) void(*DrawSky)(struct entity_render_s *ent); // draw refraction/reflection textures for the model's water polygons (only used by brush models) diff --git a/qtypes.h b/qtypes.h index 3a481cae..250beaee 100644 --- a/qtypes.h +++ b/qtypes.h @@ -29,4 +29,10 @@ typedef bool qboolean; // fall over #define ROLL 2 +#if defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1400) +#define RESTRICT __restrict +#else +#define RESTRICT +#endif + #endif -- 2.39.2