Do a pure/const/noreturn/format attribute pass.

I always wanted these, but as gcc now provides warnings for functions that
could do with such attributes, finding all the functions is much easier.
This commit is contained in:
Bill Currie 2018-10-09 12:35:01 +09:00
parent 05fd2d8cdd
commit 34bcf7faab
118 changed files with 332 additions and 314 deletions

View file

@ -213,6 +213,10 @@ if test $CC_MAJ -gt 4 -o $CC_MAJ -eq 4 -a $CC_MIN -ge 5; then
fi
QF_CC_OPTION(-Wtype-limits)
QF_CC_OPTION_TEST([-fvisibility=hidden], [VISIBILITY=-fvisibility=hidden])
QF_CC_OPTION(-Wsuggest-attribute=pure)
QF_CC_OPTION(-Wsuggest-attribute=const)
QF_CC_OPTION(-Wsuggest-attribute=noreturn)
QF_CC_OPTION(-Wsuggest-attribute=format)
dnl QuakeForge uses lots of BCPL-style (//) comments, which can cause problems
dnl with many compilers that do not support the latest ISO standards. Well,

View file

@ -121,7 +121,7 @@ FL_Add (filter_t * filter)
filter_list = filter;
}
static filter_t *
static __attribute__((pure)) filter_t *
FL_Find (netadr_t adr)
{
filter_t *filter;
@ -209,7 +209,7 @@ SVL_Add (server_t *sv)
sv_list = sv;
}
static server_t *
static __attribute__((pure)) server_t *
SVL_Find (netadr_t adr)
{
server_t *sv;

View file

@ -37,7 +37,7 @@ void glsl_lightmap_init (void);
void glsl_R_BuildLightmaps (struct model_s **models, int num_models);
void glsl_R_CalcLightmaps (void);
extern void (*glsl_R_BuildLightMap) (msurface_t *surf);
int glsl_R_LightmapTexture (void);
int glsl_R_LightmapTexture (void) __attribute__((pure));
void glsl_R_FlushLightmaps (void);
#endif//__QF_GLSL_lightmap_h

View file

@ -55,7 +55,7 @@ void GLSL_TextureInit (void);
scrap_t *GLSL_CreateScrap (int size, int format, int linear);
void GLSL_DestroyScrap (scrap_t *scrap);
void GLSL_ScrapClear (scrap_t *scrap);
int GLSL_ScrapTexture (scrap_t *scrap);
int GLSL_ScrapTexture (scrap_t *scrap) __attribute__((pure));
subpic_t *GLSL_ScrapSubpic (scrap_t *scrap, int width, int height); //XXX slow!
void GLSL_SubpicDelete (subpic_t *subpic); //XXX slow!
void GLSL_SubpicUpdate (subpic_t *subpic, byte *data, int batch);

View file

@ -60,14 +60,14 @@ int Cmd_AddCommand (const char *cmd_name, xcommand_t function, const char *desc
int Cmd_RemoveCommand (const char *cmd_name);
qboolean Cmd_Exists (const char *cmd_name);
const char *Cmd_CompleteCommand (const char *partial);
int Cmd_CompleteCountPossible (const char *partial);
const char *Cmd_CompleteCommand (const char *partial) __attribute__((pure));
int Cmd_CompleteCountPossible (const char *partial) __attribute__((pure));
const char **Cmd_CompleteBuildList (const char *partial);
int Cmd_Argc (void);
const char *Cmd_Argv (int arg);
const char *Cmd_Args (int start);
int Cmd_Argc (void) __attribute__((pure));
const char *Cmd_Argv (int arg) __attribute__((pure));
const char *Cmd_Args (int start) __attribute__((pure));
struct cbuf_args_s;
int Cmd_Command (struct cbuf_args_s *args);
int Cmd_ExecuteString (const char *text, cmd_source_t src);

View file

@ -92,8 +92,8 @@ extern struct console_data_s con_data;
void Con_CheckResize (void);
void Con_DrawConsole (void);
void Con_Printf (const char *fmt, ...);
void Con_Print (const char *fmt, va_list args);
void Con_Printf (const char *fmt, ...) __attribute__((format(printf, 1, 2)));
void Con_Print (const char *fmt, va_list args) __attribute__((format(printf, 1, 0)));
void Con_ToggleConsole_f (void);
// wrapper function to attempt to either complete the command line
@ -105,7 +105,7 @@ void Con_BasicCompleteCommandLine (inputline_t *il);
// Generic libs/util/console.c function to display a list
// formatted in columns on the console
void Con_DisplayList(const char **list, int con_linewidth);
extern void (*con_list_print)(const char *fmt, ...);
extern void (*con_list_print)(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
inputline_t *Con_CreateInputLine (int lines, int lsize, char prompt);
void Con_DestroyInputLine (inputline_t *inputline);

View file

@ -38,8 +38,8 @@
void CRC_Init(unsigned short *crcvalue);
void CRC_ProcessByte(unsigned short *crcvalue, byte data);
void CRC_ProcessBlock (const byte *start, unsigned short *crcvalue, int count);
unsigned short CRC_Value(unsigned short crcvalue);
unsigned short CRC_Block (const byte *start, int count);
unsigned short CRC_Value(unsigned short crcvalue) __attribute__((const));
unsigned short CRC_Block (const byte *start, int count) __attribute__((pure));
//@}

View file

@ -122,12 +122,12 @@ void Cvar_WriteVariables (QFile *f);
// attempts to match a partial variable name for command line completion
// returns NULL if nothing fits
const char *Cvar_CompleteVariable (const char *partial);
const char *Cvar_CompleteVariable (const char *partial) __attribute__((pure));
// Added by EvilTypeGuy - functions for tab completion system
// Thanks to Fett erich@heintz.com
// Thanks to taniwha
int Cvar_CompleteCountPossible (const char *partial);
int Cvar_CompleteCountPossible (const char *partial) __attribute__((pure));
const char **Cvar_CompleteBuildList (const char *partial);
// Returns a pointer to the Cvar, NULL if not found

View file

@ -164,14 +164,14 @@ void dstring_clearstr (dstring_t *dstr);
/** Formatted printing to dstrings. Existing data is replaced by the formatted
string.
*/
int dvsprintf (dstring_t *dstr, const char *fmt, va_list args);
int dvsprintf (dstring_t *dstr, const char *fmt, va_list args) __attribute__((format(printf,2,0)));
int dsprintf (dstring_t *dstr, const char *fmt, ...) __attribute__((format(printf,2,3)));
//@}
//@{
/** Formatted printing to dstrings. Formatted string is appened to the dstring.
Embedded nulls in the dstring are ignored.
*/
int davsprintf (dstring_t *dstr, const char *fmt, va_list args);
int davsprintf (dstring_t *dstr, const char *fmt, va_list args) __attribute__((format(printf,2,0)));
int dasprintf (dstring_t *dstr, const char *fmt, ...) __attribute__((format(printf,2,3)));
//@}

View file

@ -182,7 +182,7 @@ extern char * const gib_null_string;
#define GIB_CanReturn() (GIB_DATA(cbuf_active)->waitret)
dstring_t *GIB_Return (const char *str);
void GIB_Error (const char *type, const char *fmt, ...);
void GIB_Error (const char *type, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
void GIB_Builtin_Add (const char *name, void (*func) (void));
void GIB_Builtin_Remove (const char *name);
qboolean GIB_Builtin_Exists (const char *name);
@ -199,12 +199,12 @@ void GIB_Event_Callback (gib_event_t *event, unsigned int argc, ...);
// Interpreter interface (for creating GIB cbufs)
cbuf_interpreter_t *GIB_Interpreter (void);
cbuf_interpreter_t *GIB_Interpreter (void) __attribute__((const));
// Thread interface
void GIB_Thread_Execute (void);
unsigned int GIB_Thread_Count (void);
unsigned int GIB_Thread_Count (void) __attribute__((pure));
// Init interface
@ -214,6 +214,6 @@ void GIB_Init (qboolean sandbox);
unsigned long int GIB_Handle_New (gib_object_t *data);
void GIB_Handle_Free (unsigned long int num);
gib_object_t *GIB_Handle_Get (unsigned long int num);
gib_object_t *GIB_Handle_Get (unsigned long int num) __attribute__((pure));
#endif

View file

@ -177,20 +177,20 @@ void Hash_Free (hashtab_t *tab, void *ele);
this is the same function as used internally.
*/
unsigned long Hash_String (const char *str);
unsigned long Hash_String (const char *str) __attribute__((pure));
/** hash a buffer.
\param buf the buffer to hash
\param len the size of the buffer
\return the hash value of the string.
*/
unsigned long Hash_Buffer (const void *buf, int len);
unsigned long Hash_Buffer (const void *buf, int len) __attribute__((pure));
/** get the size of the table
\param tab the table in question
\return the number of elements in the table.
*/
size_t Hash_NumElements (hashtab_t *tab);
size_t Hash_NumElements (hashtab_t *tab) __attribute__((pure));
/** list of all elements in the table.
\param tab the table to list

View file

@ -47,10 +47,10 @@ typedef struct info_key_s {
const char *value;
} info_key_t;
qboolean Info_FilterForKey (const char *key, const char **filter_list);
qboolean Info_FilterForKey (const char *key, const char **filter_list) __attribute__((pure));
void Info_Print (info_t *info);
int Info_CurrentSize (info_t *info);
int Info_CurrentSize (info_t *info) __attribute__((pure));
info_key_t *Info_Key (info_t *info, const char *key);
info_key_t **Info_KeyList (info_t *info);
void Info_RemoveKey (info_t *info, const char *key);

View file

@ -144,11 +144,11 @@ void JOY_Close (void);
void JOY_Read (void);
const char *JOY_GetOption_c (int i);
int JOY_GetOption_i (const char *c);
const char *JOY_GetOption_c (int i) __attribute__((pure));
int JOY_GetOption_i (const char *c) __attribute__((pure));
const char *JOY_GetDest_c (int i);
int JOY_GetDest_i (const char *c);
const char *JOY_GetDest_c (int i) __attribute__((pure));
int JOY_GetDest_i (const char *c) __attribute__((pure));
int JOY_GetAxis_i (int dest, const char *c);

View file

@ -544,7 +544,7 @@ void Key_Init_Cvars (void);
\param imt_name The name of the imt to find. Case insensitive.
\return The named imt, or null if not found.
*/
imt_t *Key_FindIMT (const char *imt_name);
imt_t *Key_FindIMT (const char *imt_name) __attribute__((pure));
/** Create a new imt and attach it to the specified keydest target.
@ -599,7 +599,7 @@ void Key_ClearStates (void);
\param key The key for which to get the binding.
\return The command string bound to the key, or null if unbound.
*/
const char *Key_GetBinding (imt_t *imt, knum_t key);
const char *Key_GetBinding (imt_t *imt, knum_t key) __attribute__((pure));
/** Bind a command string to a key in the specified input mapping table.
@ -639,7 +639,7 @@ void Key_KeydestCallback (keydest_callback_t *callback);
\param keynum The key for which to get the string.
\return The string representation of the key.
*/
const char *Key_KeynumToString (knum_t keynum);
const char *Key_KeynumToString (knum_t keynum) __attribute__((pure));
/** Get the keynum for the named key.
@ -650,7 +650,7 @@ const char *Key_KeynumToString (knum_t keynum);
\param str The name of the key.
\return The named key if valid, otherwise -1
*/
int Key_StringToKeynum (const char *str);
int Key_StringToKeynum (const char *str) __attribute__((pure));
struct progs_s;

View file

@ -53,11 +53,11 @@ void llist_flush (llist_t *list);
void llist_delete (llist_t *list);
llist_node_t *llist_append (llist_t *list, void *element);
llist_node_t *llist_prefix (llist_t *list, void *element);
llist_node_t *llist_getnode (llist_t *list, void *element);
llist_node_t *llist_getnode (llist_t *list, void *element) __attribute__((pure));
llist_node_t *llist_insertafter (llist_node_t *ref, void *element);
llist_node_t *llist_insertbefore (llist_node_t *ref, void *element);
void *llist_remove (llist_node_t *ref);
unsigned int llist_size (llist_t *llist);
unsigned int llist_size (llist_t *llist) __attribute__((pure));
void llist_iterate (llist_t *list, llist_iterator_t iterate);
void *llist_find (llist_t *list, void *comparison);
llist_node_t *llist_findnode (llist_t *list, void *comparison);

View file

@ -36,13 +36,13 @@ typedef struct
char *name;
} location_t;
location_t *locs_find(const vec3_t target);
location_t *locs_find(const vec3_t target) __attribute__((pure));
void locs_add (const vec3_t location, const char *name);
void locs_del (const vec3_t loc);
void locs_edit (const vec3_t loc, const char *desc);
void locs_load(const char *filename);
void locs_mark (const vec3_t loc, const char *desc);
int locs_nearest (const vec3_t loc);
int locs_nearest (const vec3_t loc) __attribute__((pure));
void locs_reset (void);
void locs_save (const char *filename, qboolean gz);
void map_to_loc (const char *mapname, char *filename);

View file

@ -39,8 +39,8 @@
#include "QF/qtypes.h"
int16_t FloatToHalf (float x);
float HalfToFloat (int16_t x);
int16_t FloatToHalf (float x) __attribute__((const));
float HalfToFloat (int16_t x) __attribute__((const));
//@}

View file

@ -101,7 +101,7 @@
void Mat3Init (const quat_t rot, const vec3_t scale, mat3_t mat);
void Mat3Transpose (const mat3_t a, mat3_t b);
vec_t Mat3Determinant (const mat3_t m);
vec_t Mat3Determinant (const mat3_t m) __attribute__((pure));
int Mat3Inverse (const mat3_t a, mat3_t b);
void Mat3Mult (const mat3_t a, const mat3_t b, mat3_t c);
void Mat3MultVec (const mat3_t a, const vec3_t b, vec3_t c);

View file

@ -171,11 +171,11 @@ extern const vec_t *const vec3_origin;
(((a)[2] - (b)[2]) * ((a)[2] - (b)[2])))
#define VectorDistance(a, b) sqrt(VectorDistance_fast(a, b))
vec_t _DotProduct (const vec3_t v1, const vec3_t v2);
vec_t _DotProduct (const vec3_t v1, const vec3_t v2) __attribute__((pure));
void _VectorAdd (const vec3_t veca, const vec3_t vecb, vec3_t out);
void _VectorCopy (const vec3_t in, vec3_t out);
int _VectorCompare (const vec3_t v1, const vec3_t v2); // uses EQUAL_EPSILON
vec_t _VectorLength (const vec3_t v);
int _VectorCompare (const vec3_t v1, const vec3_t v2) __attribute__((pure)); // uses EQUAL_EPSILON
vec_t _VectorLength (const vec3_t v) __attribute__((pure));
void _VectorMA (const vec3_t veca, float scale, const vec3_t vecb,
vec3_t vecc);
void _VectorScale (const vec3_t in, vec_t scale, vec3_t out);

View file

@ -73,15 +73,15 @@ extern int nanmask;
// fall over
#define ROLL 2
int Q_log2(int val);
int Q_log2(int val) __attribute__((const));
void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]);
void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]);
void FloorDivMod (double numer, double denom, int *quotient, int *rem);
fixed16_t Invert24To16(fixed16_t val);
fixed16_t Invert24To16(fixed16_t val) __attribute__((const));
fixed16_t Mul16_30(fixed16_t multiplier, fixed16_t multiplicand);
int GreatestCommonDivisor (int i1, int i2);
int GreatestCommonDivisor (int i1, int i2) __attribute__((const));
/** Convert quake angles to basis vectors.
@ -139,8 +139,8 @@ void AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right,
void AngleQuat (const vec3_t angles, quat_t q);
void VectorVectors (const vec3_t forward, vec3_t right, vec3_t up);
int BoxOnPlaneSide (const vec3_t emins, const vec3_t emaxs,
struct plane_s *plane);
float anglemod (float a);
struct plane_s *plane) __attribute__((pure));
float anglemod (float a) __attribute__((const));
void RotatePointAroundVector (vec3_t dst, const vec3_t axis,
const vec3_t point, float degrees);
@ -174,7 +174,7 @@ void RotatePointAroundVector (vec3_t dst, const vec3_t axis,
} while (0)
extern plane_t * const frustum;
GNU89INLINE inline qboolean R_CullBox (const vec3_t mins, const vec3_t maxs);
GNU89INLINE inline qboolean R_CullBox (const vec3_t mins, const vec3_t maxs) __attribute__((pure));
GNU89INLINE inline qboolean R_CullSphere (const vec3_t origin, const float radius);
#ifndef IMPLEMENT_R_Cull

View file

@ -433,7 +433,7 @@ typedef struct model_s {
// ============================================================================
extern float RadiusFromBounds (const vec3_t mins, const vec3_t maxs);
extern float RadiusFromBounds (const vec3_t mins, const vec3_t maxs) __attribute__((pure));
void Mod_Init (void);
void Mod_Init_Cvars (void);
void Mod_ClearAll (void);
@ -441,7 +441,7 @@ model_t *Mod_ForName (const char *name, qboolean crash);
void *Mod_Extradata (model_t *mod); // handles caching
void Mod_TouchModel (const char *name);
mleaf_t *Mod_PointInLeaf (const vec3_t p, model_t *model);
mleaf_t *Mod_PointInLeaf (const vec3_t p, model_t *model) __attribute__((pure));
byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model);
model_t *Mod_FindName (const char *name);
int Mod_CalcFullbright (byte *in, byte *out, int pixels);

View file

@ -73,7 +73,7 @@ void MSG_BeginReading (qmsg_t *msg);
\param msg The message to check.
\return The number of bytes that have been read.
*/
int MSG_GetReadCount(qmsg_t *msg);
int MSG_GetReadCount(qmsg_t *msg) __attribute__((pure));
/** Read a single byte from the message.

View file

@ -38,7 +38,7 @@
#include <QF/qtypes.h>
#ifdef STATIC_PLUGINS
#define PLUGIN_INFO(type,name) plugin_t *type##_##name##_PluginInfo (void); plugin_t * type##_##name##_PluginInfo (void)
#define PLUGIN_INFO(type,name) plugin_t *type##_##name##_PluginInfo (void); __attribute__((const)) plugin_t * type##_##name##_PluginInfo (void)
#else
#define PLUGIN_INFO(type,name) plugin_t *PluginInfo (void); __attribute__((visibility ("default"))) plugin_t *PluginInfo (void)
#endif

View file

@ -34,7 +34,7 @@
#include <QF/plugin.h>
#include <QF/qtypes.h>
typedef void (*P_C_Print) (const char *fmt, va_list args);
typedef void (*P_C_Print) (const char *fmt, va_list args) __attribute__((format(printf, 1, 0)));
typedef void (*P_C_ProcessInput) (void);
typedef void (*P_C_KeyEvent) (knum_t key, short unicode, qboolean down);
typedef void (*P_C_DrawConsole) (void);

View file

@ -228,10 +228,10 @@ struct edict_s {
void ED_ClearEdict (progs_t *pr, edict_t *e, int val);
edict_t *ED_Alloc (progs_t *pr);
void ED_Free (progs_t *pr, edict_t *ed);
edict_t *ED_EdictNum(progs_t *pr, pr_int_t n);
pr_int_t ED_NumForEdict(progs_t *pr, edict_t *e);
edict_t *ED_EdictNum(progs_t *pr, pr_int_t n) __attribute__((pure));
pr_int_t ED_NumForEdict(progs_t *pr, edict_t *e) __attribute__((pure));
void ED_Count (progs_t *pr);
qboolean PR_EdictValid (progs_t *pr, pr_int_t e);
qboolean PR_EdictValid (progs_t *pr, pr_int_t e) __attribute__((pure));
// pr_debug.c
void ED_Print (progs_t *pr, edict_t *ed);
@ -274,8 +274,8 @@ void ED_EntityParseFunction (progs_t *pr);
*/
//@{
ddef_t *PR_FieldAtOfs (progs_t *pr, pr_int_t ofs);
ddef_t *PR_GlobalAtOfs (progs_t *pr, pr_int_t ofs);
ddef_t *PR_FieldAtOfs (progs_t *pr, pr_int_t ofs) __attribute__((pure));
ddef_t *PR_GlobalAtOfs (progs_t *pr, pr_int_t ofs) __attribute__((pure));
ddef_t *PR_FindField (progs_t *pr, const char *name);
ddef_t *PR_FindGlobal (progs_t *pr, const char *name);
@ -1112,21 +1112,21 @@ int PR_LoadStrings (progs_t *pr);
\param num string index to be validated
\return true if the index is valid, false otherwise
*/
qboolean PR_StringValid (progs_t *pr, string_t num);
qboolean PR_StringValid (progs_t *pr, string_t num) __attribute__((pure));
/** Convert a string index to a C string.
\param pr pointer to ::progs_t VM struct
\param num string index to be converted
\return C pointer to the string.
*/
const char *PR_GetString(progs_t *pr, string_t num);
const char *PR_GetString(progs_t *pr, string_t num) __attribute__((pure));
/** Retrieve the dstring_t associated with a mutable string.
\param pr pointer to ::progs_t VM struct
\param num string index of the mutable string
\return the dstring implementing the mutable string
*/
struct dstring_s *PR_GetMutableString(progs_t *pr, string_t num);
struct dstring_s *PR_GetMutableString(progs_t *pr, string_t num) __attribute__((pure));
/** Make a permanent progs string from the given C string. Will not create a
duplicate permanent string (temporary and mutable strings are not checked).
@ -1450,14 +1450,14 @@ void PR_Debug_Init_Cvars (void);
int PR_LoadDebug (progs_t *pr);
void PR_Debug_Watch (progs_t *pr, const char *expr);
void PR_Debug_Print (progs_t *pr, const char *expr);
pr_auxfunction_t *PR_Get_Lineno_Func (progs_t *pr, pr_lineno_t *lineno);
pr_uint_t PR_Get_Lineno_Addr (progs_t *pr, pr_lineno_t *lineno);
pr_uint_t PR_Get_Lineno_Line (progs_t *pr, pr_lineno_t *lineno);
pr_lineno_t *PR_Find_Lineno (progs_t *pr, pr_uint_t addr);
const char *PR_Get_Source_File (progs_t *pr, pr_lineno_t *lineno);
pr_auxfunction_t *PR_Get_Lineno_Func (progs_t *pr, pr_lineno_t *lineno) __attribute__((pure));
pr_uint_t PR_Get_Lineno_Addr (progs_t *pr, pr_lineno_t *lineno) __attribute__((pure));
pr_uint_t PR_Get_Lineno_Line (progs_t *pr, pr_lineno_t *lineno) __attribute__((pure));
pr_lineno_t *PR_Find_Lineno (progs_t *pr, pr_uint_t addr) __attribute__((pure));
const char *PR_Get_Source_File (progs_t *pr, pr_lineno_t *lineno) __attribute__((pure));
const char *PR_Get_Source_Line (progs_t *pr, pr_uint_t addr);
ddef_t *PR_Get_Param_Def (progs_t *pr, dfunction_t *func, unsigned parm);
ddef_t *PR_Get_Local_Def (progs_t *pr, pr_int_t offs);
ddef_t *PR_Get_Param_Def (progs_t *pr, dfunction_t *func, unsigned parm) __attribute__((pure));
ddef_t *PR_Get_Local_Def (progs_t *pr, pr_int_t offs) __attribute__((pure));
void PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents);
void PR_DumpState (progs_t *pr);
void PR_StackTrace (progs_t *pr);

View file

@ -42,7 +42,7 @@ extern const char *com_cmdline;
extern struct cvar_s *fs_globalcfg;
extern struct cvar_s *fs_usercfg;
int COM_CheckParm (const char *parm);
int COM_CheckParm (const char *parm) __attribute__((pure));
void COM_AddParm (const char *parm);
void COM_Init (void);

View file

@ -75,12 +75,12 @@
extern qboolean bigendien;
uint16_t _ShortSwap (uint16_t l);
uint16_t _ShortNoSwap (uint16_t l);
uint32_t _LongSwap (uint32_t l);
uint32_t _LongNoSwap (uint32_t l);
float _FloatSwap (float f);
float _FloatNoSwap (float f);
uint16_t _ShortSwap (uint16_t l) __attribute__((const));
uint16_t _ShortNoSwap (uint16_t l) __attribute__((const));
uint32_t _LongSwap (uint32_t l) __attribute__((const));
uint32_t _LongNoSwap (uint32_t l) __attribute__((const));
float _FloatSwap (float f) __attribute__((const));
float _FloatNoSwap (float f) __attribute__((const));
#ifdef __GNUC__

View file

@ -75,7 +75,7 @@ char *PL_WritePropertyList (plitem_t *pl);
\param item The object
\return the type of the object
*/
pltype_t PL_Type (plitem_t *item);
pltype_t PL_Type (plitem_t *item) __attribute__((pure));
/** Retrieve a string from a string object.
@ -85,7 +85,7 @@ pltype_t PL_Type (plitem_t *item);
\note You are NOT responsible for freeing the returned object. It will
be destroyed when its container is.
*/
const char *PL_String (plitem_t *string);
const char *PL_String (plitem_t *string) __attribute__((pure));
/** Retrieve a value from a dictionary object.
@ -117,7 +117,7 @@ plitem_t *PL_RemoveObjectForKey (plitem_t *dict, const char *key);
\note You are NOT responsible for freeing the returned object. It will
be destroyed when its container is.
*/
plitem_t *PL_ObjectAtIndex (plitem_t *array, int index);
plitem_t *PL_ObjectAtIndex (plitem_t *array, int index) __attribute__((pure));
/** Retrieve a list of all keys in a dictionary.
@ -133,7 +133,7 @@ plitem_t *PL_D_AllKeys (plitem_t *dict);
\return Returns the number of keys in the dictionary.
*/
int PL_D_NumKeys (plitem_t *dict);
int PL_D_NumKeys (plitem_t *dict) __attribute__((pure));
/** Add a key/value pair to a dictionary.
@ -164,7 +164,7 @@ qboolean PL_A_AddObject (plitem_t *array, plitem_t *item);
\return number of objects in the array
*/
int PL_A_NumObjects (plitem_t *array);
int PL_A_NumObjects (plitem_t *array) __attribute__((pure));
/** Insert an item into an array before the specified location.

View file

@ -356,7 +356,7 @@ char *QFS_CompressPath (const char *pth);
\return Pointer to the beginning of the filename. This points
inside \a pathname.
*/
const char *QFS_SkipPath (const char *pathname);
const char *QFS_SkipPath (const char *pathname) __attribute__((pure));
/** Return a pointer to the start of the extention part of the path.
@ -366,7 +366,7 @@ const char *QFS_SkipPath (const char *pathname);
the returned pointer will point to the terminating nul
of the path.
*/
const char *QFS_FileExtension (const char *in);
const char *QFS_FileExtension (const char *in) __attribute__((pure));
/** Register a callback function for when the gamedir changes.

View file

@ -40,7 +40,7 @@ typedef struct QFile_s QFile;
int Qrename(const char *old_path, const char *new_path);
int Qremove(const char *path);
int Qfilesize (QFile *file);
int Qfilesize (QFile *file) __attribute__((pure));
QFile *Qopen(const char *path, const char *mode);
QFile *Qdopen(int fd, const char *mode);
QFile *Qfopen (FILE *file, const char *mode);

View file

@ -95,7 +95,7 @@ void Script_UngetToken (script_t *script);
/** Return a pointer to the current token.
\param script The script_t object being parsed
*/
const char *Script_Token (script_t *script);
const char *Script_Token (script_t *script) __attribute__((pure));
//@}

