From cda6923ffad55bffe00743860e03f676101f749e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 17 Nov 2001 04:32:00 +0000 Subject: [PATCH] this seems to be all that's needed to make progs 64 bit clean (minus issues with sizeof (int) != 4, but that's not the case on alpha) --- libs/gamecode/engine/pr_edict.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libs/gamecode/engine/pr_edict.c b/libs/gamecode/engine/pr_edict.c index 6d30dad67..2a45aa0ad 100644 --- a/libs/gamecode/engine/pr_edict.c +++ b/libs/gamecode/engine/pr_edict.c @@ -1131,9 +1131,15 @@ PR_LoadProgsFile (progs_t * pr, const char *progsname) pr->pr_globals = (pr_type_t *) ((byte *) pr->progs + pr->progs->ofs_globals); - pr->pr_edict_size = - - pr->progs->entityfields * 4 + sizeof (edict_t) - sizeof (pr_type_t); + // size of edict ascked for by progs + pr->pr_edict_size = pr->progs->entityfields * 4; + // size of engine data + pr->pr_edict_size += sizeof (edict_t) - sizeof (pr_type_t); + // round off to next highest whole word address (esp for Alpha) + // this ensures that pointers in the engine data area are always + // properly aligned + pr->pr_edict_size += sizeof (void*) - 1; + pr->pr_edict_size &= ~(sizeof (void*) - 1); pr->pr_edictareasize = 0;