From: Omari Stephens Date: Fri, 23 Dec 2016 21:36:24 +0000 (+0000) Subject: Fix errors in -Werror (except GdkPixbuf deprecation warnings) X-Git-Tag: v1.4~235^2~3 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=a43d40845dcc2fb63c1ad6cae31b8b1ff5527701 Fix errors in -Werror (except GdkPixbuf deprecation warnings) With these changes, Geeqie compiles with ./configure CFLAGS="-Werror -Wno-error=deprecated-declarations" --- diff --git a/src/fullscreen.c b/src/fullscreen.c index 1c81edc8..f12d7418 100644 --- a/src/fullscreen.c +++ b/src/fullscreen.c @@ -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); } diff --git a/src/rcfile.c b/src/rcfile.c index ed61511c..bc4675c7 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -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 */ diff --git a/src/rcfile.h b/src/rcfile.h index 944e1d29..ae53e1ce 100644 --- a/src/rcfile.h +++ b/src/rcfile.h @@ -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_) diff --git a/src/view_file.c b/src/view_file.c index 9996622b..3f424ca1 100644 --- a/src/view_file.c +++ b/src/view_file.c @@ -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"