summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte.benjamin@googlemail.com>2019-05-21 14:39:53 +0000
committerBenjamin Otte <otte.benjamin@googlemail.com>2019-05-21 14:39:53 +0000
commit9f739ab135c4976752555a1a582771dbee5b16cb (patch)
treeacabea6bb80233cb3f416a068ba48486153fce6a
parent799e9214dd4709f4bda2ca6075ee9268bddf4d40 (diff)
parente197752afe9f64ce4207ad74c0df6480b7524024 (diff)
downloadgtk+-9f739ab135c4976752555a1a582771dbee5b16cb.tar.gz
Merge branch 'win32-enable-werror' into 'master'
Win32 enable werror See merge request GNOME/gtk!861
-rw-r--r--.gitlab-ci/test-msys2.sh7
-rw-r--r--gdk/win32/gdkdrag-win32.c2
-rw-r--r--gdk/win32/gdkmonitor-win32.c14
-rw-r--r--gdk/win32/gdksurface-win32.c2
-rw-r--r--gtk/gtkimcontextime.c4
-rw-r--r--gtk/gtkmain.c11
-rw-r--r--gtk/gtkprintoperation-win32.c1
-rw-r--r--gtk/gtkwindow.c7
-rw-r--r--tests/rendernode.c2
-rw-r--r--tests/showrendernode.c2
10 files changed, 17 insertions, 35 deletions
diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2.sh
index 3abaf9d083..05624265f4 100644
--- a/.gitlab-ci/test-msys2.sh
+++ b/.gitlab-ci/test-msys2.sh
@@ -42,10 +42,11 @@ ccache --zero-stats
ccache --show-stats
export CCACHE_DISABLE=true
meson \
- -Denable-x11-backend=false \
- -Denable-wayland-backend=false \
- -Denable-win32-backend=true \
+ -Dx11-backend=false \
+ -Dwayland-backend=false \
+ -Dwin32-backend=true \
-Dvulkan=no \
+ --werror \
_build
unset CCACHE_DISABLE
diff --git a/gdk/win32/gdkdrag-win32.c b/gdk/win32/gdkdrag-win32.c
index 318013c2d9..9d486e1543 100644
--- a/gdk/win32/gdkdrag-win32.c
+++ b/gdk/win32/gdkdrag-win32.c
@@ -1733,7 +1733,7 @@ _gdk_win32_surface_drag_begin (GdkSurface *surface,
GDK_NOTE (DND, g_print ("_gdk_win32_surface_drag_begin\n"));
- gdk_device_get_position (device, &px, &px);
+ gdk_device_get_position (device, &px, &py);
x_root = round (px) + dx;
y_root = round (py) + dy;
diff --git a/gdk/win32/gdkmonitor-win32.c b/gdk/win32/gdkmonitor-win32.c
index 108e5083ed..e631dc5a7e 100644
--- a/gdk/win32/gdkmonitor-win32.c
+++ b/gdk/win32/gdkmonitor-win32.c
@@ -144,20 +144,6 @@ typedef LONG
#define MONITORINFOF_PRIMARY 1
#endif
-/* MinGW-w64 does not have a prototype for function in its headers
- * at the moment of writing.
- */
-#if !defined (HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W)
-BOOL WINAPI SetupDiGetDevicePropertyW (HDEVINFO DeviceInfoSet,
- PSP_DEVINFO_DATA DeviceInfoData,
- const DEVPROPKEY *PropertyKey,
- DEVPROPTYPE *PropertyType,
- PBYTE PropertyBuffer,
- DWORD PropertyBufferSize,
- PDWORD RequiredSize,
- DWORD Flags);
-#endif
-
#define G_GUID_FORMAT "%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X"
#define g_format_guid(guid) (guid)->Data1, \
(guid)->Data2, \
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index 93deebb41c..a1157b33fb 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -55,7 +55,6 @@ static void gdk_surface_impl_win32_finalize (GObject *object);
static gpointer parent_class = NULL;
static GSList *modal_window_stack = NULL;
-static const cairo_user_data_key_t gdk_win32_cairo_key;
typedef struct _FullscreenInfo FullscreenInfo;
struct _FullscreenInfo
@@ -746,7 +745,6 @@ gdk_win32_surface_destroy (GdkSurface *window,
gboolean foreign_destroy)
{
GdkSurfaceImplWin32 *surface_impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
- GSList *tmp;
g_return_if_fail (GDK_IS_SURFACE (window));
diff --git a/gtk/gtkimcontextime.c b/gtk/gtkimcontextime.c
index e18795c89e..1814e7b30b 100644
--- a/gtk/gtkimcontextime.c
+++ b/gtk/gtkimcontextime.c
@@ -664,7 +664,6 @@ gtk_im_context_ime_focus_in (GtkIMContext *context)
{
GtkIMContextIME *context_ime = GTK_IM_CONTEXT_IME (context);
GdkSurface *toplevel;
- GtkWidget *widget = NULL;
HWND hwnd;
HIMC himc;
@@ -721,7 +720,6 @@ gtk_im_context_ime_focus_out (GtkIMContext *context)
{
GtkIMContextIME *context_ime = GTK_IM_CONTEXT_IME (context);
GdkSurface *toplevel;
- GtkWidget *widget = NULL;
HWND hwnd;
HIMC himc;
@@ -881,7 +879,7 @@ gtk_im_context_ime_set_preedit_font (GtkIMContext *context)
widget = gtk_root_get_for_surface (context_ime->client_surface);
if (!widget)
- return
+ return;
hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface);
himc = ImmGetContext (hwnd);
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 22513d95c3..4dce1cd7e7 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -419,7 +419,6 @@ enum_locale_proc (LPTSTR locale)
SUBLANGID (LANGIDFROMLCID (lcid)) == SUBLANG_DEFAULT)))
{
char language[100], country[100];
- char locale[300];
if (script_to_check != NULL)
{
@@ -467,11 +466,13 @@ enum_locale_proc (LPTSTR locale)
if (GetLocaleInfo (lcid, LOCALE_SENGLANGUAGE, language, sizeof (language)) &&
GetLocaleInfo (lcid, LOCALE_SENGCOUNTRY, country, sizeof (country)))
{
- strcpy (locale, language);
- strcat (locale, "_");
- strcat (locale, country);
+ char str[300];
- if (setlocale (LC_ALL, locale) != NULL)
+ strcpy (str, language);
+ strcat (str, "_");
+ strcat (str, country);
+
+ if (setlocale (LC_ALL, str) != NULL)
setlocale_called = TRUE;
}
diff --git a/gtk/gtkprintoperation-win32.c b/gtk/gtkprintoperation-win32.c
index 4f21c1f17f..ed6dfd797f 100644
--- a/gtk/gtkprintoperation-win32.c
+++ b/gtk/gtkprintoperation-win32.c
@@ -1211,6 +1211,7 @@ dialog_from_print_settings (GtkPrintOperation *op,
switch (print_pages)
{
default:
+ case GTK_PRINT_PAGES_SELECTION:
case GTK_PRINT_PAGES_ALL:
printdlgex->Flags |= PD_ALLPAGES;
break;
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index fa65a9933d..44b6b8f7ec 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -8446,7 +8446,6 @@ gtk_window_set_display (GtkWindow *window,
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GtkWidget *widget;
- GdkDisplay *previous_display;
gboolean was_mapped;
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -8460,8 +8459,6 @@ gtk_window_set_display (GtkWindow *window,
widget = GTK_WIDGET (window);
- previous_display = priv->display;
-
was_mapped = _gtk_widget_get_mapped (widget);
if (was_mapped)
@@ -8473,14 +8470,14 @@ gtk_window_set_display (GtkWindow *window,
gtk_window_set_transient_for (window, NULL);
gtk_window_free_key_hash (window);
- priv->display = display;
#ifdef GDK_WINDOWING_X11
- g_signal_handlers_disconnect_by_func (gtk_settings_get_for_display (previous_display),
+ g_signal_handlers_disconnect_by_func (gtk_settings_get_for_display (priv->display),
gtk_window_on_theme_variant_changed, window);
g_signal_connect (gtk_settings_get_for_display (display),
"notify::gtk-application-prefer-dark-theme",
G_CALLBACK (gtk_window_on_theme_variant_changed), window);
#endif
+ priv->display = display;
gtk_widget_unroot (widget);
gtk_widget_root (widget);
diff --git a/tests/rendernode.c b/tests/rendernode.c
index 4d69693c65..49a6c8601c 100644
--- a/tests/rendernode.c
+++ b/tests/rendernode.c
@@ -22,7 +22,7 @@ deserialize_error_func (const GtkCssSection *section,
g_warning ("Error at %s: %s", section_str, error->message);
- free (section_str);
+ g_free (section_str);
}
diff --git a/tests/showrendernode.c b/tests/showrendernode.c
index bd1e502cd9..c05988c07d 100644
--- a/tests/showrendernode.c
+++ b/tests/showrendernode.c
@@ -117,7 +117,7 @@ deserialize_error_func (const GtkCssSection *section,
g_warning ("Error at %s: %s", section_str, error->message);
- free (section_str);
+ g_free (section_str);
}
int