From a2f426f36f2ce45815d120fd4f43828fb6fd2093 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 20 Mar 2005 23:10:14 +0000 Subject: [PATCH] Silence gcc warnings (unused variables, unhandled enum value in switch). 2005-03-21 Tor Lillqvist * modules/engines/ms-windows/*.c: Silence gcc warnings (unused variables, unhandled enum value in switch). Use g_object_unref() instead of deprecated gdk_gc_unref() and gdk_drawable_unref(). * modules/engines/ms-windows/xp_theme.c (xp_theme_map_gtk_state): Add missing "case" keyword. * modules/engines/ms-windows/Makefile.am: Link with -lgdi32 explicitly. --- ChangeLog | 12 ++++++++++++ ChangeLog.pre-2-10 | 12 ++++++++++++ ChangeLog.pre-2-8 | 12 ++++++++++++ modules/engines/ms-windows/Makefile.am | 2 +- modules/engines/ms-windows/msw_style.c | 9 +++++---- modules/engines/ms-windows/msw_theme_main.c | 1 + modules/engines/ms-windows/xp_theme.c | 7 +++++-- 7 files changed, 48 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f3bcea67f..1ee323a1ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-03-21 Tor Lillqvist + + * modules/engines/ms-windows/*.c: Silence gcc warnings (unused + variables, unhandled enum value in switch). Use g_object_unref() + instead of deprecated gdk_gc_unref() and gdk_drawable_unref(). + + * modules/engines/ms-windows/xp_theme.c (xp_theme_map_gtk_state): + Add missing "case" keyword. + + * modules/engines/ms-windows/Makefile.am: Link with -lgdi32 + explicitly. + 2005-03-20 Tor Lillqvist * gdk/win32/gdkdisplay-win32.c (gdk_display_get_name): Return the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0f3bcea67f..1ee323a1ee 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +2005-03-21 Tor Lillqvist + + * modules/engines/ms-windows/*.c: Silence gcc warnings (unused + variables, unhandled enum value in switch). Use g_object_unref() + instead of deprecated gdk_gc_unref() and gdk_drawable_unref(). + + * modules/engines/ms-windows/xp_theme.c (xp_theme_map_gtk_state): + Add missing "case" keyword. + + * modules/engines/ms-windows/Makefile.am: Link with -lgdi32 + explicitly. + 2005-03-20 Tor Lillqvist * gdk/win32/gdkdisplay-win32.c (gdk_display_get_name): Return the diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0f3bcea67f..1ee323a1ee 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +2005-03-21 Tor Lillqvist + + * modules/engines/ms-windows/*.c: Silence gcc warnings (unused + variables, unhandled enum value in switch). Use g_object_unref() + instead of deprecated gdk_gc_unref() and gdk_drawable_unref(). + + * modules/engines/ms-windows/xp_theme.c (xp_theme_map_gtk_state): + Add missing "case" keyword. + + * modules/engines/ms-windows/Makefile.am: Link with -lgdi32 + explicitly. + 2005-03-20 Tor Lillqvist * gdk/win32/gdkdisplay-win32.c (gdk_display_get_name): Return the diff --git a/modules/engines/ms-windows/Makefile.am b/modules/engines/ms-windows/Makefile.am index b440753fea..c862b49a0a 100644 --- a/modules/engines/ms-windows/Makefile.am +++ b/modules/engines/ms-windows/Makefile.am @@ -34,4 +34,4 @@ libwimp_la_SOURCES = \ libwimp_la_LDFLAGS = \ -avoid-version -module -no-undefined -export-dynamic -libwimp_la_LIBADD = $(LDADDS) +libwimp_la_LIBADD = $(LDADDS) -lgdi32 diff --git a/modules/engines/ms-windows/msw_style.c b/modules/engines/ms-windows/msw_style.c index 34c88326b8..e268c52a0c 100755 --- a/modules/engines/ms-windows/msw_style.c +++ b/modules/engines/ms-windows/msw_style.c @@ -565,8 +565,6 @@ setup_msw_rc_style(void) GdkColor base_prelight; GdkColor text_prelight; - NONCLIENTMETRICS nc; - /* Prelight */ sys_color_to_gtk_color(XP_THEME_CLASS_TEXT, COLOR_HIGHLIGHTTEXT, &fg_prelight); sys_color_to_gtk_color(XP_THEME_CLASS_TEXT, COLOR_HIGHLIGHT, &bg_prelight); @@ -974,6 +972,9 @@ draw_expander(GtkStyle *style, (window, style->fg_gc[state], x + expander_semi_size, y + 2, x + expander_semi_size, y + expander_size - 2); break; + + default: + break; } if (success) @@ -1509,8 +1510,8 @@ draw_box (GtkStyle *style, gdk_draw_rectangle (window, gc, TRUE, x, y, width, height); - gdk_gc_unref (gc); - gdk_drawable_unref (pixmap); + g_object_unref (gc); + g_object_unref (pixmap); return; } diff --git a/modules/engines/ms-windows/msw_theme_main.c b/modules/engines/ms-windows/msw_theme_main.c index 858f506ae0..5eb846a8ac 100755 --- a/modules/engines/ms-windows/msw_theme_main.c +++ b/modules/engines/ms-windows/msw_theme_main.c @@ -28,6 +28,7 @@ #include "msw_style.h" #include "msw_rc_style.h" +#include "xp_theme.h" #ifndef WM_THEMECHANGED #define WM_THEMECHANGED 0x031A /* winxp only */ diff --git a/modules/engines/ms-windows/xp_theme.c b/modules/engines/ms-windows/xp_theme.c index 9ba01a8129..1a06870702 100755 --- a/modules/engines/ms-windows/xp_theme.c +++ b/modules/engines/ms-windows/xp_theme.c @@ -310,6 +310,9 @@ xp_theme_get_handle_by_element (XpThemeElement element) case XP_THEME_ELEMENT_TREEVIEW_EXPANDER_CLOSED: klazz = XP_THEME_CLASS_TREEVIEW; break; + + default: + break; } if (klazz != XP_THEME_CLASS__SIZEOF) @@ -537,7 +540,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state) } break; - XP_THEME_ELEMENT_DEFAULT_BUTTON: + case XP_THEME_ELEMENT_DEFAULT_BUTTON: switch(state) { case GTK_STATE_ACTIVE: @@ -643,7 +646,7 @@ xp_theme_draw (GdkWindow *win, XpThemeElement element, GtkStyle *style, { HTHEME theme; RECT rect, clip, *pClip; - int xoff, yoff, state; + int xoff, yoff; HDC dc; GdkDrawable *drawable; int part_state;