From c1261a5b7489c20ec5178012137f41df1fadc2ff Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 22 Feb 2015 02:42:08 -0800 Subject: [PATCH] GBA: Remove struct partial initialization for structs that are initialized later --- src/platform/commandline.c | 1 + src/platform/perf-main.c | 2 +- src/platform/qt/GBAApp.cpp | 2 +- src/platform/sdl/main.c | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/platform/commandline.c b/src/platform/commandline.c index 90e00c96e..bee0a608b 100644 --- a/src/platform/commandline.c +++ b/src/platform/commandline.c @@ -60,6 +60,7 @@ bool parseArguments(struct GBAArguments* opts, struct GBAConfig* config, int arg "g" #endif ; + memset(opts, 0, sizeof(*opts)); if (subparser && subparser->extraOptions) { // TODO: modularize options to subparsers strncat(options, subparser->extraOptions, sizeof(options) - strlen(options) - 1); diff --git a/src/platform/perf-main.c b/src/platform/perf-main.c index 7929f9c0c..e22e513de 100644 --- a/src/platform/perf-main.c +++ b/src/platform/perf-main.c @@ -61,7 +61,7 @@ int main(int argc, char** argv) { }; GBAConfigLoadDefaults(&config, &opts); - struct GBAArguments args = {}; + struct GBAArguments args; if (!parseArguments(&args, &config, argc, argv, &subparser)) { usage(argv[0], PERF_USAGE); freeArguments(&args); diff --git a/src/platform/qt/GBAApp.cpp b/src/platform/qt/GBAApp.cpp index e11315b17..6605d91aa 100644 --- a/src/platform/qt/GBAApp.cpp +++ b/src/platform/qt/GBAApp.cpp @@ -31,7 +31,7 @@ GBAApp::GBAApp(int& argc, char* argv[]) m_window.show(); #endif - GBAArguments args = {}; + GBAArguments args; if (m_configController.parseArguments(&args, argc, argv)) { m_window.argumentsPassed(&args); } else { diff --git a/src/platform/sdl/main.c b/src/platform/sdl/main.c index 31cede4d5..441cc23b8 100644 --- a/src/platform/sdl/main.c +++ b/src/platform/sdl/main.c @@ -52,8 +52,8 @@ int main(int argc, char** argv) { }; GBAConfigLoadDefaults(&config, &opts); - struct GBAArguments args = {}; - struct GraphicsOpts graphicsOpts = {}; + struct GBAArguments args; + struct GraphicsOpts graphicsOpts; struct SubParser subparser;