Skip to content

Commit

Permalink
linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
apple1417 committed Sep 21, 2023
1 parent 54357ac commit f3adbe5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace pluginloader::console {

void create_if_needed(void) {
std::string args{GetCommandLineA()};
const std::string args{GetCommandLineA()};
if (args.find("--debug") == std::string::npos) {
return;
}
Expand Down
2 changes: 2 additions & 0 deletions src/loader.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef LOADER_H
#define LOADER_H

#include "pch.h"

namespace pluginloader::loader {

/**
Expand Down
4 changes: 2 additions & 2 deletions src/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <Windows.h>
#include <windows.h>

#include <TlHelp32.h>
#include <tlhelp32.h>

#ifdef __cplusplus

Expand Down
4 changes: 2 additions & 2 deletions src/proxy/d3d11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ DLL_EXPORT HRESULT D3D11CreateDeviceAndSwapChain(void* adapt,

void init(HMODULE /*this_dll*/) {
// Suspend all other threads to prevent a giant race condition
util::ThreadSuspender suspender{};
const util::ThreadSuspender suspender{};

wchar_t buf[MAX_PATH];
if (GetSystemDirectoryW(&buf[0], ARRAYSIZE(buf)) == 0) {
std::cerr << "[dhf] Unable to find system dll directory! We're probably about to crash.\n";
return;
}

auto system_dx11 = std::filesystem::path{buf} / "d3d11.dll";
auto system_dx11 = std::filesystem::path{static_cast<wchar_t*>(buf)} / "d3d11.dll";
dx11_dll_handle = LoadLibraryA(system_dx11.generic_string().c_str());

d3d11_core_create_device_ptr = GetProcAddress(dx11_dll_handle, "D3D11CoreCreateDevice");
Expand Down
2 changes: 1 addition & 1 deletion src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace pluginloader::util {

std::string format_win_error(DWORD err) {
LPSTR buf = nullptr;
size_t size = FormatMessageA(
const size_t size = FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
nullptr, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast<LPSTR>(&buf), 0,
nullptr);
Expand Down
2 changes: 2 additions & 0 deletions src/util.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef UTIL_H
#define UTIL_H

#include "pch.h"

namespace pluginloader::util {

/**
Expand Down

0 comments on commit f3adbe5

Please sign in to comment.