From 1afbdaff58ac2b45ebf1ea046ff5a4d79b98be74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sun, 21 Feb 2016 21:54:19 +0100 Subject: [PATCH] Fix compilation warnings. (libs part) --- libs/clearlooks-newer/animation.c | 2 +- libs/clearlooks-newer/clearlooks_draw.c | 8 ++++---- .../clearlooks-newer/clearlooks_draw_glossy.c | 8 ++++---- libs/clearlooks-newer/clearlooks_draw_gummy.c | 8 ++++---- libs/clearlooks-newer/clearlooks_style.c | 10 +++++----- libs/clearlooks-newer/clearlooks_theme_main.c | 20 ++++++++++++++----- libs/clearlooks-newer/widget-information.c | 2 +- libs/clearlooks-newer/widget-information.h | 2 +- libs/gtkmm2ext/cairocell.cc | 4 ++++ 9 files changed, 39 insertions(+), 25 deletions(-) diff --git a/libs/clearlooks-newer/animation.c b/libs/clearlooks-newer/animation.c index 9fd530f201..f9b5ba5dca 100644 --- a/libs/clearlooks-newer/animation.c +++ b/libs/clearlooks-newer/animation.c @@ -128,7 +128,7 @@ lookup_animation_info (const GtkWidget *widget) /* Create all the relevant information for the animation, and insert it into the hash table. */ static void -add_animation (const GtkWidget *widget, gdouble stop_time) +add_animation (GtkWidget *widget, gdouble stop_time) { AnimationInfo *value; diff --git a/libs/clearlooks-newer/clearlooks_draw.c b/libs/clearlooks-newer/clearlooks_draw.c index bf01a002a4..502d2e7786 100644 --- a/libs/clearlooks-newer/clearlooks_draw.c +++ b/libs/clearlooks-newer/clearlooks_draw.c @@ -2010,12 +2010,12 @@ clearlooks_draw_radiobutton (cairo_t *cr, cairo_pattern_t *pt; gboolean inconsistent; - gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN); + gboolean draw_bullet = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_IN); (void) width; (void) height; - inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN); + inconsistent = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_ETCHED_IN); draw_bullet |= inconsistent; if (widget->disabled) @@ -2095,9 +2095,9 @@ clearlooks_draw_checkbox (cairo_t *cr, const CairoColor *border; const CairoColor *dot; gboolean inconsistent = FALSE; - gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN); + gboolean draw_bullet = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_IN); - inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN); + inconsistent = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_ETCHED_IN); draw_bullet |= inconsistent; if (widget->disabled) diff --git a/libs/clearlooks-newer/clearlooks_draw_glossy.c b/libs/clearlooks-newer/clearlooks_draw_glossy.c index cf3c96a451..26b239f6a6 100644 --- a/libs/clearlooks-newer/clearlooks_draw_glossy.c +++ b/libs/clearlooks-newer/clearlooks_draw_glossy.c @@ -1241,12 +1241,12 @@ clearlooks_glossy_draw_radiobutton (cairo_t *cr, CairoColor highlight; cairo_pattern_t *pt; gboolean inconsistent; - gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN); + gboolean draw_bullet = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_IN); (void) width; (void) height; - inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN); + inconsistent = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_ETCHED_IN); draw_bullet |= inconsistent; if (widget->disabled) @@ -1332,9 +1332,9 @@ clearlooks_glossy_draw_checkbox (cairo_t *cr, const CairoColor *border; const CairoColor *dot; gboolean inconsistent = FALSE; - gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN); + gboolean draw_bullet = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_IN); - inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN); + inconsistent = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_ETCHED_IN); draw_bullet |= inconsistent; if (widget->disabled) diff --git a/libs/clearlooks-newer/clearlooks_draw_gummy.c b/libs/clearlooks-newer/clearlooks_draw_gummy.c index 97aca7eeac..caba5202d5 100644 --- a/libs/clearlooks-newer/clearlooks_draw_gummy.c +++ b/libs/clearlooks-newer/clearlooks_draw_gummy.c @@ -1340,12 +1340,12 @@ clearlooks_gummy_draw_radiobutton (cairo_t *cr, CairoColor highlight; cairo_pattern_t *pt; gboolean inconsistent; - gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN); + gboolean draw_bullet = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_IN); (void) width; (void) height; - inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN); + inconsistent = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_ETCHED_IN); draw_bullet |= inconsistent; if (widget->disabled) @@ -1431,9 +1431,9 @@ clearlooks_gummy_draw_checkbox (cairo_t *cr, const CairoColor *border; const CairoColor *dot; gboolean inconsistent = FALSE; - gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN); + gboolean draw_bullet = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_IN); - inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN); + inconsistent = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_ETCHED_IN); draw_bullet |= inconsistent; if (widget->disabled) diff --git a/libs/clearlooks-newer/clearlooks_style.c b/libs/clearlooks-newer/clearlooks_style.c index b1257f4878..fb0ca33239 100644 --- a/libs/clearlooks-newer/clearlooks_style.c +++ b/libs/clearlooks-newer/clearlooks_style.c @@ -56,7 +56,7 @@ static ClearlooksStyleClass *clearlooks_style_class; static GtkStyleClass *clearlooks_parent_class; static void -clearlooks_set_widget_parameters (const GtkWidget *widget, +clearlooks_set_widget_parameters (GtkWidget *widget, const GtkStyle *style, GtkStateType state_type, WidgetParameters *params) @@ -709,9 +709,9 @@ clearlooks_style_draw_box (DRAW_ARGS) if (!params.ltr) { - if (progressbar.orientation == GTK_PROGRESS_LEFT_TO_RIGHT) + if (progressbar.orientation == (ClearlooksOrientation)GTK_PROGRESS_LEFT_TO_RIGHT) progressbar.orientation = GTK_PROGRESS_RIGHT_TO_LEFT; - else if (progressbar.orientation == GTK_PROGRESS_RIGHT_TO_LEFT) + else if (progressbar.orientation == (ClearlooksOrientation)GTK_PROGRESS_RIGHT_TO_LEFT) progressbar.orientation = GTK_PROGRESS_LEFT_TO_RIGHT; } @@ -738,8 +738,8 @@ clearlooks_style_draw_box (DRAW_ARGS) } else { - if (progressbar.orientation == GTK_PROGRESS_RIGHT_TO_LEFT || - progressbar.orientation == GTK_PROGRESS_LEFT_TO_RIGHT) + if (progressbar.orientation == (ClearlooksOrientation)GTK_PROGRESS_RIGHT_TO_LEFT || + progressbar.orientation == (ClearlooksOrientation)GTK_PROGRESS_LEFT_TO_RIGHT) { tmp.x -= 1; tmp.width += 2; diff --git a/libs/clearlooks-newer/clearlooks_theme_main.c b/libs/clearlooks-newer/clearlooks_theme_main.c index e4c35b413c..ae856278e7 100644 --- a/libs/clearlooks-newer/clearlooks_theme_main.c +++ b/libs/clearlooks-newer/clearlooks_theme_main.c @@ -4,11 +4,21 @@ #include "clearlooks_style.h" #include "clearlooks_rc_style.h" +/* declare those three functions first to avoid warnings using gcc */ GE_EXPORT void -theme_init (GTypeModule *module) +theme_init (GTypeModule* module); + +GE_EXPORT void +theme_exit (void); + +GE_EXPORT GtkRcStyle* +theme_create_rc_style (void); + +GE_EXPORT void +theme_init (GTypeModule* module) { - clearlooks_rc_style_register_type (module); - clearlooks_style_register_type (module); + clearlooks_rc_style_register_type (module); + clearlooks_style_register_type (module); } GE_EXPORT void @@ -16,8 +26,8 @@ theme_exit (void) { } -GE_EXPORT GtkRcStyle * +GE_EXPORT GtkRcStyle* theme_create_rc_style (void) { - return GTK_RC_STYLE (g_object_new (CLEARLOOKS_TYPE_RC_STYLE, NULL)); + return GTK_RC_STYLE (g_object_new (CLEARLOOKS_TYPE_RC_STYLE, NULL)); } diff --git a/libs/clearlooks-newer/widget-information.c b/libs/clearlooks-newer/widget-information.c index 1a4fe31039..41a3c5a3aa 100644 --- a/libs/clearlooks-newer/widget-information.c +++ b/libs/clearlooks-newer/widget-information.c @@ -11,7 +11,7 @@ Smooth-Engine. */ gboolean -ge_object_is_a (const GObject * object, const gchar * type_name) +ge_object_is_a (GObject * object, const gchar * type_name) { gboolean result = FALSE; diff --git a/libs/clearlooks-newer/widget-information.h b/libs/clearlooks-newer/widget-information.h index a6dd807a37..75be4c8980 100644 --- a/libs/clearlooks-newer/widget-information.h +++ b/libs/clearlooks-newer/widget-information.h @@ -73,7 +73,7 @@ #define GE_WIDGET_HAS_DEFAULT(object) ((object) && GE_IS_WIDGET(object) && GTK_WIDGET_HAS_DEFAULT(object)) -GE_INTERNAL gboolean ge_object_is_a (const GObject * object, const gchar * type_name); +GE_INTERNAL gboolean ge_object_is_a (GObject * object, const gchar * type_name); GE_INTERNAL gboolean ge_is_combo_box_entry (GtkWidget * widget); GE_INTERNAL gboolean ge_is_combo_box (GtkWidget * widget, gboolean as_list); diff --git a/libs/gtkmm2ext/cairocell.cc b/libs/gtkmm2ext/cairocell.cc index 4de898c832..7ce77355b6 100644 --- a/libs/gtkmm2ext/cairocell.cc +++ b/libs/gtkmm2ext/cairocell.cc @@ -79,6 +79,10 @@ CairoFontDescription::CairoFontDescription (Pango::FontDescription& fd) _weight = Cairo::FONT_WEIGHT_BOLD; break; + /* to silence warnings when compiling with newer pango versions. */ + default: + _weight = Cairo::FONT_WEIGHT_NORMAL; + break; } face = fd.get_family();