changeset 2413:8e9d5cf1edcb

Fix errors in -Werror (except GdkPixbuf deprecation warnings) With these changes, Geeqie compiles with ./configure CFLAGS="-Werror -Wno-error=deprecated-declarations"
author Omari Stephens <xsdg@google.com>
date Fri, 23 Dec 2016 21:36:24 +0000
parents eb6d9ba8a759
children f62b9c25d89f
files src/fullscreen.c src/rcfile.c src/rcfile.h src/view_file.c
diffstat 4 files changed, 39 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/fullscreen.c	Sun Dec 04 09:33:33 2016 +0100
+++ b/src/fullscreen.c	Fri Dec 23 21:36:24 2016 +0000
@@ -364,7 +364,7 @@
 
 	gtk_widget_destroy(fs->window);
 
-	gtk_window_present(fs->normal_window);
+	gtk_window_present(GTK_WINDOW(fs->normal_window));
 
 	g_free(fs);
 }
--- a/src/rcfile.c	Sun Dec 04 09:33:33 2016 +0100
+++ b/src/rcfile.c	Fri Dec 23 21:36:24 2016 +0000
@@ -157,6 +157,31 @@
 	return TRUE;
 }
 
+void write_ushort_option(GString *str, gint indent, const gchar *label, guint16 n)
+{
+	g_string_append_printf(str, "%s = \"%uh\" ", label, n);
+}
+
+gboolean read_ushort_option(const gchar *option, const gchar *label, const gchar *value, guint16 *n)
+{
+	if (g_ascii_strcasecmp(option, label) != 0) return FALSE;
+	if (!n) return FALSE;
+
+	if (g_ascii_isdigit(value[0]))
+		{
+		*n = strtoul(value, NULL, 10);
+		}
+	else
+		{
+		if (g_ascii_strcasecmp(value, "true") == 0)
+			*n = 1;
+		else
+			*n = 0;
+		}
+
+	return TRUE;
+}
+
 void write_uint_option(GString *str, gint indent, const gchar *label, guint n)
 {
 	g_string_append_printf(str, "%s = \"%u\" ", label, n);
@@ -642,14 +667,14 @@
 		if (READ_CHAR(*options, image_overlay.template_string)) continue;
 		if (READ_INT(*options, image_overlay.x)) continue;
 		if (READ_INT(*options, image_overlay.y)) continue;
-		if (READ_INT(*options, image_overlay.text_red)) continue;
-		if (READ_INT(*options, image_overlay.text_green)) continue;
-		if (READ_INT(*options, image_overlay.text_blue)) continue;
-		if (READ_INT(*options, image_overlay.text_alpha)) continue;
-		if (READ_INT(*options, image_overlay.background_red)) continue;
-		if (READ_INT(*options, image_overlay.background_green)) continue;
-		if (READ_INT(*options, image_overlay.background_blue)) continue;
-		if (READ_INT(*options, image_overlay.background_alpha)) continue;
+		if (READ_USHORT(*options, image_overlay.text_red)) continue;
+		if (READ_USHORT(*options, image_overlay.text_green)) continue;
+		if (READ_USHORT(*options, image_overlay.text_blue)) continue;
+		if (READ_USHORT(*options, image_overlay.text_alpha)) continue;
+		if (READ_USHORT(*options, image_overlay.background_red)) continue;
+		if (READ_USHORT(*options, image_overlay.background_green)) continue;
+		if (READ_USHORT(*options, image_overlay.background_blue)) continue;
+		if (READ_USHORT(*options, image_overlay.background_alpha)) continue;
 		if (READ_CHAR(*options, image_overlay.font)) continue;
 
 		/* Slideshow options */
--- a/src/rcfile.h	Sun Dec 04 09:33:33 2016 +0100
+++ b/src/rcfile.h	Fri Dec 23 21:36:24 2016 +0000
@@ -31,6 +31,8 @@
 gboolean read_color_option(const gchar *option, const gchar *label, const gchar *value, GdkColor *color);
 void write_int_option(GString *str, gint indent, const gchar *label, gint n);
 gboolean read_int_option(const gchar *option, const gchar *label, const gchar *value, gint *n);
+void write_ushort_option(GString *str, gint indent, const gchar *label, guint16 n);
+gboolean read_ushort_option(const gchar *option, const gchar *label, const gchar *value, guint16 *n);
 void write_uint_option(GString *str, gint indent, const gchar *label, guint n);
 gboolean read_uint_option(const gchar *option, const gchar *label, const gchar *value, guint *n);
 gboolean read_uint_option_clamp(const gchar *option, const gchar *label, const gchar *value, guint *n, guint min, guint max);
@@ -54,6 +56,7 @@
 #define READ_BOOL(_target_, _name_) read_bool_option(option, #_name_, value, &(_target_)._name_)
 #define READ_INT(_target_, _name_) read_int_option(option, #_name_, value, &(_target_)._name_)
 #define READ_UINT(_target_, _name_) read_uint_option(option, #_name_, value, &(_target_)._name_)
+#define READ_USHORT(_target_, _name_) read_ushort_option(option, #_name_, value, &(_target_)._name_)
 #define READ_INT_CLAMP(_target_, _name_, _min_, _max_) read_int_option_clamp(option, #_name_, value, &(_target_)._name_, _min_, _max_)
 #define READ_UINT_CLAMP(_target_, _name_, _min_, _max_) read_uint_option_clamp(option, #_name_, value, &(_target_)._name_, _min_, _max_)
 #define READ_INT_UNIT(_target_, _name_, _unit_) read_int_unit_option(option, #_name_, value, &(_target_)._name_, _unit_)
--- a/src/view_file.c	Sun Dec 04 09:33:33 2016 +0100
+++ b/src/view_file.c	Fri Dec 23 21:36:24 2016 +0000
@@ -21,6 +21,8 @@
 #include "main.h"
 #include "view_file.h"
 
+#include "collect.h"
+#include "collect-table.h"
 #include "editors.h"
 #include "layout.h"
 #include "menu.h"