constified pr_builtins and pr_numbuiltins

This commit is contained in:
Ozkan Sezer 2022-04-27 17:00:02 +03:00
parent 22dbb40b82
commit e50415c8ff
2 changed files with 10 additions and 12 deletions

View file

@ -1705,7 +1705,7 @@ static void PF_walkpathtogoal (void)
{ {
G_FLOAT(OFS_RETURN) = 0; /* PATH_ERROR */ G_FLOAT(OFS_RETURN) = 0; /* PATH_ERROR */
} }
void PF_localsound (void) static void PF_localsound (void)
{ {
const char *sample; const char *sample;
int entnum; int entnum;
@ -1834,6 +1834,5 @@ static builtin_t pr_builtin[] =
PF_Fixme, PF_Fixme,
}; };
builtin_t *pr_builtins = pr_builtin; const builtin_t *pr_builtins = pr_builtin;
int pr_numbuiltins = sizeof(pr_builtin)/sizeof(pr_builtin[0]); const int pr_numbuiltins = sizeof(pr_builtin) / sizeof(pr_builtin[0]);

View file

@ -20,8 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef _QUAKE_PROGS_H #ifndef QUAKE_PROGS_H
#define _QUAKE_PROGS_H #define QUAKE_PROGS_H
#include "pr_comp.h" /* defs shared with qcc */ #include "pr_comp.h" /* defs shared with qcc */
#include "progdefs.h" /* generated by program cdefs */ #include "progdefs.h" /* generated by program cdefs */
@ -95,8 +95,8 @@ void ED_LoadFromFile (const char *data);
#define EDICT_NUM(n) ((edict_t *)(sv.edicts+ (n)*pr_edict_size)) #define EDICT_NUM(n) ((edict_t *)(sv.edicts+ (n)*pr_edict_size))
#define NUM_FOR_EDICT(e) (((byte *)(e) - sv.edicts) / pr_edict_size) #define NUM_FOR_EDICT(e) (((byte *)(e) - sv.edicts) / pr_edict_size)
*/ */
edict_t *EDICT_NUM(int n); edict_t *EDICT_NUM(int);
int NUM_FOR_EDICT(edict_t *e); int NUM_FOR_EDICT(edict_t*);
#define NEXT_EDICT(e) ((edict_t *)( (byte *)e + pr_edict_size)) #define NEXT_EDICT(e) ((edict_t *)( (byte *)e + pr_edict_size))
@ -119,8 +119,8 @@ int NUM_FOR_EDICT(edict_t *e);
extern int type_size[8]; extern int type_size[8];
typedef void (*builtin_t) (void); typedef void (*builtin_t) (void);
extern builtin_t *pr_builtins; extern const builtin_t *pr_builtins;
extern int pr_numbuiltins; extern const int pr_numbuiltins;
/* for 2021 re-release */ /* for 2021 re-release */
typedef struct { typedef struct {
@ -147,5 +147,4 @@ void ED_PrintNum (int ent);
eval_t *GetEdictFieldValue(edict_t *ed, const char *field); eval_t *GetEdictFieldValue(edict_t *ed, const char *field);
#endif /* _QUAKE_PROGS_H */ #endif /* QUAKE_PROGS_H */