[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

@@ -31,7 +31,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
typedef struct LGTimer LGTimer;
static inline uint64_t microtime()
static inline uint64_t microtime(void)
{
#if defined(_WIN32)
static LARGE_INTEGER freq = { 0 };
@@ -50,7 +50,7 @@ static inline uint64_t microtime()
#if !defined(_WIN32)
//FIXME: make win32 versions
static inline uint64_t nanotime()
static inline uint64_t nanotime(void)
{
struct timespec time;
clock_gettime(CLOCK_MONOTONIC_RAW, &time);

View File

@@ -210,7 +210,7 @@ bool option_register(struct Option options[])
return true;
};
void option_free()
void option_free(void)
{
for(int i = 0; i < state.oCount; ++i)
{
@@ -520,7 +520,7 @@ exit:
return result;
}
bool option_validate()
bool option_validate(void)
{
if (state.doHelp)
{
@@ -571,7 +571,7 @@ bool option_validate()
return ok;
}
void option_print()
void option_print(void)
{
printf(
"The following is a complete list of options accepted by this application\n\n"

View File

@@ -54,7 +54,7 @@ struct crash
static struct crash crash = {0};
static void load_symbols()
static void load_symbols(void)
{
bfd_init();
crash.fd = bfd_openr(crash.exe, NULL);
@@ -131,7 +131,7 @@ static bool lookup_address(bfd_vma pc, const char ** filename, const char ** fun
return true;
}
static void cleanup()
static void cleanup(void)
{
if (crash.syms)
free(crash.syms);

View File

@@ -82,7 +82,7 @@ static StringList ivshmemDeviceGetValues(struct Option * option)
return sl;
}
void ivshmemOptionsInit()
void ivshmemOptionsInit(void)
{
struct Option options[] =
{

View File

@@ -20,7 +20,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include <unistd.h>
#include <GL/glx.h>
int sysinfo_gfx_max_multisample()
int sysinfo_gfx_max_multisample(void)
{
Display * dpy = XOpenDisplay(NULL);
if (!dpy)
@@ -64,7 +64,7 @@ int sysinfo_gfx_max_multisample()
return maxSamples;
}
long sysinfo_getPageSize()
long sysinfo_getPageSize(void)
{
return sysconf(_SC_PAGESIZE);
}

View File

@@ -33,7 +33,7 @@ struct IVSHMEMInfo
HANDLE handle;
};
void ivshmemOptionsInit()
void ivshmemOptionsInit(void)
{
static struct Option options[] = {
{

View File

@@ -19,13 +19,13 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include <windows.h>
int sysinfo_gfx_max_multisample()
int sysinfo_gfx_max_multisample(void)
{
//FIXME: Implement this
return 4;
}
long sysinfo_getPageSize()
long sysinfo_getPageSize(void)
{
SYSTEM_INFO si;
GetSystemInfo(&si);

View File

@@ -58,7 +58,7 @@ inline static BOOL CompareWindowsVersion(DWORD dwMajorVersion, DWORD dwMinorVers
return VerifyVersionInfo(&ver, VER_MAJORVERSION | VER_MINORVERSION, dwlConditionMask);
}
bool IsWindows8()
bool IsWindows8(void)
{
return
(CompareWindowsVersion(6, 3) == TRUE) ||