From 3f172805f4fb05f2ae4e723febb6d743004b10ad Mon Sep 17 00:00:00 2001 From: Duilio Protti Date: Sun, 14 Feb 2016 11:08:00 -0300 Subject: [PATCH] Remove GCC warnings --- src/config-dialog.c | 1 + src/cputest.c | 10 +++++----- src/gettext.h | 2 ++ src/infconfig.c | 9 +++------ src/main.c | 1 + src/renderer.c | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/config-dialog.c b/src/config-dialog.c index 87c8f3d..341266d 100644 --- a/src/config-dialog.c +++ b/src/config-dialog.c @@ -1,5 +1,6 @@ #include "config.h" #include "config-dialog.h" +#include "infconfig.h" #include "gettext.h" diff --git a/src/cputest.c b/src/cputest.c index a1acf95..5d1c5f5 100644 --- a/src/cputest.c +++ b/src/cputest.c @@ -138,17 +138,17 @@ int mm_support_check_and_show() } msg = g_strdup("Infinity: Looking for Multimedia Extensions Support..."); if (r & MM_MMX) { - tmp = g_strconcat(msg, " MMX", 0); + tmp = g_strconcat(msg, " MMX", NULL); g_free(msg); msg = tmp; } if (r & MM_3DNOW) { - tmp = g_strconcat(msg, " 3DNOW", 0); + tmp = g_strconcat(msg, " 3DNOW", NULL); g_free(msg); msg = tmp; } if (r & MM_MMXEXT) { - tmp = g_strconcat(msg, " MMX2", 0); + tmp = g_strconcat(msg, " MMX2", NULL); g_free(msg); msg = tmp; } @@ -165,10 +165,10 @@ int mm_support_check_and_show() * msg = tmp; * } */ - tmp = g_strconcat(msg, " detected", 0); + tmp = g_strconcat(msg, " detected", NULL); g_free(msg); msg = tmp; - g_message(msg); + g_message("%s", msg); g_free(msg); return r; diff --git a/src/gettext.h b/src/gettext.h index cefe3d1..1618cf7 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -69,6 +69,8 @@ * initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String +#ifndef _ #define _(String) (gettext(String)) +#endif #endif /* _LIBGETTEXT_H */ diff --git a/src/infconfig.c b/src/infconfig.c index 5bc354a..7f900c4 100644 --- a/src/infconfig.c +++ b/src/infconfig.c @@ -8,9 +8,7 @@ #include "gettext.h" #include "config-dialog.h" -//#define DEFAULT_WIDTH 500 #define DEFAULT_WIDTH 512 -//#define DEFAULT_HEIGHT 375 #define DEFAULT_HEIGHT 288 #define DEFAULT_TIME_EFFECT 100 #define DEFAULT_TIME_PALETTE 100 @@ -201,13 +199,12 @@ static void connect_callbacks(ConfigDialog *configure_dialog) void config_plugin_load_prefs(void) { gint value; - //gboolean bvalue; GKeyFile *kf; gchar *config_file_path; gboolean error, must_update, config_file_usable; kf = g_key_file_new(); - config_file_path = g_strconcat(g_get_home_dir(), INFINITY_CONFIG_FILE, 0); + config_file_path = g_strconcat(g_get_home_dir(), INFINITY_CONFIG_FILE, NULL); config_file_usable = g_key_file_load_from_file(kf, config_file_path, G_KEY_FILE_KEEP_COMMENTS, NULL); error = must_update = FALSE; if (config_file_usable) { @@ -275,8 +272,8 @@ void config_plugin_save_prefs(void) gsize length; kf = g_key_file_new(); - config_dir_path = g_strconcat(g_get_home_dir(), INFINITY_CONFIG_DIR, 0); - config_file_path = g_strconcat(g_get_home_dir(), INFINITY_CONFIG_FILE, 0); + config_dir_path = g_strconcat(g_get_home_dir(), INFINITY_CONFIG_DIR, NULL); + config_file_path = g_strconcat(g_get_home_dir(), INFINITY_CONFIG_FILE, NULL); ok = g_key_file_load_from_file(kf, config_file_path, G_KEY_FILE_KEEP_COMMENTS, NULL); if (!ok) { g_message(_("Infinity plugin .ini file not found")); diff --git a/src/main.c b/src/main.c index 1560151..9bc83a5 100644 --- a/src/main.c +++ b/src/main.c @@ -26,6 +26,7 @@ #include #include "config.h" +#include "gettext.h" #include "infconfig.h" #include "renderer.h" diff --git a/src/renderer.c b/src/renderer.c index 2be7f3d..30e4a48 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -359,7 +359,7 @@ static void check_events() if (t_last_color > 32) { t_last_color = 0; old_color = color; - color = ++color % NB_PALETTES; + color = (color + 1) % NB_PALETTES; } break; case SDLK_SPACE: