Merge branch 'win32-warnings' into 'main'

Fix some win32 warnings

See merge request GNOME/gtk!5868
This commit is contained in:
Matthias Clasen 2023-04-26 06:58:09 +00:00
commit 045ab0f107
6 changed files with 12 additions and 34 deletions

View File

@ -2546,13 +2546,11 @@ transmute_cf_shell_id_list_to_text_uri_list (const guchar *data,
ILFree (file_id_full);
}
*set_data = (guchar *) result->str;
if (set_data_length)
*set_data_length = result->len;
*set_data = (guchar *) g_string_free (result, FALSE);
if (set_data_destroy)
*set_data_destroy = g_free;
g_string_free (result, FALSE);
}
void

View File

@ -37,8 +37,6 @@
#include <math.h>
#include <string.h>
#define GDK_NOTE(a,b)
/*
* Support for OLE-2 drag and drop added at Archaeopteryx Software, 2001
* For more information, do not contact Stephan R.A. Deibel (sdeibel@archaeopteryx.com),

View File

@ -354,12 +354,13 @@ reset_viewport (IDirectManipulationViewport *viewport)
HRESULT hr;
hr = IDirectManipulationViewport_GetPrimaryContent (viewport, iid, (void**)&content);
HR_CHECK (hr);
HR_CHECK_GOTO (hr, failed);
hr = IDirectManipulationContent_SyncContentTransform (content, identity,
G_N_ELEMENTS (identity));
HR_CHECK (hr);
HR_CHECK_GOTO (hr, failed);
failed:
IUnknown_Release (content);
}
@ -384,7 +385,7 @@ create_viewport (GdkSurface *surface,
{
DIRECTMANIPULATION_CONFIGURATION configuration = 0;
HWND hwnd = GDK_SURFACE_HWND (surface);
IDirectManipulationViewportEventHandler *handler;
IDirectManipulationViewportEventHandler *handler = NULL;
DWORD cookie = 0;
HRESULT hr;
@ -500,7 +501,7 @@ void gdk_dmanipulation_initialize_surface (GdkSurface *surface)
hr = IDirectManipulationManager_Activate (dmanipulation_manager,
GDK_SURFACE_HWND (surface));
HR_CHECK (hr);
HR_CHECK_RETURN (hr);
}
void gdk_dmanipulation_finalize_surface (GdkSurface *surface)
@ -536,11 +537,11 @@ void gdk_dmanipulation_maybe_add_contact (GdkSurface *surface,
hr = IDirectManipulationViewport_SetContact (surface_win32->dmanipulation_viewport_pan,
pointer_id);
HR_CHECK (hr);
HR_CHECK_RETURN (hr);
hr = IDirectManipulationViewport_SetContact (surface_win32->dmanipulation_viewport_zoom,
pointer_id);
HR_CHECK (hr);
HR_CHECK_RETURN (hr);
}
}

View File

@ -109,16 +109,6 @@ gdk_win32_ensure_com (void)
return co_initialized;
}
static void
gdk_win32_finalize_com (void)
{
if (co_initialized)
{
CoUninitialize ();
co_initialized = FALSE;
}
}
gboolean
gdk_win32_ensure_ole (void)
{
@ -142,16 +132,6 @@ gdk_win32_ensure_ole (void)
return ole_initialized;
}
static void
gdk_win32_finalize_ole (void)
{
if (ole_initialized)
{
OleUninitialize ();
ole_initialized = FALSE;
}
}
void
_gdk_win32_api_failed (const char *where,
const char *api)

View File

@ -276,7 +276,6 @@ void _gdk_other_api_failed (const char *where,
#define HR_CHECK_RETURN(hr) { if G_UNLIKELY (FAILED (hr)) return; }
#define HR_CHECK_RETURN_VAL(hr, val) { if G_UNLIKELY (FAILED (hr)) return val; }
#define HR_CHECK(hr)
#define HR_CHECK_GOTO(hr, label) { if G_UNLIKELY (FAILED (hr)) goto label; }
extern LRESULT CALLBACK _gdk_win32_surface_procedure (HWND, UINT, WPARAM, LPARAM);

View File

@ -38,7 +38,7 @@
#include "gdk/win32/gdkwin32.h"
#include "gtk/gtkimmodule.h"
#include "gtk/deprecated/gtkstylecontextprivate.h"
#include "gtk/gtkcssstyleprivate.h"
#include "gtkwidgetprivate.h"
/* avoid warning */
#ifdef STRICT
@ -728,6 +728,7 @@ gtk_im_context_ime_set_preedit_font (GtkIMContext *context)
PangoFont *font;
LOGFONT *logfont;
PangoFontDescription *font_desc;
GtkCssStyle *style;
g_return_if_fail (GTK_IS_IM_CONTEXT_IME (context));
@ -777,7 +778,8 @@ gtk_im_context_ime_set_preedit_font (GtkIMContext *context)
lang = ""; break;
}
font_desc = gtk_css_style_get_pango_font (gtk_style_context_lookup_style (gtk_widget_get_style_context (context_ime->client_widget)));
style = gtk_css_node_get_style (gtk_widget_get_css_node (context_ime->client_widget));
font_desc = gtk_css_style_get_pango_font (style);
if (lang[0])
{