From bc3128f82b675f9b0fae03d5fe0783c570d7f288 Mon Sep 17 00:00:00 2001 From: Dan Olson Date: Sun, 20 Mar 2011 01:17:09 -0700 Subject: [PATCH] Some 64-bit fixes --- base/r_data.c | 16 ++++++++-------- base/r_draw.c | 2 +- include/doomdata.h | 2 +- include/doomdef.h | 2 ++ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/base/r_data.c b/base/r_data.c index 2cd5d4e..6c7b94c 100644 --- a/base/r_data.c +++ b/base/r_data.c @@ -312,13 +312,13 @@ void R_InitTextures (void) InitThermo(spramount + numtextures + 6); } - textures = Z_Malloc (numtextures*4, PU_STATIC, 0); - texturecolumnlump = Z_Malloc (numtextures*4, PU_STATIC, 0); - texturecolumnofs = Z_Malloc (numtextures*4, PU_STATIC, 0); - texturecomposite = Z_Malloc (numtextures*4, PU_STATIC, 0); - texturecompositesize = Z_Malloc (numtextures*4, PU_STATIC, 0); - texturewidthmask = Z_Malloc (numtextures*4, PU_STATIC, 0); - textureheight = Z_Malloc (numtextures*4, PU_STATIC, 0); + textures = Z_Malloc (numtextures*sizeof(*textures), PU_STATIC, 0); + texturecolumnlump = Z_Malloc (numtextures*sizeof(*texturecolumnlump), PU_STATIC, 0); + texturecolumnofs = Z_Malloc (numtextures*sizeof(*texturecolumnofs), PU_STATIC, 0); + texturecomposite = Z_Malloc (numtextures*sizeof(*texturecomposite), PU_STATIC, 0); + texturecompositesize = Z_Malloc (numtextures*sizeof(*texturecompositesize), PU_STATIC, 0); + texturewidthmask = Z_Malloc (numtextures*sizeof(*texturewidthmask), PU_STATIC, 0); + textureheight = Z_Malloc (numtextures*sizeof(*textureheight), PU_STATIC, 0); totalwidth = 0; @@ -471,7 +471,7 @@ void R_InitColormaps (void) lump = W_GetNumForName("COLORMAP"); length = W_LumpLength (lump) + 255; colormaps = Z_Malloc (length, PU_STATIC, 0); - colormaps = (byte *)( ((int)colormaps + 255)&~0xff); + colormaps = (byte *)( ((intptr_t)colormaps + 255)&~0xff); W_ReadLump (lump,colormaps); } diff --git a/base/r_draw.c b/base/r_draw.c index cd66567..3039ab9 100644 --- a/base/r_draw.c +++ b/base/r_draw.c @@ -242,7 +242,7 @@ void R_InitTranslationTables (void) // Allocate translation tables translationtables = Z_Malloc(256*3+255, PU_STATIC, 0); - translationtables = (byte *)(( (int)translationtables + 255 )& ~255); + translationtables = (byte *)(( (intptr_t)translationtables + 255 )& ~255); // Fill out the translation tables for(i = 0; i < 256; i++) diff --git a/include/doomdata.h b/include/doomdata.h index 967c7ef..77010a4 100644 --- a/include/doomdata.h +++ b/include/doomdata.h @@ -133,7 +133,7 @@ typedef struct boolean masked; short width; short height; - void **columndirectory; // OBSOLETE + int columndirectory; // OBSOLETE short patchcount; mappatch_t patches[1]; } maptexture_t; diff --git a/include/doomdef.h b/include/doomdef.h index 4053014..3c47f44 100644 --- a/include/doomdef.h +++ b/include/doomdef.h @@ -11,6 +11,8 @@ #define strncasecmp strnicmp #endif +#include + #include "config.h" #define VERSION 130 -- 2.39.2