From 5f6108052e24fbf4a309ae5c315278b992d76ede Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 2 Jan 2005 14:52:11 +0000 Subject: Changed "sizeof x" to "sizeof(x)" for consistency with the rest of ScummVM, and used ARRAYSIZE() instead in two cases. svn-id: r16408 --- saga/font.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'saga/font.cpp') diff --git a/saga/font.cpp b/saga/font.cpp index cc65e53757..9814540d8c 100644 --- a/saga/font.cpp +++ b/saga/font.cpp @@ -47,7 +47,7 @@ Font::Font(SagaEngine *vm) : _vm(vm), _initialized(false) { assert(_nFonts > 0); - _fonts = (FONT **)malloc(_nFonts * sizeof *_fonts); + _fonts = (FONT **)malloc(_nFonts * sizeof(*_fonts)); if (_fonts == NULL) { error("Font::Font(): Memory allocation failure."); } @@ -109,7 +109,7 @@ int Font::loadFont(uint32 font_rn, int font_id) { MemoryReadStreamEndian readS(fontres_p, fontres_len, IS_BIG_ENDIAN); // Create new font structure - font = (FONT *)malloc(sizeof *font); + font = (FONT *)malloc(sizeof(*font)); if (font == NULL) { error("Font:loadFont(): Memory allocation error."); return MEM; @@ -127,7 +127,7 @@ int Font::loadFont(uint32 font_rn, int font_id) { debug(2, "Row padding: %d", fh.row_length); // Create normal font style - normal_font = (FONT_STYLE *)malloc(sizeof *normal_font); + normal_font = (FONT_STYLE *)malloc(sizeof(*normal_font)); if (normal_font == NULL) { error("Font::loadFont(): Memory allocation error."); free(font); @@ -215,14 +215,14 @@ FONT_STYLE *Font::createOutline(FONT_STYLE *src_font) { unsigned char c_rep; // Create new font style structure - new_font = (FONT_STYLE *)malloc(sizeof *new_font); + new_font = (FONT_STYLE *)malloc(sizeof(*new_font)); if (new_font == NULL) { error("Font::createOutline(): Memory allocation error."); return NULL; } - memset(new_font, 0, sizeof *new_font); + memset(new_font, 0, sizeof(*new_font)); // Populate new font style character data for (i = 0; i < FONT_CHARCOUNT; i++) { -- cgit v1.2.3