[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

@@ -114,12 +114,12 @@ static CaptureResult dxgi_releaseFrame();
// implementation
static const char * dxgi_getName()
static const char * dxgi_getName(void)
{
return "DXGI";
}
static void dxgi_initOptions()
static void dxgi_initOptions(void)
{
struct Option options[] =
{
@@ -186,7 +186,7 @@ static bool dxgi_create(CaptureGetPointerBuffer getPointerBufferFn, CapturePostP
return true;
}
static bool dxgi_init()
static bool dxgi_init(void)
{
assert(this);
@@ -572,12 +572,12 @@ fail:
return false;
}
static void dxgi_stop()
static void dxgi_stop(void)
{
this->stop = true;
}
static bool dxgi_deinit()
static bool dxgi_deinit(void)
{
assert(this);
@@ -653,7 +653,7 @@ static bool dxgi_deinit()
return true;
}
static void dxgi_free()
static void dxgi_free(void)
{
assert(this);
@@ -666,7 +666,7 @@ static void dxgi_free()
this = NULL;
}
static unsigned int dxgi_getMaxFrameSize()
static unsigned int dxgi_getMaxFrameSize(void)
{
assert(this);
assert(this->initialized);
@@ -674,7 +674,7 @@ static unsigned int dxgi_getMaxFrameSize()
return this->height * this->pitch;
}
static unsigned int dxgi_getMouseScale()
static unsigned int dxgi_getMouseScale(void)
{
assert(this);
assert(this->initialized);
@@ -701,7 +701,7 @@ static CaptureResult dxgi_hResultToCaptureResult(const HRESULT status)
}
}
static CaptureResult dxgi_capture()
static CaptureResult dxgi_capture(void)
{
assert(this);
assert(this->initialized);
@@ -950,7 +950,7 @@ static CaptureResult dxgi_getFrame(FrameBuffer * frame)
return CAPTURE_RESULT_OK;
}
static CaptureResult dxgi_releaseFrame()
static CaptureResult dxgi_releaseFrame(void)
{
assert(this);
if (!this->needsRelease)

View File

@@ -89,12 +89,12 @@ static void on_mouseMove(int x, int y)
lgSignalEvent(this->cursorEvents[0]);
}
static const char * nvfbc_getName()
static const char * nvfbc_getName(void)
{
return "NVFBC (NVidia Frame Buffer Capture)";
};
static void nvfbc_initOptions()
static void nvfbc_initOptions(void)
{
struct Option options[] =
{
@@ -163,7 +163,7 @@ static bool nvfbc_create(
return true;
}
static bool nvfbc_init()
static bool nvfbc_init(void)
{
this->stop = false;
getDesktopSize(&this->width, &this->height, &this->dpi);
@@ -205,7 +205,7 @@ static bool nvfbc_init()
return true;
}
static void nvfbc_stop()
static void nvfbc_stop(void)
{
this->stop = true;
lgSignalEvent(this->cursorEvents[0]);
@@ -218,7 +218,7 @@ static void nvfbc_stop()
}
}
static bool nvfbc_deinit()
static bool nvfbc_deinit(void)
{
mouseHook_remove();
@@ -231,7 +231,7 @@ static bool nvfbc_deinit()
return true;
}
static void nvfbc_free()
static void nvfbc_free(void)
{
NvFBCToSysRelease(&this->nvfbc);
@@ -243,17 +243,17 @@ static void nvfbc_free()
NvFBCFree();
}
static unsigned int nvfbc_getMaxFrameSize()
static unsigned int nvfbc_getMaxFrameSize(void)
{
return this->maxWidth * this->maxHeight * 4;
}
static unsigned int nvfbc_getMouseScale()
static unsigned int nvfbc_getMouseScale(void)
{
return this->dpi * 100 / DPI_100_PERCENT;
}
static CaptureResult nvfbc_capture()
static CaptureResult nvfbc_capture(void)
{
getDesktopSize(&this->width, &this->height, &this->dpi);
NvFBCFrameGrabInfo grabInfo;

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;