Fix errors in -Werror (except GdkPixbuf deprecation warnings)
authorOmari Stephens <xsdg@google.com>
Fri, 23 Dec 2016 21:36:24 +0000 (21:36 +0000)
committerOmari Stephens <xsdg@google.com>
Fri, 23 Dec 2016 22:10:41 +0000 (22:10 +0000)
With these changes, Geeqie compiles with
./configure CFLAGS="-Werror -Wno-error=deprecated-declarations"

src/fullscreen.c
src/rcfile.c
src/rcfile.h
src/view_file.c

index 1c81edc..f12d741 100644 (file)
@@ -364,7 +364,7 @@ void fullscreen_stop(FullScreenData *fs)
 
        gtk_widget_destroy(fs->window);
 
-       gtk_window_present(fs->normal_window);
+       gtk_window_present(GTK_WINDOW(fs->normal_window));
 
        g_free(fs);
 }
index ed61511..bc4675c 100644 (file)
@@ -157,6 +157,31 @@ gboolean read_int_option(const gchar *option, const gchar *label, const gchar *v
        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 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
                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 */
index 944e1d2..ae53e1c 100644 (file)
@@ -31,6 +31,8 @@ void write_color_option(GString *str, gint indent, gchar *label, GdkColor *color
 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 @@ gboolean read_bool_option(const gchar *option, const gchar *label, const gchar *
 #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_)
index 9996622..3f424ca 100644 (file)
@@ -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"