1
0
mirror of https://gitea.tendokyu.moe/Dniel97/segatools.git synced 2024-11-27 22:40:48 +01:00

gfxhook: Fix some clang-tidy warnings

This commit is contained in:
Felix 2021-12-21 23:54:29 -05:00
parent 494b3d684b
commit dc715baa55
No known key found for this signature in database
GPG Key ID: 69ADF8AEB6C8B5D1
8 changed files with 12 additions and 24 deletions

View File

@ -1,7 +1,6 @@
#include <windows.h> #include <windows.h>
#include <assert.h> #include <assert.h>
#include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include "gfxhook/config.h" #include "gfxhook/config.h"

View File

@ -3,13 +3,11 @@
#include <d3d11.h> #include <d3d11.h>
#include <assert.h> #include <assert.h>
#include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include "gfxhook/gfx.h" #include "gfxhook/gfx.h"
#include "gfxhook/util.h" #include "gfxhook/util.h"
#include "hook/com-proxy.h"
#include "hook/table.h" #include "hook/table.h"
#include "hooklib/dll.h" #include "hooklib/dll.h"
@ -157,8 +155,8 @@ HRESULT WINAPI D3D11CreateDeviceAndSwapChain(
{ {
DXGI_SWAP_CHAIN_DESC *desc; DXGI_SWAP_CHAIN_DESC *desc;
HWND hwnd; HWND hwnd;
LONG width; UINT width;
LONG height; UINT height;
dprintf("D3D11: D3D11CreateDeviceAndSwapChain hook hit\n"); dprintf("D3D11: D3D11CreateDeviceAndSwapChain hook hit\n");
@ -172,8 +170,6 @@ HRESULT WINAPI D3D11CreateDeviceAndSwapChain(
height = desc->BufferDesc.Height; height = desc->BufferDesc.Height;
} else { } else {
hwnd = NULL; hwnd = NULL;
width = 0;
height = 0;
} }
if (hwnd != NULL) { if (hwnd != NULL) {

View File

@ -2,7 +2,6 @@
#include <d3d9.h> #include <d3d9.h>
#include <assert.h> #include <assert.h>
#include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include "hook/com-proxy.h" #include "hook/com-proxy.h"
@ -10,7 +9,6 @@
#include "hooklib/dll.h" #include "hooklib/dll.h"
#include "gfxhook/config.h"
#include "gfxhook/gfx.h" #include "gfxhook/gfx.h"
#include "gfxhook/util.h" #include "gfxhook/util.h"
@ -103,8 +101,6 @@ fail:
if (d3d9 != NULL) { if (d3d9 != NULL) {
FreeLibrary(d3d9); FreeLibrary(d3d9);
} }
return;
} }
IDirect3D9 * WINAPI Direct3DCreate9(UINT sdk_ver) IDirect3D9 * WINAPI Direct3DCreate9(UINT sdk_ver)

View File

@ -284,8 +284,8 @@ static HRESULT STDMETHODCALLTYPE my_IDXGIFactory_CreateSwapChain(
struct com_proxy *proxy; struct com_proxy *proxy;
IDXGIFactory *real; IDXGIFactory *real;
HWND hwnd; HWND hwnd;
LONG width; UINT width;
LONG height; UINT height;
dprintf("DXGI: IDXGIFactory::CreateSwapChain hook hit\n"); dprintf("DXGI: IDXGIFactory::CreateSwapChain hook hit\n");
@ -300,8 +300,6 @@ static HRESULT STDMETHODCALLTYPE my_IDXGIFactory_CreateSwapChain(
height = desc->BufferDesc.Height; height = desc->BufferDesc.Height;
} else { } else {
hwnd = NULL; hwnd = NULL;
width = 0;
height = 0;
} }
if (hwnd != NULL) { if (hwnd != NULL) {
@ -323,8 +321,8 @@ static HRESULT STDMETHODCALLTYPE my_IDXGIFactory_CreateSwapChain(
HWND_TOP, HWND_TOP,
0, 0,
0, 0,
width, (int) width,
height, (int) height,
SWP_FRAMECHANGED | SWP_NOSENDCHANGING); SWP_FRAMECHANGED | SWP_NOSENDCHANGING);
ShowWindow(hwnd, SW_SHOWMAXIMIZED); ShowWindow(hwnd, SW_SHOWMAXIMIZED);

View File

@ -1,7 +1,6 @@
#include <windows.h> #include <windows.h>
#include <assert.h> #include <assert.h>
#include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include "gfxhook/config.h" #include "gfxhook/config.h"

View File

@ -1,7 +1,5 @@
#include <windows.h> #include <windows.h>
#include <stdbool.h>
#include "gfxhook/util.h" #include "gfxhook/util.h"
#include "util/dprintf.h" #include "util/dprintf.h"
@ -16,7 +14,7 @@ void gfx_util_ensure_win_visible(HWND hwnd)
ShowWindow(hwnd, SW_RESTORE); ShowWindow(hwnd, SW_RESTORE);
} }
void gfx_util_borderless_fullscreen_windowed(HWND hwnd, LONG width, LONG height) void gfx_util_borderless_fullscreen_windowed(HWND hwnd, UINT width, UINT height)
{ {
BOOL ok; BOOL ok;
HRESULT hr; HRESULT hr;
@ -31,8 +29,8 @@ void gfx_util_borderless_fullscreen_windowed(HWND hwnd, LONG width, LONG height)
HWND_TOP, HWND_TOP,
0, 0,
0, 0,
width, (int) width,
height, (int) height,
SWP_FRAMECHANGED | SWP_NOSENDCHANGING); SWP_FRAMECHANGED | SWP_NOSENDCHANGING);
if (!ok) { if (!ok) {

View File

@ -3,5 +3,5 @@
#include <windows.h> #include <windows.h>
void gfx_util_ensure_win_visible(HWND hwnd); void gfx_util_ensure_win_visible(HWND hwnd);
void gfx_util_borderless_fullscreen_windowed(HWND hwnd, LONG width, LONG height); void gfx_util_borderless_fullscreen_windowed(HWND hwnd, UINT width, UINT height);
HRESULT gfx_util_frame_window(HWND hwnd); HRESULT gfx_util_frame_window(HWND hwnd);

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
#include <windows.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>