[Scummvm-git-logs] scummvm master -> d78459f8bc95bea82d5205c0dee07ecfb8425ea1
digitall
dgturner at iee.org
Sat Aug 17 06:05:41 CEST 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d78459f8bc GUI: Fix GCC Compiler Warnings in GUI Theme Parser Code
Commit: d78459f8bc95bea82d5205c0dee07ecfb8425ea1
https://github.com/scummvm/scummvm/commit/d78459f8bc95bea82d5205c0dee07ecfb8425ea1
Author: D G Turner (digitall at scummvm.org)
Date: 2019-08-17T05:03:04+01:00
Commit Message:
GUI: Fix GCC Compiler Warnings in GUI Theme Parser Code
This removes the usage of memset to clear complex structures and replaces
them with constructor methods for the structures which will be executed
when these are instantiated.
Changed paths:
graphics/VectorRenderer.h
gui/ThemeParser.cpp
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index 7863820..c2f7b40 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -50,6 +50,8 @@ struct DrawStep {
struct Color {
uint8 r, g, b;
bool set;
+
+ Color () : r(0), g(0), b(0), set(false) {}
};
Color fgColor; /**< Foreground color */
Color bgColor; /**< background color */
@@ -85,6 +87,23 @@ struct DrawStep {
uint32 scale; /**< scale of all the coordinates in FIXED POINT with 16 bits mantissa */
GUI::ThemeEngine::AutoScaleMode autoscale; /**< scale alphaimage if present */
+
+ DrawStep() {
+ drawingCall = nullptr;
+ blitSrc = nullptr;
+ blitAlphaSrc = nullptr;
+ // fgColor, bgColor, gradColor1, gradColor2, bevelColor initialized by Color default constructor
+ autoWidth = autoHeight = false;
+ x = y = w = h = 0;
+ // padding initialized by Common::Rect default constructor
+ xAlign = yAlign = kVectorAlignManual;
+ shadow = stroke = factor = radius = bevel = 0;
+ fillMode = 0;
+ shadowFillMode = 0;
+ extraData = 0;
+ scale = 0;
+ autoscale = GUI::ThemeEngine::kAutoScaleNone;
+ }
};
VectorRenderer *createRenderer(int mode);
diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp
index bf62bcc..a52e359 100644
--- a/gui/ThemeParser.cpp
+++ b/gui/ThemeParser.cpp
@@ -126,8 +126,6 @@ void ThemeParser::cleanup() {
Graphics::DrawStep *ThemeParser::defaultDrawStep() {
Graphics::DrawStep *step = new Graphics::DrawStep;
- memset(step, 0, sizeof(Graphics::DrawStep));
-
step->xAlign = Graphics::DrawStep::kVectorAlignManual;
step->yAlign = Graphics::DrawStep::kVectorAlignManual;
step->factor = 1;
More information about the Scummvm-git-logs
mailing list