diff --git a/include/QF/wad.h b/include/QF/wad.h index 2e6bb9c67..1f91df0ef 100644 --- a/include/QF/wad.h +++ b/include/QF/wad.h @@ -42,7 +42,7 @@ extern lumpinfo_t *wad_lumps; extern byte *wad_base; void W_LoadWadFile (const char *filename); -void *W_GetLumpName (const char *name); +void *W_GetLumpName (const char *name) __attribute__((const)); void SwapPic (qpic_t *pic); diff --git a/include/client/view.h b/include/client/view.h index 2f713d631..2ba5265ef 100644 --- a/include/client/view.h +++ b/include/client/view.h @@ -107,7 +107,7 @@ void V_NewScene (viewstate_t *vs, struct scene_s *scene); void V_Init (viewstate_t *vs); void V_Init_Cvars (void); void V_RenderView (viewstate_t *vs); -float V_CalcRoll (const vec3_t angles, vec4f_t velocity); +float V_CalcRoll (const vec3_t angles, vec4f_t velocity) __attribute__((pure)); void V_StartPitchDrift (viewstate_t *vs); void V_StopPitchDrift (viewstate_t *vs); void V_SetContentsColor (viewstate_t *vs, int contents); diff --git a/libs/models/trace.c b/libs/models/trace.c index be77f6157..51eda7104 100644 --- a/libs/models/trace.c +++ b/libs/models/trace.c @@ -242,7 +242,7 @@ edges_intersect (const vec3_t p1, const vec3_t p2, return true; } -static bool +static bool __attribute__((pure)) trace_hits_portal (const hull_t *hull, const trace_t *trace, clipport_t *portal, const vec3_t start, const vec3_t vel) { @@ -274,7 +274,7 @@ trace_hits_portal (const hull_t *hull, const trace_t *trace, return true; } -static bool +static bool __attribute__((pure)) trace_enters_leaf (hull_t *hull, trace_t *trace, clipleaf_t *leaf, plane_t *plane, const vec3_t vel, const vec3_t org) { diff --git a/libs/video/renderer/gl/vid_common_gl.c b/libs/video/renderer/gl/vid_common_gl.c index 83e6431b5..7b6e0be36 100644 --- a/libs/video/renderer/gl/vid_common_gl.c +++ b/libs/video/renderer/gl/vid_common_gl.c @@ -76,7 +76,7 @@ int gl_release_number; static int gl_bgra_capable; int gl_use_bgra; -int gl_va_capable; +bool gl_va_capable; static int driver_vaelements; int vaelements; int gl_filter_min = GL_LINEAR_MIPMAP_LINEAR; diff --git a/libs/video/renderer/sw/draw.c b/libs/video/renderer/sw/draw.c index ef63a04f6..73e8178aa 100644 --- a/libs/video/renderer/sw/draw.c +++ b/libs/video/renderer/sw/draw.c @@ -119,7 +119,7 @@ Draw_DestroyPic (qpic_t *pic) free (pic); } -qpic_t * +qpic_t * __attribute__((const)) Draw_PicFromWad (const char *name) { return W_GetLumpName (name); diff --git a/tools/qfcc/source/stub.c b/tools/qfcc/source/stub.c index 7dd5dcbff..17d1400dc 100644 --- a/tools/qfcc/source/stub.c +++ b/tools/qfcc/source/stub.c @@ -44,10 +44,10 @@ __attribute__((const)) int algebra_type_width (const struct type_s *type); int algebra_type_width (const struct type_s *type){return 0;} __attribute__((const)) int algebra_type_assignable (const type_t *dst, const type_t *src); int algebra_type_assignable (const type_t *dst, const type_t *src){return 0;} -__attribute__((const)) int is_algebra (const type_t *type); -int is_algebra (const type_t *type){return 0;} -__attribute__((const)) int algebra_base_type (const type_t *type); -int algebra_base_type (const type_t *type){return 0;} +__attribute__((const)) bool is_algebra (const type_t *type); +bool is_algebra (const type_t *type){return 0;} +__attribute__((const)) type_t *algebra_base_type (const type_t *type); +type_t *algebra_base_type (const type_t *type){return 0;} __attribute__((const)) pr_string_t ReuseString (const char *str) {return 0;} __attribute__((const)) codespace_t *codespace_new (void) {return 0;}