Merge pull request #14330 from oltolm/static

Misc: fix compiler warning: implicit declaration of function
This commit is contained in:
JosJuice authored and GitHub committed 2026-02-08 20:58:39 +01:00
commit ebc8c9d857
7 files changed
+41 -40

No files matched your search

+1 -1
View File
@@ -124,7 +124,7 @@ private:
PIMAGE_DATA_DIRECTORY directories; PIMAGE_DATA_DIRECTORY directories;
}; };
void CompatPatchesInstall(LdrWatcher* watcher) static void CompatPatchesInstall(LdrWatcher* watcher)
{ {
watcher->Install({{L"EZFRD64.dll", L"811EZFRD64.DLL"}, [](const LdrDllLoadEvent& event) { watcher->Install({{L"EZFRD64.dll", L"811EZFRD64.DLL"}, [](const LdrDllLoadEvent& event) {
// *EZFRD64 is included in software packages for cheapo third-party gamepads // *EZFRD64 is included in software packages for cheapo third-party gamepads
+3 -3
View File
@@ -12,7 +12,7 @@
namespace Win32TAPHelper namespace Win32TAPHelper
{ {
bool IsTAPDevice(const TCHAR* guid) static bool IsTAPDevice(const TCHAR* guid)
{ {
HKEY netcard_key; HKEY netcard_key;
LONG status; LONG status;
@@ -88,7 +88,7 @@ bool IsTAPDevice(const TCHAR* guid)
return false; return false;
} }
bool GetGUIDs(std::vector<std::basic_string<TCHAR>>& guids) static bool GetGUIDs(std::vector<std::basic_string<TCHAR>>& guids)
{ {
LONG status; LONG status;
HKEY control_net_key; HKEY control_net_key;
@@ -155,7 +155,7 @@ bool GetGUIDs(std::vector<std::basic_string<TCHAR>>& guids)
return !guids.empty(); return !guids.empty();
} }
bool OpenTAP(HANDLE& adapter, const std::basic_string<TCHAR>& device_guid) static bool OpenTAP(HANDLE& adapter, const std::basic_string<TCHAR>& device_guid)
{ {
auto const device_path = USERMODEDEVICEDIR + device_guid + TAPSUFFIX; auto const device_path = USERMODEDEVICEDIR + device_guid + TAPSUFFIX;
+8 -7
View File
@@ -69,8 +69,9 @@ enum class AuthenticationMethod : bool
// BluetoothAuthenticateDeviceEx requires a bunch of rigmarole.. maybe some other day. // BluetoothAuthenticateDeviceEx requires a bunch of rigmarole.. maybe some other day.
#pragma warning(push) #pragma warning(push)
#pragma warning(disable : 4995) #pragma warning(disable : 4995)
bool AuthenticateWiimote(HANDLE radio_handle, const BLUETOOTH_RADIO_INFO& radio_info, static bool AuthenticateWiimote(HANDLE radio_handle, const BLUETOOTH_RADIO_INFO& radio_info,
BLUETOOTH_DEVICE_INFO_STRUCT* btdi, AuthenticationMethod auth_method) BLUETOOTH_DEVICE_INFO_STRUCT* btdi,
AuthenticationMethod auth_method)
{ {
// When pressing the sync button, the remote expects the host's address as the pass key. // When pressing the sync button, the remote expects the host's address as the pass key.
// When pressing 1+2 it expects its own address. // When pressing 1+2 it expects its own address.
@@ -106,7 +107,7 @@ bool AuthenticateWiimote(HANDLE radio_handle, const BLUETOOTH_RADIO_INFO& radio_
} }
#pragma warning(pop) #pragma warning(pop)
std::optional<USBUtils::DeviceInfo> GetDeviceInfo(const WCHAR* hid_iface) static std::optional<USBUtils::DeviceInfo> GetDeviceInfo(const WCHAR* hid_iface)
{ {
// libusb opens without read/write access to get attributes, so we'll do that too. // libusb opens without read/write access to get attributes, so we'll do that too.
constexpr auto open_access = 0; constexpr auto open_access = 0;
@@ -296,15 +297,15 @@ u32 RemoveWiimoteBluetoothDevices(std::invocable<BLUETOOTH_DEVICE_INFO> auto&& s
// If they are *not* authenticated there's apparently no feasible way to reconnect them. // If they are *not* authenticated there's apparently no feasible way to reconnect them.
// We remove these problematic remembered devices so we can reconnect them. // We remove these problematic remembered devices so we can reconnect them.
// Otherwise, the user would need to manually deleting the device in control panel. // Otherwise, the user would need to manually deleting the device in control panel.
u32 RemoveUnusableWiimoteBluetoothDevices() static u32 RemoveUnusableWiimoteBluetoothDevices()
{ {
return RemoveWiimoteBluetoothDevices([](const BLUETOOTH_DEVICE_INFO& btdi) { return RemoveWiimoteBluetoothDevices([](const BLUETOOTH_DEVICE_INFO& btdi) {
return btdi.fRemembered && !btdi.fConnected && !btdi.fAuthenticated; return btdi.fRemembered && !btdi.fConnected && !btdi.fAuthenticated;
}); });
} }
u32 DiscoverAndPairWiimotes(u8 inquiry_length, static u32 DiscoverAndPairWiimotes(u8 inquiry_length,
std::optional<AuthenticationMethod> auth_method = std::nullopt) std::optional<AuthenticationMethod> auth_method = std::nullopt)
{ {
u32 success_count = 0; u32 success_count = 0;
EnumerateBluetoothWiimotes( EnumerateBluetoothWiimotes(
@@ -374,7 +375,7 @@ void WiimoteScannerWindows::Update()
} }
// See http://wiibrew.org/wiki/Wiimote for the Report IDs and its sizes // See http://wiibrew.org/wiki/Wiimote for the Report IDs and its sizes
size_t GetReportSize(u8 rid) static size_t GetReportSize(u8 rid)
{ {
using namespace WiimoteCommon; using namespace WiimoteCommon;
+22 -22
View File
@@ -59,7 +59,7 @@ void LogToFile(const char* fmt, ...)
va_end(args); va_end(args);
} }
bool ProgressCallback(s64 total, s64 now, s64, s64) static bool ProgressCallback(s64 total, s64 now, s64, s64)
{ {
UI::SetCurrentProgress(static_cast<int>(now), static_cast<int>(total)); UI::SetCurrentProgress(static_cast<int>(now), static_cast<int>(total));
return true; return true;
@@ -78,7 +78,7 @@ std::string HexEncode(const u8* buffer, size_t size)
return out; return out;
} }
bool HexDecode(const std::string& hex, u8* buffer, size_t size) static bool HexDecode(const std::string& hex, u8* buffer, size_t size)
{ {
if (hex.size() != size * 2) if (hex.size() != size * 2)
return false; return false;
@@ -107,7 +107,7 @@ bool HexDecode(const std::string& hex, u8* buffer, size_t size)
return true; return true;
} }
std::optional<std::string> GzipInflate(const std::string& data) static std::optional<std::string> GzipInflate(const std::string& data)
{ {
z_stream zstrm; z_stream zstrm;
zstrm.zalloc = nullptr; zstrm.zalloc = nullptr;
@@ -155,7 +155,7 @@ Manifest::Hash ComputeHash(const std::string& contents)
return out; return out;
} }
bool VerifySignature(const std::string& data, const std::string& b64_signature) static bool VerifySignature(const std::string& data, const std::string& b64_signature)
{ {
u8 signature[64]; // ed25519 sig size. u8 signature[64]; // ed25519 sig size.
size_t sig_size; size_t sig_size;
@@ -174,7 +174,7 @@ bool VerifySignature(const std::string& data, const std::string& b64_signature)
pub_key.data()); pub_key.data());
} }
void FlushLog() static void FlushLog()
{ {
log_file.Flush(); log_file.Flush();
log_file.Close(); log_file.Close();
@@ -204,8 +204,8 @@ void TodoList::Log() const
} }
} }
bool DownloadContent(const std::vector<TodoList::DownloadOp>& to_download, static bool DownloadContent(const std::vector<TodoList::DownloadOp>& to_download,
const std::string& content_base_url, const std::string& temp_path) const std::string& content_base_url, const std::string& temp_path)
{ {
Common::HttpRequest req(std::chrono::seconds(30), ProgressCallback); Common::HttpRequest req(std::chrono::seconds(30), ProgressCallback);
@@ -266,14 +266,14 @@ bool DownloadContent(const std::vector<TodoList::DownloadOp>& to_download,
return true; return true;
} }
bool PlatformVersionCheck(const std::vector<TodoList::UpdateOp>& to_update, static bool PlatformVersionCheck(const std::vector<TodoList::UpdateOp>& to_update,
const std::string& install_base_path, const std::string& temp_dir) const std::string& install_base_path, const std::string& temp_dir)
{ {
UI::SetDescription("Checking platform..."); UI::SetDescription("Checking platform...");
return Platform::VersionCheck(to_update, install_base_path, temp_dir); return Platform::VersionCheck(to_update, install_base_path, temp_dir);
} }
TodoList ComputeActionsToDo(Manifest this_manifest, Manifest next_manifest) static TodoList ComputeActionsToDo(Manifest this_manifest, Manifest next_manifest)
{ {
TodoList todo; TodoList todo;
@@ -317,7 +317,7 @@ TodoList ComputeActionsToDo(Manifest this_manifest, Manifest next_manifest)
return todo; return todo;
} }
void CleanUpTempDir(const std::string& temp_dir, const TodoList& todo) static void CleanUpTempDir(const std::string& temp_dir, const TodoList& todo)
{ {
// This is best-effort cleanup, we ignore most errors. // This is best-effort cleanup, we ignore most errors.
for (const auto& download : todo.to_download) for (const auto& download : todo.to_download)
@@ -325,7 +325,7 @@ void CleanUpTempDir(const std::string& temp_dir, const TodoList& todo)
File::DeleteDir(temp_dir); File::DeleteDir(temp_dir);
} }
bool BackupFile(const std::string& path) static bool BackupFile(const std::string& path)
{ {
std::string backup_path = path + ".bak"; std::string backup_path = path + ".bak";
LogToFile("Backing up existing %s to .bak.\n", path.c_str()); LogToFile("Backing up existing %s to .bak.\n", path.c_str());
@@ -337,8 +337,8 @@ bool BackupFile(const std::string& path)
return true; return true;
} }
bool DeleteObsoleteFiles(const std::vector<TodoList::DeleteOp>& to_delete, static bool DeleteObsoleteFiles(const std::vector<TodoList::DeleteOp>& to_delete,
const std::string& install_base_path) const std::string& install_base_path)
{ {
for (const auto& op : to_delete) for (const auto& op : to_delete)
{ {
@@ -370,8 +370,8 @@ bool DeleteObsoleteFiles(const std::vector<TodoList::DeleteOp>& to_delete,
return true; return true;
} }
bool UpdateFiles(const std::vector<TodoList::UpdateOp>& to_update, static bool UpdateFiles(const std::vector<TodoList::UpdateOp>& to_update,
const std::string& install_base_path, const std::string& temp_path) const std::string& install_base_path, const std::string& temp_path)
{ {
#ifdef _WIN32 #ifdef _WIN32
const auto self_path = std::filesystem::path(Common::GetModuleName(nullptr).value()); const auto self_path = std::filesystem::path(Common::GetModuleName(nullptr).value());
@@ -479,8 +479,8 @@ bool UpdateFiles(const std::vector<TodoList::UpdateOp>& to_update,
return true; return true;
} }
bool PerformUpdate(const TodoList& todo, const std::string& install_base_path, static bool PerformUpdate(const TodoList& todo, const std::string& install_base_path,
const std::string& content_base_url, const std::string& temp_path) const std::string& content_base_url, const std::string& temp_path)
{ {
LogToFile("Starting download step...\n"); LogToFile("Starting download step...\n");
if (!DownloadContent(todo.to_download, content_base_url, temp_path)) if (!DownloadContent(todo.to_download, content_base_url, temp_path))
@@ -505,7 +505,7 @@ bool PerformUpdate(const TodoList& todo, const std::string& install_base_path,
return true; return true;
} }
void FatalError(const std::string& message) static void FatalError(const std::string& message)
{ {
LogToFile("%s\n", message.c_str()); LogToFile("%s\n", message.c_str());
@@ -513,7 +513,7 @@ void FatalError(const std::string& message)
UI::Error(message); UI::Error(message);
} }
std::optional<Manifest> ParseManifest(const std::string& manifest) static std::optional<Manifest> ParseManifest(const std::string& manifest)
{ {
Manifest parsed; Manifest parsed;
size_t pos = 0; size_t pos = 0;
@@ -556,7 +556,7 @@ std::optional<Manifest> ParseManifest(const std::string& manifest)
} }
// Not showing a progress bar here because this part is just too quick // Not showing a progress bar here because this part is just too quick
std::optional<Manifest> FetchAndParseManifest(const std::string& url) static std::optional<Manifest> FetchAndParseManifest(const std::string& url)
{ {
Common::HttpRequest http; Common::HttpRequest http;
@@ -614,7 +614,7 @@ struct Options
std::optional<std::string> log_file; std::optional<std::string> log_file;
}; };
std::optional<Options> ParseCommandLine(std::vector<std::string>& args) static std::optional<Options> ParseCommandLine(std::vector<std::string>& args)
{ {
using optparse::OptionParser; using optparse::OptionParser;
@@ -23,7 +23,7 @@ Gfx::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl)
return std::make_unique<D3DVertexFormat>(vtx_decl); return std::make_unique<D3DVertexFormat>(vtx_decl);
} }
DXGI_FORMAT VarToD3D(ComponentFormat t, int size, bool integer) static DXGI_FORMAT VarToD3D(ComponentFormat t, int size, bool integer)
{ {
using FormatMap = Common::EnumMap<DXGI_FORMAT, ComponentFormat::InvalidFloat7>; using FormatMap = Common::EnumMap<DXGI_FORMAT, ComponentFormat::InvalidFloat7>;
static constexpr auto f = [](FormatMap a) { return a; }; // Deduction helper static constexpr auto f = [](FormatMap a) { return a; }; // Deduction helper
+4 -4
View File
@@ -246,9 +246,9 @@ static VersionCheckResult OSVersionCheck(const BuildInfo& build_info)
return result; return result;
} }
std::optional<BuildInfos> InitBuildInfos(const std::vector<TodoList::UpdateOp>& to_update, static std::optional<BuildInfos> InitBuildInfos(const std::vector<TodoList::UpdateOp>& to_update,
const std::string& install_base_path, const std::string& install_base_path,
const std::string& temp_dir) const std::string& temp_dir)
{ {
const auto op_it = std::ranges::find(to_update, "build_info.txt", &TodoList::UpdateOp::filename); const auto op_it = std::ranges::find(to_update, "build_info.txt", &TodoList::UpdateOp::filename);
if (op_it == to_update.cend()) if (op_it == to_update.cend())
@@ -278,7 +278,7 @@ std::optional<BuildInfos> InitBuildInfos(const std::vector<TodoList::UpdateOp>&
return build_infos; return build_infos;
} }
bool CheckBuildInfo(const BuildInfos& build_infos) static bool CheckBuildInfo(const BuildInfos& build_infos)
{ {
// The existing BuildInfo may have been modified. Be careful not to overly trust its contents! // The existing BuildInfo may have been modified. Be careful not to overly trust its contents!
+2 -2
View File
@@ -55,7 +55,7 @@ constexpr int PADDING_HEIGHT = 5;
namespace UI namespace UI
{ {
bool InitWindow() static bool InitWindow()
{ {
InitCommonControls(); InitCommonControls();
@@ -206,7 +206,7 @@ void SetDescription(const std::string& text)
SetWindowText(label_handle, UTF8ToWString(text).c_str()); SetWindowText(label_handle, UTF8ToWString(text).c_str());
} }
void MessageLoop() static void MessageLoop()
{ {
HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED);