gfxhook: Fix some clang-tidy warnings

This commit is contained in:
Felix Anderson 2021-12-21 23:54:29 -05:00 committed by Hay1tsme
parent 0702c306a6
commit db5b264155
8 changed files with 12 additions and 24 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,5 +3,5 @@
#include <windows.h>
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);

View File

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