From 460c192e67d9ad0b512811fdb90e98a1a0eba83d Mon Sep 17 00:00:00 2001 From: D G Turner Date: Mon, 30 Sep 2019 02:51:19 +0100 Subject: DEVTOOLS: Fix GCC Compiler Warning in convbdf Tool --- devtools/convbdf.cpp | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'devtools') diff --git a/devtools/convbdf.cpp b/devtools/convbdf.cpp index 31fdbd0010..f12d4c1216 100644 --- a/devtools/convbdf.cpp +++ b/devtools/convbdf.cpp @@ -35,6 +35,17 @@ struct BdfBoundingBox { int width, height; int xOffset, yOffset; + + void reset() { + width = 0; + height = 0; + xOffset = 0; + yOffset = 0; + } + + BdfBoundingBox() { + reset(); + } }; struct BdfFont { @@ -54,7 +65,26 @@ struct BdfFont { unsigned char *advances; BdfBoundingBox *boxes; - BdfFont() : bitmaps(0), advances(0), boxes(0), familyName(0), slant(0) { + void reset() { + familyName = 0; + slant = 0; + maxAdvance = 0; + size = 0; + height = 0; + defaultBox.reset(); + ascent = 0; + + firstCharacter = 0; + defaultCharacter = 0; + numCharacters = 0; + + bitmaps = 0; + advances = 0; + boxes = 0; + } + + BdfFont() { + reset(); } ~BdfFont() { @@ -131,7 +161,6 @@ int main(int argc, char *argv[]) { std::string fontName; std::string copyright; BdfFont font; - memset(&font, 0, sizeof(font)); font.ascent = -1; font.defaultCharacter = -1; -- cgit v1.2.3