View file

@ -256,14 +256,14 @@ set_t *set_everything (set_t *set);
\param set The set to test.
\return 1 if \a set is empty (non-inverted).
*/
int set_is_empty (const set_t *set);
int set_is_empty (const set_t *set) __attribute__((pure));
/** Test if a set is the set of everything.
\param set The set to test.
\return 1 if \a set is the set of everything (empty inverted set).
*/
int set_is_everything (const set_t *set);
int set_is_everything (const set_t *set) __attribute__((pure));
/** Test if two sets are disjoint.
@ -273,7 +273,7 @@ int set_is_everything (const set_t *set);
\note The emtpy set is disjoint with itself.
*/
int set_is_disjoint (const set_t *s1, const set_t *s2);
int set_is_disjoint (const set_t *s1, const set_t *s2) __attribute__((pure));
/** Test if two sets intersect.
@ -283,7 +283,7 @@ int set_is_disjoint (const set_t *s1, const set_t *s2);
\note Equivalent non-empty sets are treated as intersecting.
*/
int set_is_intersecting (const set_t *s1, const set_t *s2);
int set_is_intersecting (const set_t *s1, const set_t *s2) __attribute__((pure));
/** Test if two sets are equivalent.
@ -291,7 +291,7 @@ int set_is_intersecting (const set_t *s1, const set_t *s2);
\param s2 The second set to test.
\return 1 if \a s2 is equivalent to \a s1, 0 if not.
*/
int set_is_equivalent (const set_t *s1, const set_t *s2);
int set_is_equivalent (const set_t *s1, const set_t *s2) __attribute__((pure));
/** Test if a set is a subset of another set.
@ -302,7 +302,7 @@ int set_is_equivalent (const set_t *s1, const set_t *s2);
\return 1 if \a sub is a subset of \a set, or if the sets are
equivalent.
*/
int set_is_subset (const set_t *set, const set_t *sub);
int set_is_subset (const set_t *set, const set_t *sub) __attribute__((pure));
/** Test an element for membership in a set.
@ -310,7 +310,7 @@ int set_is_subset (const set_t *set, const set_t *sub);
\param x The element to test.
\return 1 if the element is a member of the set, otherwise 0.
*/
int set_is_member (const set_t *set, unsigned x);
int set_is_member (const set_t *set, unsigned x) __attribute__((pure));
/** Obtain the number of members (or non-members) of a set.
@ -322,7 +322,7 @@ int set_is_member (const set_t *set, unsigned x);
\return The number of (non-)members. Both empty sets and sets of
evertything will return 0.
*/
unsigned set_size (const set_t *set);
unsigned set_size (const set_t *set) __attribute__((pure));
/** Find the first "member" of the set.

View file

@ -62,7 +62,7 @@ int Sys_FileExists (const char *path);
int Sys_isdir (const char *path);
int Sys_mkdir (const char *path);
typedef void (*sys_printf_t) (const char *fmt, va_list args);
typedef void (*sys_printf_t) (const char *fmt, va_list args) __attribute__((format(printf, 1, 0)));
typedef void (*sys_error_t) (void *data);
void Sys_SetStdPrintf (sys_printf_t func);
@ -71,7 +71,7 @@ void Sys_SetErrPrintf (sys_printf_t func);
void Sys_PushErrorHandler (sys_error_t func, void *data);
void Sys_PopErrorHandler (void);
void Sys_Print (FILE *stream, const char *fmt, va_list args);
void Sys_Print (FILE *stream, const char *fmt, va_list args) __attribute__((format(printf, 2, 0)));
void Sys_Printf (const char *fmt, ...) __attribute__((format(printf,1,2)));
void Sys_Error (const char *error, ...) __attribute__((format(printf,1,2), noreturn));
void Sys_FatalError (const char *error, ...) __attribute__((format(printf,1,2), noreturn));

View file

@ -107,7 +107,7 @@ void Z_CheckPointer (const memzone_t *zone, const void *ptr, int size);
void *Hunk_Alloc (int size); // returns 0 filled memory
void *Hunk_AllocName (int size, const char *name);
int Hunk_LowMark (void);
int Hunk_LowMark (void) __attribute__((pure));
void Hunk_FreeToLowMark (int mark);
void *Hunk_TempAlloc (int size);
void Hunk_Check (void);
@ -138,7 +138,7 @@ void Cache_Remove (cache_user_t *c);
void *Cache_TryGet (cache_user_t *c);
void *Cache_Get (cache_user_t *c);
void Cache_Release (cache_user_t *c);
int Cache_ReadLock (cache_user_t *c);
int Cache_ReadLock (cache_user_t *c) __attribute__((pure));
//@}

View file

@ -65,7 +65,7 @@ typedef enum {
typedef struct particle_s particle_t;
typedef void (*pt_phys_func)(particle_t *);
pt_phys_func R_ParticlePhysics (ptype_t type);
pt_phys_func R_ParticlePhysics (ptype_t type) __attribute__((pure));
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
struct particle_s

View file

@ -94,11 +94,11 @@ void R_ShowSubDiv (void);
extern void (*prealspandrawer)(void);
surfcache_t *D_CacheSurface (msurface_t *surface, int miplevel);
extern int D_MipLevelForScale (float scale);
int D_MipLevelForScale (float scale) __attribute__((pure));
#ifdef USE_INTEL_ASM
extern void D_PolysetAff8Start (void);
extern void D_PolysetAff8End (void);
void D_PolysetAff8Start (void);
void D_PolysetAff8End (void);
#endif
extern short *d_pzbuffer;

View file

@ -80,7 +80,7 @@ typedef union token_u
extern exp_error_t EXP_ERROR;
const char *EXP_GetErrorMsg (void);
const char *EXP_GetErrorMsg (void) __attribute__((pure));
token *EXP_ParseString (char *str);
exp_error_t EXP_SimplifyTokens (token *chain);
void EXP_RemoveToken (token *tok);

View file

@ -40,7 +40,7 @@ void GIB_Buffer_Push_Sstack (struct cbuf_s *cbuf);
void GIB_Buffer_Pop_Sstack (struct cbuf_s *cbuf);
dstring_t *GIB_Buffer_Dsarray_Get (struct cbuf_s *cbuf);
void GIB_Buffer_Reply_Callback (int argc, const char **argv, void *data);
void GIB_Buffer_Error (cbuf_t *cbuf, const char *type, const char *fmt, va_list args);
void GIB_Buffer_Error (cbuf_t *cbuf, const char *type, const char *fmt, va_list args) __attribute__((format(printf, 3, 0)));
extern struct cbuf_interpreter_s gib_interp;

View file

@ -43,5 +43,5 @@ gib_tree_t *GIB_Parse_Embedded (gib_tree_t *token);
extern qboolean gib_parse_error;
void GIB_Parse_Error (const char *msg, unsigned int pos);
const char *GIB_Parse_ErrorMsg (void);
unsigned int GIB_Parse_ErrorPos (void);
const char *GIB_Parse_ErrorMsg (void) __attribute__((pure));
unsigned int GIB_Parse_ErrorPos (void) __attribute__((pure));

View file

@ -39,7 +39,7 @@ typedef struct gib_regex_s {
void GIB_Regex_Init (void);
regex_t *GIB_Regex_Compile (const char *regex, int cflags);
const char *GIB_Regex_Error (void);
int GIB_Regex_Translate_Options (const char *opstr);
int GIB_Regex_Translate_Runtime_Options (const char *opstr);
const char *GIB_Regex_Error (void) __attribute__((const));
int GIB_Regex_Translate_Options (const char *opstr) __attribute__((pure));
int GIB_Regex_Translate_Runtime_Options (const char *opstr) __attribute__((pure));
unsigned int GIB_Regex_Apply_Match (regmatch_t match[10], dstring_t *dstr, unsigned int ofs, const char *replace);

View file

@ -116,7 +116,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);
qboolean NET_CompareAdr (netadr_t a, netadr_t b) __attribute__((pure));
/** Compare two network addresses.
@ -126,7 +126,7 @@ qboolean NET_CompareAdr (netadr_t a, netadr_t b);
\param b The second address to compare.
\return True of the addresses match, otherwise false.
*/
qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b);
qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b) __attribute__((pure));
/** Convert an address to a string.
@ -362,7 +362,7 @@ void Netchan_Setup (netchan_t *chan, netadr_t adr, int qport, ncqport_e flags);
\param chan The netchan representing the connection.
\return True if the connection isn't chocked.
*/
qboolean Netchan_CanPacket (netchan_t *chan);
qboolean Netchan_CanPacket (netchan_t *chan) __attribute__((pure));
/** Check if a reliable packet can be sent to the connection.
@ -370,7 +370,7 @@ qboolean Netchan_CanPacket (netchan_t *chan);
\return True if there is no outstanding reliable packet and the
connection isn't chocked.
*/
qboolean Netchan_CanReliable (netchan_t *chan);
qboolean Netchan_CanReliable (netchan_t *chan) __attribute__((pure));
/** Send a packet.

View file

@ -22,34 +22,34 @@
#ifndef __ops_h
#define __ops_h
double OP_Not (double op1, double op2);
double OP_Negate (double op1, double op2);
double OP_Add (double op1, double op2);
double OP_Sub (double op1, double op2);
double OP_Mult (double op1, double op2);
double OP_Div (double op1, double op2);
double OP_Exp (double op1, double op2);
double OP_Eq (double op1, double op2);
double OP_Neq (double op1, double op2);
double OP_Or (double op1, double op2);
double OP_And (double op1, double op2);
double OP_GreaterThan (double op1, double op2);
double OP_LessThan (double op1, double op2);
double OP_GreaterThanEqual (double op1, double op2);
double OP_LessThanEqual (double op1, double op2);
double OP_BitAnd (double op1, double op2);
double OP_BitOr (double op1, double op2);
double OP_BitXor (double op1, double op2);
double OP_BitInv (double op1, double op2);
double OP_Not (double op1, double op2) __attribute__((const));
double OP_Negate (double op1, double op2) __attribute__((const));
double OP_Add (double op1, double op2) __attribute__((const));
double OP_Sub (double op1, double op2) __attribute__((const));
double OP_Mult (double op1, double op2) __attribute__((const));
double OP_Div (double op1, double op2) __attribute__((const));
double OP_Exp (double op1, double op2) __attribute__((const));
double OP_Eq (double op1, double op2) __attribute__((const));
double OP_Neq (double op1, double op2) __attribute__((const));
double OP_Or (double op1, double op2) __attribute__((const));
double OP_And (double op1, double op2) __attribute__((const));
double OP_GreaterThan (double op1, double op2) __attribute__((const));
double OP_LessThan (double op1, double op2) __attribute__((const));
double OP_GreaterThanEqual (double op1, double op2) __attribute__((const));
double OP_LessThanEqual (double op1, double op2) __attribute__((const));
double OP_BitAnd (double op1, double op2) __attribute__((const));
double OP_BitOr (double op1, double op2) __attribute__((const));
double OP_BitXor (double op1, double op2) __attribute__((const));
double OP_BitInv (double op1, double op2) __attribute__((const));
double Func_Sin (double *oplist, unsigned int numops);
double Func_Cos (double *oplist, unsigned int numops);
double Func_Tan (double *oplist, unsigned int numops);
double Func_Asin (double *oplist, unsigned int numops);
double Func_Acos (double *oplist, unsigned int numops);
double Func_Atan (double *oplist, unsigned int numops);
double Func_Sqrt (double *oplist, unsigned int numops);
double Func_Abs (double *oplist, unsigned int numops);
double Func_Sin (double *oplist, unsigned int numops) __attribute__((pure));
double Func_Cos (double *oplist, unsigned int numops) __attribute__((pure));
double Func_Tan (double *oplist, unsigned int numops) __attribute__((pure));
double Func_Asin (double *oplist, unsigned int numops) __attribute__((pure));
double Func_Acos (double *oplist, unsigned int numops) __attribute__((pure));
double Func_Atan (double *oplist, unsigned int numops) __attribute__((pure));
double Func_Sqrt (double *oplist, unsigned int numops) __attribute__((pure));
double Func_Abs (double *oplist, unsigned int numops) __attribute__((pure));
double Func_Rand (double *oplist, unsigned int numops);
double Func_Trunc (double *oplist, unsigned int numops);
double Func_Trunc (double *oplist, unsigned int numops) __attribute__((pure));
#endif // __ops_h

View file

@ -31,8 +31,8 @@
#include <sys/types.h>
#include <stdarg.h>
const char * Q_strcasestr (const char *haystack, const char *needle);
size_t Q_strnlen (const char *s, size_t maxlen);
const char * Q_strcasestr (const char *haystack, const char *needle) __attribute__((pure));
size_t Q_strnlen (const char *s, size_t maxlen) __attribute__((pure));
size_t Q_snprintfz (char *dest, size_t size, const char *fmt, ...) __attribute__((format(printf,3,4)));
size_t Q_vsnprintfz (char *dest, size_t size, const char *fmt, va_list argptr);

View file

@ -43,7 +43,7 @@ typedef struct backbuf_s {
const char *name;
} backbuf_t;
int MSG_ReliableCheckSize (backbuf_t *rel, int maxsize, int minsize);
int MSG_ReliableCheckSize (backbuf_t *rel, int maxsize, int minsize) __attribute__((pure));
sizebuf_t *MSG_ReliableCheckBlock(backbuf_t *rel, int maxsize);
void MSG_Reliable_FinishWrite(backbuf_t *rel);
sizebuf_t *MSG_ReliableWrite_Begin(backbuf_t *rel, int c, int maxsize);

View file

@ -106,9 +106,9 @@ void PlayerMove (void);
void Pmove_Init (void);
void Pmove_Init_Cvars (void);
int PM_HullPointContents (hull_t *hull, int num, const vec3_t p);
int PM_HullPointContents (hull_t *hull, int num, const vec3_t p) __attribute__((pure));
int PM_PointContents (const vec3_t point);
int PM_PointContents (const vec3_t point) __attribute__((pure));
qboolean PM_TestPlayerPosition (const vec3_t point);
trace_t PM_PlayerMove (const vec3_t start, const vec3_t stop);

View file

@ -32,7 +32,7 @@ struct plitem_s;
void Fog_ParseWorldspawn (struct plitem_s *worldspawn);
float *Fog_GetColor (void);
float Fog_GetDensity (void);
float Fog_GetDensity (void) __attribute__((pure));
void Fog_SetupFrame (void);
void Fog_EnableGFog (void);
void Fog_DisableGFog (void);
@ -63,7 +63,7 @@ void R_NewMap (model_t *worldmodel, model_t **models, int num_models);
void R_PushDlights (const vec3_t entorigin);
void R_DrawWaterSurfaces (void);
void *D_SurfaceCacheAddress (void);
void *D_SurfaceCacheAddress (void) __attribute__((pure));
int D_SurfaceCacheForRes (int width, int height);
void D_FlushCaches (void);
void D_DeleteSurfaceCache (void);

View file

@ -151,7 +151,7 @@ void R_TransformPlane (plane_t *p, float *normal, float *dist);
void R_TransformFrustum (void);
void R_SetSkyFrame (void);
void R_DrawSurfaceBlock (void);
texture_t *R_TextureAnimation (msurface_t *surf);
texture_t *R_TextureAnimation (msurface_t *surf) __attribute__((pure));
void R_GenSkyTile (void *pdest);
void R_SurfPatch (void);

View file

@ -71,7 +71,7 @@ extern vrect_t scr_vrect;
extern qboolean scr_skipupdate;
float CalcFov (float fov_x, float width, float height);
float CalcFov (float fov_x, float width, float height) __attribute__((const));
void SCR_SetUpToDrawConsole (void);
void SCR_ScreenShot_f (void);

View file

@ -502,13 +502,13 @@ int SND_LoadMidi (QFile *file, sfx_t *sfx, char *realname);
\param sfx sound reference
\return pointer to sound's wavinfo
*/
wavinfo_t *SND_CacheWavinfo (sfx_t *sfx);
wavinfo_t *SND_CacheWavinfo (sfx_t *sfx) __attribute__((pure));
/** Retrieve wavinfo from a streamed sound.
\param sfx sound reference
\return pointer to sound's wavinfo
*/
wavinfo_t *SND_StreamWavinfo (sfx_t *sfx);
wavinfo_t *SND_StreamWavinfo (sfx_t *sfx) __attribute__((pure));
/** Ensure a cached sound is in memory.
\param sfx sound reference
@ -522,7 +522,7 @@ sfxbuffer_t *SND_CacheTouch (sfx_t *sfx);
\note The sound must be retained with SND_CacheRetain() for the returned
buffer to be valid.
*/
sfxbuffer_t *SND_CacheGetBuffer (sfx_t *sfx);
sfxbuffer_t *SND_CacheGetBuffer (sfx_t *sfx) __attribute__((pure));
/** Lock a cached sound into memory. After calling this, SND_CacheGetBffer()
will return a valid buffer.
@ -541,14 +541,14 @@ void SND_CacheRelease (sfx_t *sfx);
\param sfx sound reference
\return poitner to sound buffer
*/
sfxbuffer_t *SND_StreamGetBuffer (sfx_t *sfx);
sfxbuffer_t *SND_StreamGetBuffer (sfx_t *sfx) __attribute__((pure));
/** Lock a streamed sound into memory. Doesn't actually do anything other than
return a pointer to the buffer.
\param sfx sound reference
\return poitner to sound buffer
*/
sfxbuffer_t *SND_StreamRetain (sfx_t *sfx);
sfxbuffer_t *SND_StreamRetain (sfx_t *sfx) __attribute__((pure));
/** Unlock a streamed sound from memory. Doesn't actually do anything.
\param sfx sound reference

View file

@ -98,8 +98,8 @@ void SV_LinkEdict (struct edict_s *ent, qboolean touch_triggers);
// sets ent->v.absmin and ent->v.absmax
// if touchtriggers, calls prog functions for the intersected triggers
int SV_PointContents (const vec3_t p);
int SV_TruePointContents (const vec3_t p);
int SV_PointContents (const vec3_t p) __attribute__((pure));
int SV_TruePointContents (const vec3_t p) __attribute__((pure));
// returns the CONTENTS_* value from the world at the given point.
// does not check any entities at all
// the non-true version remaps the water current contents to content_water
@ -123,7 +123,7 @@ trace_t SV_Move (const vec3_t start, const vec3_t mins, const vec3_t maxs,
struct edict_s *SV_TestPlayerPosition (struct edict_s *ent,
const vec3_t origin);
int SV_HullPointContents (hull_t *hull, int num, const vec3_t p);
int SV_HullPointContents (hull_t *hull, int num, const vec3_t p) __attribute__((pure));
hull_t *SV_HullForEntity (struct edict_s *ent, const vec3_t mins,
const vec3_t maxs, vec3_t extents, vec3_t offset);
void MOD_TraceLine (hull_t *hull, int num,

View file

@ -103,7 +103,7 @@ SNDDMA_Init_Cvars (void)
static int SNDDMA_GetDMAPos (void);
static snd_pcm_uframes_t
static __attribute__((const)) snd_pcm_uframes_t
round_buffer_size (snd_pcm_uframes_t sz)
{
snd_pcm_uframes_t mask = ~0;

View file

@ -360,7 +360,7 @@ Linefeed (void)
All console printing must go through this in order to be logged to disk
If no console is visible, the notify window will pop up.
*/
static void
static __attribute__((format(printf, 1, 0))) void
C_Print (const char *fmt, va_list args)
{
char *s;

View file

@ -708,7 +708,7 @@ C_Shutdown (void)
#endif
}
static void
static __attribute__((format(printf, 1, 0))) void
C_Print (const char *fmt, va_list args)
{
static dstring_t *buffer;

View file

@ -144,7 +144,7 @@ free_string_ref (progs_t *pr, strref_t *sr)
pr->free_string_refs = sr;
}
static string_t
static __attribute__((pure)) string_t
string_index (progs_t *pr, strref_t *sr)
{
long o = (long) (sr - pr->static_strings);
@ -251,7 +251,7 @@ get_strref (progs_t *pr, string_t num)
return 0;
}
static inline const char *
static inline __attribute__((pure)) const char *
get_string (progs_t *pr, string_t num)
{
if (num < 0) {

View file

@ -154,7 +154,7 @@ EXP_FindFuncByStr (const char *str)
return 0;
}
static int
static __attribute__((pure)) int
EXP_ContainsCommas (token * chain)
{
token *cur;

View file

@ -104,7 +104,7 @@ NET_Ban_f (void)
{
char addrStr[32]; //FIXME: overflow
char maskStr[32]; //FIXME: overflow
void (*print) (const char *fmt, ...);
__attribute__((format(printf, 1, 2))) void (*print) (const char *fmt, ...);
if (cmd_source == src_command) {
if (!sv.active) {
@ -262,7 +262,7 @@ Datagram_CanSendMessage (qsocket_t *sock)
}
qboolean
__attribute__((const)) qboolean
Datagram_CanSendUnreliableMessage (qsocket_t *sock)
{
return true;

View file

@ -42,7 +42,7 @@ qboolean localconnectpending = false;
qsocket_t *loop_client = NULL;
qsocket_t *loop_server = NULL;
int
__attribute__((pure)) int
Loop_Init (void)
{
if (cls.state == ca_dedicated)
@ -240,7 +240,7 @@ Loop_SendUnreliableMessage (qsocket_t * sock, sizebuf_t *data)
}
qboolean
__attribute__((pure)) qboolean
Loop_CanSendMessage (qsocket_t * sock)
{
if (!sock->driverdata)
@ -249,7 +249,7 @@ Loop_CanSendMessage (qsocket_t * sock)
}
qboolean
__attribute__((const)) qboolean
Loop_CanSendUnreliableMessage (qsocket_t * sock)
{
return true;

View file

@ -433,7 +433,7 @@ error:
return -1;
}
int
__attribute__((const)) int
UDP_Connect (int socket, netadr_t *addr)
{
return 0;
@ -651,7 +651,7 @@ UDP_GetAddrFromName (const char *name, netadr_t *addr)
return 0;
}
int
__attribute__((pure)) int
UDP_AddrCompare (netadr_t *addr1, netadr_t *addr2)
{
if (addr1->family != addr2->family)
@ -666,7 +666,7 @@ UDP_AddrCompare (netadr_t *addr1, netadr_t *addr2)
return 0;
}
int
__attribute__((pure)) int
UDP_GetSocketPort (netadr_t *addr)
{
return ntohs (addr->port);

View file

@ -166,14 +166,14 @@ VCR_SearchForHosts (qboolean xmit)
}
qsocket_t *
__attribute__((const)) qsocket_t *
VCR_Connect (const char *host)
{
return NULL;
}
qsocket_t *
qsocket_t *
VCR_CheckNewConnections (void)
{
qsocket_t *sock;

View file

@ -299,7 +299,7 @@ dstring_clearstr (dstring_t *dstr)
dstr->str[0] = 0;
}
static int
static __attribute__((format(printf, 3, 0))) int
_dvsprintf (dstring_t *dstr, int offs, const char *fmt, va_list args)
{
int size;

View file

@ -343,7 +343,7 @@ set_everything (set_t *set)
return set;
}
static inline int
static inline __attribute__((pure)) int
_set_is_empty (const set_t *set)
{
unsigned i;
@ -370,7 +370,7 @@ set_is_everything (const set_t *set)
return _set_is_empty (set);
}
static int
static __attribute__((pure)) int
set_test_n_n (const set_t *s1, const set_t *s2)
{
unsigned i, end;
@ -394,7 +394,7 @@ set_test_n_n (const set_t *s1, const set_t *s2)
return (difference != 0) | ((intersection != 0) << 1);
}
static int
static __attribute__((pure)) int
set_test_n_i (const set_t *s1, const set_t *s2)
{
unsigned i, end;
@ -419,7 +419,7 @@ set_test_n_i (const set_t *s1, const set_t *s2)
return (difference != 0) | ((intersection != 0) << 1);
}
static int
static __attribute__((pure)) int
set_test_i_n (const set_t *s1, const set_t *s2)
{
unsigned i, end;
@ -444,7 +444,7 @@ set_test_i_n (const set_t *s1, const set_t *s2)
return (difference != 0) | ((intersection != 0) << 1);
}
static int
static __attribute__((pure)) int
set_test_i_i (const set_t *s1, const set_t *s2)
{
unsigned i, end;
@ -470,7 +470,7 @@ set_test_i_i (const set_t *s1, const set_t *s2)
return (difference != 0) | ((intersection != 0) << 1);
}
static int
static __attribute__((pure)) int
set_test (const set_t *s1, const set_t *s2)
{
if (s1->inverted && s2->inverted)

View file

@ -90,8 +90,8 @@
#include "compat.h"
static void Sys_StdPrintf (const char *fmt, va_list args);
static void Sys_ErrPrintf (const char *fmt, va_list args);
static void Sys_StdPrintf (const char *fmt, va_list args) __attribute__((format(printf, 1, 0)));
static void Sys_ErrPrintf (const char *fmt, va_list args) __attribute__((format(printf, 1, 0)));
VISIBLE cvar_t *sys_nostdout;
VISIBLE cvar_t *sys_extrasleep;

View file

@ -134,7 +134,7 @@ print_rects (vrect_t *rect)
printf ("\n");
}
static int
static __attribute__((pure)) int
compare_rects (vrect_t *r1, vrect_t *r2)
{
if (!r1 && !r2)

View file

@ -91,7 +91,7 @@ GLF_FindFunctions (void)
It takes a bit of care to be fool-proof about parsing an OpenGL extensions
string. Don't be fooled by sub-strings, etc.
*/
static qboolean
static __attribute__((pure)) qboolean
QFGL_ParseExtensionList (const GLubyte *list, const char *name)
{
const char *start;

View file

@ -1321,7 +1321,7 @@ glsl_R_InitBsp (void)
GLSL_FreeShader (frag_shader);
}
static inline int
static inline __attribute__((const)) int
is_pow2 (unsigned x)
{
int count;

View file

@ -227,7 +227,7 @@ glsl_SCR_CaptureBGR (void)
return tex;
}
tex_t *
__attribute__((const)) tex_t *
glsl_SCR_ScreenShot (int width, int height)
{
return 0;

View file

@ -87,7 +87,7 @@ sw32_SCR_CaptureBGR (void)
return tex;
}
tex_t *
__attribute__((const)) tex_t *
sw32_SCR_ScreenShot (int width, int height)
{
return 0;

View file

@ -511,7 +511,7 @@ keyname_t keynames[] = {
{NULL, 0}
};
static imt_t *
static __attribute__((pure)) imt_t *
key_target_find_imt (keytarget_t *kt, const char *imt_name)
{
imt_t *imt;

View file

@ -62,10 +62,10 @@ void Host_ServerFrame (void);
void Host_InitCommands (void);
void Host_Init (void);
void Host_Shutdown(void);
void Host_Error (const char *error, ...) __attribute__((format(printf,1,2)));
void Host_EndGame (const char *message, ...) __attribute__((format(printf,1,2)));
void Host_Error (const char *error, ...) __attribute__((format(printf,1,2), noreturn));
void Host_EndGame (const char *message, ...) __attribute__((format(printf,1,2), noreturn));
void Host_Frame (float time);
void Host_Quit_f (void);
void Host_Quit_f (void) __attribute__((noreturn));
void Host_ClientCommands (const char *fmt, ...) __attribute__((format(printf,1,2)));
void Host_ShutdownServer (qboolean crash);

View file

@ -255,7 +255,7 @@ void SV_DropClient (qboolean crash);
void SV_SendClientMessages (void);
void SV_ClearDatagram (void);
int SV_ModelIndex (const char *name);
int SV_ModelIndex (const char *name) __attribute__((pure));
void SV_SetIdealPitch (void);
@ -268,7 +268,7 @@ void SV_ClientPrintf (const char *fmt, ...) __attribute__((format(printf,1,2)));
void SV_BroadcastPrintf (const char *fmt, ...) __attribute__((format(printf,1,2)));
struct trace_s SV_PushEntity (edict_t *ent, vec3_t push);
int SV_EntCanSupportJump (edict_t *ent);
int SV_EntCanSupportJump (edict_t *ent) __attribute__((pure));
int SV_FlyMove (edict_t *ent, float time, struct trace_s *steptrace);
void SV_CheckVelocity (edict_t *ent);
qboolean SV_RunThink (edict_t *ent);

View file

@ -78,7 +78,7 @@ Host_Status_f (void)
int minutes;
int hours = 0;
int j;
void (*print) (const char *fmt, ...);
__attribute__((format(printf, 1, 2))) void (*print) (const char *fmt, ...);
if (cmd_source == src_command) {
if (!sv.active) {

View file

@ -113,7 +113,7 @@ CL_NextDemo (void)
{
}
int
__attribute__((const)) int
CL_ReadFromServer (void)
{
return 0;
@ -156,7 +156,7 @@ S_UnblockSound (void)
}
plugin_t *console_client_PluginInfo (void);
plugin_t *
__attribute__((const)) plugin_t *
console_client_PluginInfo (void)
{
return 0;

View file

@ -1069,7 +1069,7 @@ PF_changeyaw (progs_t *pr)
#define MSG_ALL 2 // reliable to all
#define MSG_INIT 3 // write to the init string
static sizebuf_t *
static __attribute__((pure)) sizebuf_t *
WriteDest (progs_t *pr)
{
int entnum;

View file

@ -705,7 +705,7 @@ ctl_pretest_triggers (edict_t *touch, moveclip_t *clip)
return 1;
}
static always_inline int
static always_inline __attribute__((pure)) int
ctl_pretest_other (edict_t *touch, moveclip_t *clip)
{
if (SVfloat (touch, solid) == SOLID_NOT)

View file

@ -87,7 +87,7 @@ redirect_t qtv_redirected;
client_t *qtv_redirect_client;
dstring_t outputbuf = {&dstring_default_mem};
static void
static __attribute__((format(printf, 1, 0))) void
qtv_print (const char *fmt, va_list args)
{
static int pending;

View file

@ -43,9 +43,9 @@ extern int spec_track; // player# of who we are tracking
extern int ideal_track;
void Cam_Lock (int playernum);
int Cam_TrackNum (void);
qboolean Cam_DrawViewModel(void);
qboolean Cam_DrawPlayer(int playernum);
int Cam_TrackNum (void) __attribute__((pure));
qboolean Cam_DrawViewModel(void) __attribute__((pure));
qboolean Cam_DrawPlayer(int playernum) __attribute__((pure));
void Cam_Track(usercmd_t *cmd);
void Cam_FinishMove(usercmd_t *cmd);
void Cam_Reset(void);

View file

@ -52,7 +52,7 @@ void CL_ParseServerMessage (void);
void CL_ParseClientdata (void);
void CL_NewTranslation (int slot, struct skin_s *skin);
qboolean CL_CheckOrDownloadFile (const char *filename);
qboolean CL_IsUploading(void);
qboolean CL_IsUploading(void) __attribute__((pure));
void CL_NextUpload(void);
void CL_FinishDownload (void);
void CL_FailDownload (void);

View file

@ -35,6 +35,6 @@ void CF_Close (int desc);
const char * CF_Read (int desc);
int CF_Write (int desc, const char *buf);
int CF_EOF (int desc);
int CF_Quota (void);
int CF_Quota (void) __attribute__((pure));
#endif // _CRUDEFILE_H

View file

@ -51,8 +51,8 @@ void Host_ServerFrame (void);
void Host_InitCommands (void);
void Host_Init (void);
void Host_Shutdown(void);
void Host_Error (const char *error, ...) __attribute__((format(printf,1,2)));
void Host_EndGame (const char *message, ...) __attribute__((format(printf,1,2)));
void Host_Error (const char *error, ...) __attribute__((format(printf,1,2), noreturn));
void Host_EndGame (const char *message, ...) __attribute__((format(printf,1,2), noreturn));
void Host_Frame (float time);
void Host_Quit_f (void);
void Host_ClientCommands (const char *fmt, ...) __attribute__((format(printf,1,2)));

View file

@ -492,11 +492,11 @@ void SV_Shutdown (void);
void SV_Frame (float time);
void SV_FinalMessage (const char *message);
void SV_DropClient (client_t *drop);
int SV_CalcPing (client_t *cl);
int SV_CalcPing (client_t *cl) __attribute__((pure));
void SV_FullClientUpdate (client_t *client, sizebuf_t *buf);
void SV_FullClientUpdateToClient (client_t *client, backbuf_t *backbuf);
int SV_ModelIndex (const char *name);
int SV_ModelIndex (const char *name) __attribute__((pure));
qboolean SV_CheckBottom (struct edict_s *ent);
qboolean SV_movestep (struct edict_s *ent, const vec3_t move,
@ -549,12 +549,12 @@ struct trace_s;
int SV_FlyMove (struct edict_s *ent, float time, struct trace_s *steptrace);
struct trace_s SV_PushEntity (struct edict_s *ent, vec3_t push,
unsigned traceflags);
int SV_EntCanSupportJump (struct edict_s *ent);
int SV_EntCanSupportJump (struct edict_s *ent) __attribute__((pure));
//
// sv_send.c
//
void SV_Print (const char *fmt, va_list args);
void SV_Print (const char *fmt, va_list args) __attribute__((format(printf, 1, 0)));
void SV_Printf (const char *fmt, ...) __attribute__((format(printf,1,2)));
void SV_SendClientMessages (void);
void SV_GetStats (struct edict_s *ent, int spectator, int stats[]);
@ -611,7 +611,7 @@ extern struct dstring_s outputbuf;
// sv_ccmds.c
//
void SV_Status_f (void);
const char *SV_Current_Map (void);
const char *SV_Current_Map (void) __attribute__((pure));
void SV_SetLocalinfo (const char *key, const char *value);

View file

@ -42,12 +42,12 @@ recorder_t *SVR_AddUser (void (*writer)(void *, struct sizebuf_s *, int),
int demo, void *user);
void SVR_RemoveUser (recorder_t *r);
struct sizebuf_s *SVR_WriteBegin (byte type, int to, int size);
struct sizebuf_s *SVR_Datagram (void);
struct sizebuf_s *SVR_Datagram (void) __attribute__((const));
void SVR_ForceFrame (void);
void SVR_Pause (recorder_t *r);
void SVR_Continue (recorder_t *r);
void SVR_SetDelta (recorder_t *r, int delta, int in_frame);
void SVR_SendMessages (void);
int SVR_NumRecorders (void);
int SVR_NumRecorders (void) __attribute__((pure));
#endif//__sv_recorder_h

View file

@ -314,7 +314,7 @@ SL_Shutdown (void)
SL_Del_All (all_slist);
}
static char *
static __attribute__((pure)) char *
gettokstart (char *str, int req, char delim)
{
char *start = str;
@ -340,7 +340,7 @@ gettokstart (char *str, int req, char delim)
return start;
}
static int
static __attribute__((pure)) int
gettoklen (char *str, int req, char delim)
{
char *start = 0;

View file

@ -257,7 +257,7 @@ SV_Shutdown (void)
Sends a datagram to all the clients informing them of the server crash,
then exits
*/
static void
static __attribute__((format(printf, 1, 0))) void
SV_Error (const char *error, va_list argptr)
{
static qboolean inerror = false;
@ -1206,7 +1206,7 @@ SV_MaskIPTrim (byte *ip, int mask)
}
// assumes b has already been masked
static inline qboolean
static inline __attribute__((pure)) qboolean
SV_MaskIPCompare (byte *a, byte *b, int mask)
{
int i;

View file

@ -1061,7 +1061,7 @@ PF_changeyaw (progs_t *pr)
#define MSG_INIT 3 // write to the init string
#define MSG_MULTICAST 4 // for multicast ()
static sizebuf_t *
static __attribute__((pure)) sizebuf_t *
WriteDest (progs_t *pr)
{
int dest;
@ -1094,7 +1094,7 @@ WriteDest (progs_t *pr)
return NULL;
}
static client_t *
static __attribute__((pure)) client_t *
Write_GetClient (progs_t *pr)
{
edict_t *ent;

View file

@ -677,7 +677,7 @@ SV_ClipMoveToEntity (edict_t *touched, const vec3_t start,
return trace;
}
static always_inline int
static always_inline __attribute__((pure)) int
ctl_pretest_everything (edict_t *touch, moveclip_t *clip)
{
if (touch->free)
@ -705,7 +705,7 @@ ctl_pretest_triggers (edict_t *touch, moveclip_t *clip)
return 1;
}
static always_inline int
static always_inline __attribute__((pure)) int
ctl_pretest_other (edict_t *touch, moveclip_t *clip)
{
if (SVfloat (touch, solid) == SOLID_NOT)

View file

@ -69,7 +69,7 @@ brushset_t *Brush_LoadEntity (entity_t *ent, int hullnum);
\param normal Must be canonical.
*/
int PlaneTypeForNormal (const vec3_t normal);
int PlaneTypeForNormal (const vec3_t normal) __attribute__((pure));
/** Make the plane canonical.

View file

@ -95,7 +95,7 @@ void PrintEntity (const entity_t *ent);
\return The value for the key, or the empty string if the key
does not exist in this entity.
*/
const char *ValueForKey (const entity_t *ent, const char *key);
const char *ValueForKey (const entity_t *ent, const char *key) __attribute__((pure));
/** Set the value of the entity's key.
If the key does not exist, one will be added.

View file

@ -41,7 +41,7 @@ int outleafs;
\param point The point's location.
\return The leaf node in which the point is.
*/
static node_t *
static __attribute__((pure)) node_t *
PointInLeaf (node_t *node, const vec3_t point)
{
vec_t d;

View file

@ -422,7 +422,7 @@ int num_realleafs;
\param cont The contents for which to check.
\return 1 if the node has the specified contents, otherwise 0.
*/
static int
static __attribute__((pure)) int
HasContents (const node_t *n, int cont)
{
if (n->contents == cont)
@ -439,7 +439,7 @@ HasContents (const node_t *n, int cont)
\param n1 The first node to check.
\param n2 The second node to check.
*/
static int
static __attribute__((pure)) int
ShareContents (const node_t *n1, const node_t *n2)
{
if (n1->contents) {
@ -461,7 +461,7 @@ ShareContents (const node_t *n1, const node_t *n2)
\param n1 The first node to check.
\param n2 The second node to check.
*/
static int
static __attribute__((pure)) int
SameContents (const node_t *n1, const node_t *n2)
{
if (n1->contents == CONTENTS_SOLID || n2->contents == CONTENTS_SOLID)
@ -471,7 +471,7 @@ SameContents (const node_t *n1, const node_t *n2)
if (options.watervis) //FIXME be more picky?
return 1;
if (n1->detail && n2->detail)
ShareContents (n1, n2);
return ShareContents (n1, n2);
if (n1->detail)
return HasContents (n1, n2->contents);
if (n2->detail)

View file

@ -121,7 +121,7 @@ FaceSide (const face_t *in, const plane_t *split)
\param maxs The maximum coordinate of the boundiing box.
\return The chosen surface.
*/
static surface_t *
static __attribute__((pure)) surface_t *
ChooseMidPlaneFromList (surface_t *surfaces,
const vec3_t mins, const vec3_t maxs)
{
@ -186,7 +186,7 @@ ChooseMidPlaneFromList (surface_t *surfaces,
\return The chosen surface, or NULL if a suitable surface could
not be found.
*/
static surface_t *
static __attribute__((pure)) surface_t *
ChoosePlaneFromList (surface_t *surfaces, const vec3_t mins, const vec3_t maxs,
qboolean usefloors, qboolean usedetail)
{

View file

@ -107,13 +107,13 @@ struct expr_s;
struct method_s;
struct symbol_s;
int obj_is_id (const struct type_s *type);
int obj_is_class (const struct type_s *type);
int obj_is_Class (const struct type_s *type);
int obj_is_classptr (const struct type_s *type);
int obj_is_id (const struct type_s *type) __attribute__((pure));
int obj_is_class (const struct type_s *type) __attribute__((pure));
int obj_is_Class (const struct type_s *type) __attribute__((pure));
int obj_is_classptr (const struct type_s *type) __attribute__((pure));
int obj_types_assignable (const struct type_s *dst, const struct type_s *src);
class_t *extract_class (class_type_t *class_type);
class_t *extract_class (class_type_t *class_type) __attribute__((pure));
const char *get_class_name (class_type_t *class_type, int pretty);
struct symbol_s *class_symbol (class_type_t *class_type, int external);
void class_init (void);
@ -125,7 +125,7 @@ void class_add_ivars (class_t *class, struct symtab_s *ivars);
void class_check_ivars (class_t *class, struct symtab_s *ivars);
void class_begin (class_type_t *class_type);
void class_finish (class_type_t *class_type);
int class_access (class_type_t *current_class, class_t *class);
int class_access (class_type_t *current_class, class_t *class) __attribute__((pure));
struct symbol_s *class_find_ivar (class_t *class, int vis, const char *name);
struct symtab_s *class_ivar_scope (class_type_t *class_type,
struct symtab_s *parent);
@ -153,8 +153,8 @@ void protocol_add_protocols (protocol_t *protocol, protocollist_t *protocols);
struct def_s *protocol_def (protocol_t *protocol);
protocollist_t *new_protocol_list (void);
protocollist_t *add_protocol (protocollist_t *protocollist, const char *name);
int procollist_find_protocol (protocollist_t *protocollist, protocol_t *proto);
int compare_protocols (protocollist_t *protos1, protocollist_t *protos2);
int procollist_find_protocol (protocollist_t *protocollist, protocol_t *proto) __attribute__((pure));
int compare_protocols (protocollist_t *protos1, protocollist_t *protos2) __attribute__((pure));
void print_protocollist (struct dstring_s *dstr, protocollist_t *protocollist);
struct def_s *emit_protocol (protocol_t *protocol);
struct def_s *emit_protocol_list (protocollist_t *protocols, const char *name);

View file

@ -254,7 +254,7 @@ void initialize_def (struct symbol_s *sym, struct type_s *type,
\return 1 if the defs overlap, 2 if \a d1 fully overlaps \a d2,
otherwise 0.
*/
int def_overlap (def_t *d1, def_t *d2);
int def_overlap (def_t *d1, def_t *d2) __attribute__((pure));
/** Convenience function for obtaining a def's actual offset.
@ -263,7 +263,7 @@ int def_overlap (def_t *d1, def_t *d2);
\param def The def of which to obtain the offset. May be an alias def.
\return The actual offset of the def in the def's defspace.
*/
int def_offset (def_t *def);
int def_offset (def_t *def) __attribute__((pure));
/** Convenience function for obtaining a def's size.
@ -272,7 +272,7 @@ int def_offset (def_t *def);
\param def The def of which to obtain the size.
\return The size of the def.
*/
int def_size (def_t *def);
int def_size (def_t *def) __attribute__((pure));
/** Visit all defs that alias the given def, including itself.

View file

@ -384,7 +384,7 @@ expr_t *new_name_expr (const char *name);
(expr_t::e::string_val).
*/
expr_t *new_string_expr (const char *string_val);
const char *expr_string (expr_t *e);
const char *expr_string (expr_t *e) __attribute__((pure));
/** Create a new float constant expression node.
@ -393,7 +393,7 @@ const char *expr_string (expr_t *e);
(expr_t::e::float_val).
*/
expr_t *new_float_expr (float float_val);
float expr_float (expr_t *e);
float expr_float (expr_t *e) __attribute__((pure));
/** Create a new vector constant expression node.
@ -402,7 +402,7 @@ float expr_float (expr_t *e);
(expr_t::e::vector_val).
*/
expr_t *new_vector_expr (const float *vector_val);
const float *expr_vector (expr_t *e);
const float *expr_vector (expr_t *e) __attribute__((pure));
expr_t *new_vector_list (expr_t *e);
/** Create a new entity constant expression node.
@ -449,7 +449,7 @@ expr_t *new_pointer_expr (int val, struct type_s *type, struct def_s *def);
(expr_t::e::quaternion_val).
*/
expr_t *new_quaternion_expr (const float *quaternion_val);
const float *expr_quaternion (expr_t *e);
const float *expr_quaternion (expr_t *e) __attribute__((pure));
/** Create a new integer constant expression node.
@ -458,7 +458,7 @@ const float *expr_quaternion (expr_t *e);
(expr_t::e::integer_val).
*/
expr_t *new_integer_expr (int integer_val);
int expr_integer (expr_t *e);
int expr_integer (expr_t *e) __attribute__((pure));
/** Create a new integer constant expression node.
@ -467,7 +467,7 @@ int expr_integer (expr_t *e);
(expr_t::e::integer_val).
*/
expr_t *new_uinteger_expr (unsigned uinteger_val);
unsigned expr_uinteger (expr_t *e);
unsigned expr_uinteger (expr_t *e) __attribute__((pure));
/** Create a new short constant expression node.
@ -476,14 +476,14 @@ unsigned expr_uinteger (expr_t *e);
(expr_t::e::short_val).
*/
expr_t *new_short_expr (short short_val);
short expr_short (expr_t *e);
short expr_short (expr_t *e) __attribute__((pure));
/** Check of the expression refers to a constant value.
\param e The expression to check.
\return True if the expression is constant.
*/
int is_constant (expr_t *e);
int is_constant (expr_t *e) __attribute__((pure));
/** Return a value expression representing the constant stored in \a e.
@ -500,30 +500,30 @@ expr_t *constant_expr (expr_t *e);
\param op The op-code to check.
\return True if the op-code is a comparison operator.
*/
int is_compare (int op);
int is_compare (int op) __attribute__((const));
/** Check if the op-code is a math operator.
\param op The op-code to check.
\return True if the op-code is a math operator.
*/
int is_math_op (int op);
int is_math_op (int op) __attribute__((const));
/** Check if the op-code is a logic operator.
\param op The op-code to check.
\return True if the op-code is a logic operator.
*/
int is_logic (int op);
int is_logic (int op) __attribute__((const));
int has_function_call (expr_t *e);
int has_function_call (expr_t *e) __attribute__((pure));
int is_string_val (expr_t *e);
int is_float_val (expr_t *e);
int is_vector_val (expr_t *e);
int is_quaternion_val (expr_t *e);
int is_integer_val (expr_t *e);
int is_short_val (expr_t *e);
int is_string_val (expr_t *e) __attribute__((pure));
int is_float_val (expr_t *e) __attribute__((pure));
int is_vector_val (expr_t *e) __attribute__((pure));
int is_quaternion_val (expr_t *e) __attribute__((pure));
int is_integer_val (expr_t *e) __attribute__((pure));
int is_short_val (expr_t *e) __attribute__((pure));
/** Create a reference to the global <code>.self</code> entity variable.
@ -627,7 +627,7 @@ expr_t *think_expr (struct symbol_s *think_sym);
expr_t *assign_expr (expr_t *e1, expr_t *e2);
expr_t *cast_expr (struct type_s *t, expr_t *e);
const char *get_op_string (int op);
const char *get_op_string (int op) __attribute__((const));
struct keywordarg_s;
struct class_type_s;

View file

@ -107,7 +107,7 @@ extern pr_info_t pr;
#define POINTER_OFS(s,p) ((pr_type_t *) (p) - (s)->data)
const char *strip_path (const char *filename);
const char *strip_path (const char *filename) __attribute__((pure));
extern FILE *qc_yyin;
extern FILE *qp_yyin;

View file

@ -111,7 +111,7 @@ struct expr_s;
struct type_s;
struct dstring_s;
const char *optype_str (op_type_e type);
const char *optype_str (op_type_e type) __attribute__((const));
operand_t *def_operand (struct def_s *def, struct type_s *type);
operand_t *value_operand (struct ex_value_s *value);
@ -122,12 +122,12 @@ void free_operand (operand_t *op);
sblock_t *new_sblock (void);
statement_t *new_statement (st_type_t type, const char *opcode,
struct expr_s *expr);
int statement_is_cond (statement_t *s);
int statement_is_goto (statement_t *s);
int statement_is_jumpb (statement_t *s);
int statement_is_call (statement_t *s);
int statement_is_return (statement_t *s);
sblock_t *statement_get_target (statement_t *s);
int statement_is_cond (statement_t *s) __attribute__((pure));
int statement_is_goto (statement_t *s) __attribute__((pure));
int statement_is_jumpb (statement_t *s) __attribute__((pure));
int statement_is_call (statement_t *s) __attribute__((pure));
int statement_is_return (statement_t *s) __attribute__((pure));
sblock_t *statement_get_target (statement_t *s) __attribute__((pure));
sblock_t **statement_get_targetlist (statement_t *s);
void sblock_add_statement (sblock_t *sblock, statement_t *statement);
sblock_t *make_statements (struct expr_s *expr);

View file

@ -92,7 +92,7 @@ typedef struct symtab_s {
struct defspace_s *space; ///< storage for vars in scope symtabs
} symtab_t;
const char *symtype_str (sy_type_e type);
const char *symtype_str (sy_type_e type) __attribute__((const));
/** Create a new, empty named symbol.

View file

@ -123,7 +123,7 @@ extern struct symtab_s *quaternion_struct;
struct dstring_s;
etype_t low_level_type (type_t *type);
etype_t low_level_type (type_t *type) __attribute__((pure));
type_t *new_type (void);
void free_type (type_t *type);
void chain_type (type_t *type);
@ -150,17 +150,17 @@ void print_type (const type_t *type);
const char *encode_params (const type_t *type);
void encode_type (struct dstring_s *encoding, const type_t *type);
const char *type_get_encoding (const type_t *type);
int is_void (const type_t *type);
int is_enum (const type_t *type);
int is_integral (const type_t *type);
int is_float (const type_t *type);
int is_scalar (const type_t *type);
int is_math (const type_t *type);
int is_pointer (const type_t *type);
int is_struct (const type_t *type);
int is_array (const type_t *type);
int is_void (const type_t *type) __attribute__((pure));
int is_enum (const type_t *type) __attribute__((pure));
int is_integral (const type_t *type) __attribute__((pure));
int is_float (const type_t *type) __attribute__((pure));
int is_scalar (const type_t *type) __attribute__((pure));
int is_math (const type_t *type) __attribute__((pure));
int is_pointer (const type_t *type) __attribute__((pure));
int is_struct (const type_t *type) __attribute__((pure));
int is_array (const type_t *type) __attribute__((pure));
int type_assignable (const type_t *dst, const type_t *src);
int type_size (const type_t *type);
int type_size (const type_t *type) __attribute__((pure));
void init_types (void);
void chain_initial_types (void);

View file

@ -281,7 +281,7 @@ obj_classname (const type_t *type)
return str->str;
}
static int
static __attribute__((pure)) int
category_implements (category_t *cat, protocol_t *protocol)
{
for (; cat; cat = cat->next) {

View file

@ -60,7 +60,7 @@ cf_cast_expr (type_t *type, expr_t *e)
return e;
}
static int
static __attribute__((pure)) int
valid_op (int op, int *valid_ops)
{
while (*valid_ops && op != *valid_ops)

View file

@ -208,7 +208,7 @@ leaf_node (dag_t *dag, operand_t *op, expr_t *expr)
return node;
}
static dagnode_t *
static __attribute__((pure)) dagnode_t *
dag_node (operand_t *op)
{
def_t *def;

Some files were not shown because too many files have changed in this diff Show more