diff options
author | Simon Howard | 2008-09-26 16:27:32 +0000 |
---|---|---|
committer | Simon Howard | 2008-09-26 16:27:32 +0000 |
commit | af2add1cbef05bf05fe6a59f84975caabe0779c0 (patch) | |
tree | c71a9f147e4d4603f0a798a3700669f381dd0731 | |
parent | 717ca7f67c77b09c9fc6f36936fbc6bdc4ff8e98 (diff) | |
download | chocolate-doom-af2add1cbef05bf05fe6a59f84975caabe0779c0.tar.gz chocolate-doom-af2add1cbef05bf05fe6a59f84975caabe0779c0.tar.bz2 chocolate-doom-af2add1cbef05bf05fe6a59f84975caabe0779c0.zip |
Use sizeof for size of types, rather than hard-coding the size.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1289
-rw-r--r-- | src/heretic/p_setup.c | 2 | ||||
-rw-r--r-- | src/heretic/r_data.c | 24 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/heretic/p_setup.c b/src/heretic/p_setup.c index b1a4f2ce..11e3ad95 100644 --- a/src/heretic/p_setup.c +++ b/src/heretic/p_setup.c @@ -484,7 +484,7 @@ void P_GroupLines(void) } // build line tables for each sector - linebuffer = Z_Malloc(total * 4, PU_LEVEL, 0); + linebuffer = Z_Malloc(total * sizeof(linebuffer_t *), PU_LEVEL, 0); sector = sectors; for (i = 0; i < numsectors; i++, sector++) { diff --git a/src/heretic/r_data.c b/src/heretic/r_data.c index ebd89018..6e65abdd 100644 --- a/src/heretic/r_data.c +++ b/src/heretic/r_data.c @@ -360,13 +360,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(texture_t *), PU_STATIC, 0); + texturecolumnlump = Z_Malloc(numtextures * sizeof(short *), PU_STATIC, 0); + texturecolumnofs = Z_Malloc(numtextures * sizeof(unsigned short *), PU_STATIC, 0); + texturecomposite = Z_Malloc(numtextures * sizeof(byte *), PU_STATIC, 0); + texturecompositesize = Z_Malloc(numtextures * sizeof(int), PU_STATIC, 0); + texturewidthmask = Z_Malloc(numtextures * sizeof(int), PU_STATIC, 0); + textureheight = Z_Malloc(numtextures * sizeof(fixed_t), PU_STATIC, 0); totalwidth = 0; @@ -438,7 +438,7 @@ void R_InitTextures(void) // // translation table for global animation // - texturetranslation = Z_Malloc((numtextures + 1) * 4, PU_STATIC, 0); + texturetranslation = Z_Malloc((numtextures + 1) * sizeof(int), PU_STATIC, 0); for (i = 0; i < numtextures; i++) texturetranslation[i] = i; } @@ -461,7 +461,7 @@ void R_InitFlats(void) numflats = lastflat - firstflat + 1; // translation table for global animation - flattranslation = Z_Malloc((numflats + 1) * 4, PU_STATIC, 0); + flattranslation = Z_Malloc((numflats + 1) * sizeof(int), PU_STATIC, 0); for (i = 0; i < numflats; i++) flattranslation[i] = i; } @@ -485,9 +485,9 @@ void R_InitSpriteLumps(void) firstspritelump = W_GetNumForName("S_START") + 1; lastspritelump = W_GetNumForName("S_END") - 1; numspritelumps = lastspritelump - firstspritelump + 1; - spritewidth = Z_Malloc(numspritelumps * 4, PU_STATIC, 0); - spriteoffset = Z_Malloc(numspritelumps * 4, PU_STATIC, 0); - spritetopoffset = Z_Malloc(numspritelumps * 4, PU_STATIC, 0); + spritewidth = Z_Malloc(numspritelumps * sizeof(fixed_t), PU_STATIC, 0); + spriteoffset = Z_Malloc(numspritelumps * sizeof(fixed_t), PU_STATIC, 0); + spritetopoffset = Z_Malloc(numspritelumps * sizeof(fixed_t), PU_STATIC, 0); for (i = 0; i < numspritelumps; i++) { |