gdk/win32: fix hr set but not used

A number of warnings are produced:

[23/1038] Compiling C object gdk/win32/libgdk-win32.a.p/gdkinput-dmanipulation.c.obj
../gdk/win32/gdkinput-dmanipulation.c: In function 'reset_viewport':
../gdk/win32/gdkinput-dmanipulation.c:354:11: warning: variable 'hr' set but not used [-Wunused-but-set-variable]
  354 |   HRESULT hr;
      |           ^~

Try to do something sensible instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2023-04-25 16:18:26 +04:00
parent d8ead56b9c
commit 5b69df96fe
2 changed files with 7 additions and 7 deletions

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

@ -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);