Codechange: Silence warnings about intentionally unused parameters.

This commit is contained in:
frosch
2023-09-16 22:20:53 +02:00
committed by frosch
parent df400ef84a
commit b6c8f301be
227 changed files with 972 additions and 1039 deletions

View File

@@ -177,9 +177,8 @@ static sigset_t SetSignals(void(*handler)(int))
/**
* Entry point for a crash that happened during the handling of a crash.
*
* @param signum the signal that caused us to crash.
*/
static void CDECL HandleInternalCrash(int signum)
static void CDECL HandleInternalCrash(int)
{
if (CrashLogOSX::current == nullptr || !CrashLogOSX::current->try_execute_active) {
fmt::print("Something went seriously wrong when creating the crash log. Aborting.\n");

View File

@@ -24,7 +24,7 @@
#include "safeguards.h"
bool SetFallbackFont(FontCacheSettings *settings, const std::string &language_isocode, int winlangid, MissingGlyphSearcher *callback)
bool SetFallbackFont(FontCacheSettings *settings, const std::string &language_isocode, int, MissingGlyphSearcher *callback)
{
/* Determine fallback font using CoreText. This uses the language isocode
* to find a suitable font. CoreText is available from 10.5 onwards. */

View File

@@ -53,7 +53,7 @@ class CrashLogUnix : public CrashLog {
survey["reason"] = strsignal(signum);
}
void SurveyStacktrace(nlohmann::json &survey) const override
void SurveyStacktrace([[maybe_unused]] nlohmann::json &survey) const override
{
#if defined(__GLIBC__)
void *trace[64];
@@ -166,7 +166,7 @@ static sigset_t SetSignals(void(*handler)(int))
*
* @param signum the signal that caused us to crash.
*/
static void CDECL HandleInternalCrash(int signum)
static void CDECL HandleInternalCrash([[maybe_unused]] int signum)
{
if (CrashLogUnix::current == nullptr || !CrashLogUnix::current->try_execute_active) {
fmt::print("Something went seriously wrong when creating the crash log. Aborting.\n");

View File

@@ -95,7 +95,7 @@ FT_Error GetFontByFaceName(const char *font_name, FT_Face *face)
return err;
}
bool SetFallbackFont(FontCacheSettings *settings, const std::string &language_isocode, int winlangid, MissingGlyphSearcher *callback)
bool SetFallbackFont(FontCacheSettings *settings, const std::string &language_isocode, int, MissingGlyphSearcher *callback)
{
bool ret = false;

View File

@@ -59,7 +59,7 @@ bool FiosIsRoot(const std::string &path)
return path == PATHSEP;
}
void FiosGetDrives(FileList &file_list)
void FiosGetDrives(FileList &)
{
return;
}
@@ -199,7 +199,7 @@ void ShowInfoI(const std::string &str)
}
#if !defined(__APPLE__)
void ShowOSErrorBox(const char *buf, bool system)
void ShowOSErrorBox(const char *buf, bool)
{
/* All unix systems, except OSX. Only use escape codes on a TTY. */
if (isatty(fileno(stderr))) {
@@ -251,7 +251,7 @@ void OSOpenBrowser(const char *url)
}
#endif /* __APPLE__ */
void SetCurrentThreadName(const char *threadName) {
void SetCurrentThreadName([[maybe_unused]] const char *threadName) {
#if defined(__GLIBC__)
if (threadName) pthread_setname_np(pthread_self(), threadName);
#endif /* defined(__GLIBC__) */

View File

@@ -98,7 +98,7 @@ class CrashLogWindows : public CrashLog {
public:
#ifdef WITH_UNOFFICIAL_BREAKPAD
static bool MinidumpCallback(const wchar_t *dump_dir, const wchar_t *minidump_id, void *context, EXCEPTION_POINTERS *exinfo, MDRawAssertionInfo *assertion, bool succeeded)
static bool MinidumpCallback(const wchar_t *dump_dir, const wchar_t *minidump_id, void *context, EXCEPTION_POINTERS *, MDRawAssertionInfo *, bool succeeded)
{
CrashLogWindows *crashlog = reinterpret_cast<CrashLogWindows *>(context);
@@ -287,7 +287,7 @@ static const uint MAX_FRAMES = 64;
}
}
#else
/* virtual */ void CrashLogWindows::SurveyStacktrace(nlohmann::json &survey) const
/* virtual */ void CrashLogWindows::SurveyStacktrace(nlohmann::json &) const
{
/* Not supported. */
}
@@ -380,7 +380,7 @@ static LONG WINAPI VectoredExceptionHandler(EXCEPTION_POINTERS *ep)
return EXCEPTION_CONTINUE_SEARCH;
}
static void CDECL CustomAbort(int signal)
static void CDECL CustomAbort(int)
{
RaiseException(CUSTOM_ABORT_EXCEPTION, 0, 0, nullptr);
}
@@ -461,7 +461,7 @@ static void SetWndSize(HWND wnd, int mode)
}
}
static INT_PTR CALLBACK CrashDialogFunc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
static INT_PTR CALLBACK CrashDialogFunc(HWND wnd, UINT msg, WPARAM wParam, LPARAM)
{
switch (msg) {
case WM_INITDIALOG: {

View File

@@ -88,7 +88,7 @@ static int CALLBACK EnumFontCallback(const ENUMLOGFONTEX *logfont, const NEWTEXT
return 0; // stop enumerating
}
bool SetFallbackFont(FontCacheSettings *settings, const std::string &language_isocode, int winlangid, MissingGlyphSearcher *callback)
bool SetFallbackFont(FontCacheSettings *settings, const std::string &, int winlangid, MissingGlyphSearcher *callback)
{
Debug(fontcache, 1, "Trying fallback fonts");
EFCParam langInfo;

View File

@@ -45,7 +45,7 @@ bool MyShowCursor(bool show, bool toggle)
return !show;
}
void ShowOSErrorBox(const char *buf, bool system)
void ShowOSErrorBox(const char *buf, bool)
{
MyShowCursor(true);
MessageBox(GetActiveWindow(), OTTD2FS(buf).c_str(), L"Error!", MB_ICONSTOP | MB_TASKMODAL);
@@ -190,7 +190,7 @@ void FiosGetDrives(FileList &file_list)
}
}
bool FiosIsValidFile(const std::string &path, const struct dirent *ent, struct stat *sb)
bool FiosIsValidFile(const std::string &, const struct dirent *ent, struct stat *sb)
{
/* hectonanoseconds between Windows and POSIX epoch */
static const int64_t posix_epoch_hns = 0x019DB1DED53E8000LL;
@@ -283,7 +283,7 @@ void CreateConsole()
static const char *_help_msg;
/** Callback function to handle the window */
static INT_PTR CALLBACK HelpDialogFunc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
static INT_PTR CALLBACK HelpDialogFunc(HWND wnd, UINT msg, WPARAM wParam, LPARAM)
{
switch (msg) {
case WM_INITDIALOG: {

View File

@@ -51,7 +51,7 @@ static int ParseCommandLine(char *line, char **argv, int max_argc)
void CreateConsole();
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
/* Set system timer resolution to 1ms. */
timeBeginPeriod(1);