[all] use explicit void parameter lists

This makes it a compile-time error to call a function that semantically
takes no parameters with a nonzero number of arguments.

Previously, such code would still compile, but risk blowing up the stack
if a compiler chose to use something other than caller-cleanup calling
conventions.
This commit is contained in:
Tudor Brindus
2021-01-14 01:05:26 -05:00
committed by Geoffrey McRae
parent dc17492750
commit a46a3a2668
28 changed files with 111 additions and 111 deletions

View File

@@ -47,7 +47,7 @@ void mouseHook_install(MouseHookFn callback)
sendAppMessage(WM_CALL_FUNCTION, 0, (LPARAM)&cf);
}
void mouseHook_remove()
void mouseHook_remove(void)
{
struct MSG_CALL_FUNCTION cf;
cf.fn = msg_callback;

View File

@@ -66,7 +66,7 @@ static ZwSetTimerResolution_t ZwSetTimerResolution = NULL;
typedef WINBOOL WINAPI (*PChangeWindowMessageFilterEx)(HWND hwnd, UINT message, DWORD action, void * pChangeFilterStruct);
PChangeWindowMessageFilterEx _ChangeWindowMessageFilterEx = NULL;
static void RegisterTrayIcon()
static void RegisterTrayIcon(void)
{
// register our TrayIcon
if (!app.iconData.cbSize)
@@ -320,7 +320,7 @@ finish:
return result;
}
bool app_init()
bool app_init(void)
{
const char * logFile = option_get_string("os", "logFile" );
@@ -346,12 +346,12 @@ bool app_init()
return true;
}
const char * os_getExecutable()
const char * os_getExecutable(void)
{
return app.executable;
}
const char * os_getDataPath()
const char * os_getDataPath(void)
{
static char path[MAX_PATH] = { 0 };
if (!path[0])
@@ -369,7 +369,7 @@ const char * os_getDataPath()
return path;
}
HWND os_getMessageWnd()
HWND os_getMessageWnd(void)
{
return app.messageWnd;
}

View File

@@ -73,7 +73,7 @@ void doLog(const char * fmt, ...)
va_end(args);
}
static bool setupAPI()
static bool setupAPI(void)
{
/* first look in kernel32.dll */
HMODULE mod;
@@ -99,7 +99,7 @@ static bool setupAPI()
return false;
}
static void setupLogging()
static void setupLogging(void)
{
char tempPath[MAX_PATH+1];
GetTempPathA(sizeof(tempPath), tempPath);
@@ -110,13 +110,13 @@ static void setupLogging()
doLog("Startup\n");
}
static void finishLogging()
static void finishLogging(void)
{
doLog("Finished\n");
fclose(service.logFile);
}
void winerr()
void winerr(void)
{
char buf[256];
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
@@ -172,7 +172,7 @@ fail:
return false;
}
HANDLE dupeSystemProcessToken()
HANDLE dupeSystemProcessToken(void)
{
DWORD count = 0;
DWORD returned;
@@ -235,7 +235,7 @@ err_proc:
return NULL;
}
DWORD GetInteractiveSessionID()
DWORD GetInteractiveSessionID(void)
{
PWTS_SESSION_INFO pSessionInfo;
DWORD count;
@@ -258,7 +258,7 @@ DWORD GetInteractiveSessionID()
return ret;
}
void Launch()
void Launch(void)
{
if (!setupAPI())
{
@@ -392,7 +392,7 @@ VOID SvcReportEvent(LPTSTR szFunction)
}
}
void Install()
void Install(void)
{
TCHAR szPath[MAX_PATH];
@@ -488,7 +488,7 @@ void Install()
CloseServiceHandle(schSCManager);
}
void Uninstall()
void Uninstall(void)
{
SC_HANDLE schSCManager;
SC_HANDLE schService;