Skip to content

Commit

Permalink
hard-code NUM_TYPE_SIZES as 8 and move to progs.h.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Jul 30, 2024
1 parent f8e8957 commit e648a0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Quake/pr_edict.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int pr_edict_size; // in bytes

unsigned short pr_crc;

const int type_size[8] = {
const int type_size[NUM_TYPE_SIZES] = {
1, // ev_void
1, // sizeof(string_t) / 4 // ev_string
1, // ev_float
Expand All @@ -55,8 +55,6 @@ const int type_size[8] = {
1 // sizeof(void *) / 4 // ev_pointer
};

#define NUM_TYPE_SIZES (int)Q_COUNTOF(type_size)

static ddef_t *ED_FieldAtOfs (int ofs);
static qboolean ED_ParseEpair (void *base, ddef_t *key, const char *s);

Expand Down
3 changes: 2 additions & 1 deletion Quake/progs.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ int NUM_FOR_EDICT(edict_t*);
#define E_VECTOR(e,o) (&((float*)&e->v)[o])
#define E_STRING(e,o) (PR_GetString(*(string_t *)&((float*)&e->v)[o]))

extern const int type_size[8];
#define NUM_TYPE_SIZES 8
extern const int type_size[NUM_TYPE_SIZES];

typedef void (*builtin_t) (void);
extern const builtin_t *pr_builtins;
Expand Down

0 comments on commit e648a0d

Please sign in to comment.