aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Michael Smith <mikesmiffy128@gmail.com> 2025-03-10 20:37:28 +0000
committerGravatar Michael Smith <mikesmiffy128@gmail.com> 2025-04-06 16:41:13 +0100
commitdaa55cade14146f04814cf8a7ad2028becf4db66 (patch)
tree62933a231e8068f4498596a9064f59e1a4842723
parent244fea664121acf12871ab5858a5fe95a2606b52 (diff)
downloadsst-daa55cade14146f04814cf8a7ad2028becf4db66.tar.gz
sst-daa55cade14146f04814cf8a7ad2028becf4db66.zip
Use C23 void-argument-free prototypes
In the future we can also consider moving to {} instead of {0} for initialisers, but my old Clang (16) doesn't support this, so it might be wise to wait longer on that one so people don't need too bleeding-edge of a compiler just to build this thing.
-rw-r--r--src/ac.c24
-rw-r--r--src/ac.h6
-rw-r--r--src/alias.c2
-rw-r--r--src/alias.h4
-rw-r--r--src/build/gluegen.c24
-rw-r--r--src/build/mkentprops.c6
-rw-r--r--src/build/mkgamedata.c4
-rw-r--r--src/con_.c6
-rw-r--r--src/con_.h6
-rw-r--r--src/democustom.c4
-rw-r--r--src/demorec.c10
-rw-r--r--src/demorec.h6
-rw-r--r--src/engineapi.c2
-rw-r--r--src/engineapi.h4
-rw-r--r--src/errmsg.h6
-rw-r--r--src/feature.h6
-rw-r--r--src/fixes.c12
-rw-r--r--src/fixes.h4
-rw-r--r--src/gameinfo.c4
-rw-r--r--src/gameinfo.h4
-rw-r--r--src/gameserver.c4
-rw-r--r--src/gameserver.h4
-rw-r--r--src/hook.c4
-rw-r--r--src/hook.h4
-rw-r--r--src/hud.c2
-rw-r--r--src/inputhud.c2
-rw-r--r--src/kvsys.c4
-rw-r--r--src/l4dmm.c4
-rw-r--r--src/l4dmm.h6
-rw-r--r--src/l4dreset.c2
-rw-r--r--src/l4dwarp.c2
-rw-r--r--src/os.c6
-rw-r--r--src/os.h2
-rw-r--r--src/sst.c16
-rw-r--r--src/xhair.c2
35 files changed, 104 insertions, 104 deletions
diff --git a/src/ac.c b/src/ac.c
index e8aef8d..ad0cc0e 100644
--- a/src/ac.c
+++ b/src/ac.c
@@ -78,7 +78,7 @@ const uchar lbpubkeys[1][32] = {
0x40, 0x05, 0xE9, 0x60, 0x43, 0xE8, 0xE2, 0x03
};
-static void newsessionkeys(void) {
+static void newsessionkeys() {
crypto_rng_read(&keybox->rng, keybox->prv, sizeof(keybox->prv));
crypto_x25519_public_key(keybox->pub, keybox->prv);
crypto_x25519(keybox->tmp, keybox->prv, keybox->lbpub);
@@ -90,11 +90,11 @@ static void newsessionkeys(void) {
keybox->nonce = 0;
}
-static void wipesessionkeys(void) {
+static void wipesessionkeys() {
crypto_wipe(keybox->prv, offsetof(struct keybox, rng));
}
-HANDLE_EVENT(DemoRecordStarting, void) { if (enabled) newsessionkeys(); }
+HANDLE_EVENT(DemoRecordStarting) { if (enabled) newsessionkeys(); }
HANDLE_EVENT(DemoRecordStopped, int ndemos) { if (enabled) wipesessionkeys(); }
#ifdef _WIN32
@@ -162,7 +162,7 @@ static ssize __stdcall hook_wndproc(void *wnd, uint msg, usize wp, ssize lp) {
return CallWindowProcA((WNDPROC)orig_wndproc, wnd, msg, wp, lp);
}
-static inline bool win32_init(void) {
+static inline bool win32_init() {
// note: using A instead of W to avoid some weirdness with handles...
gamewin = FindWindowA("Valve001", 0);
// note: error messages here are a bit cryptic on purpose, but easy to find
@@ -180,7 +180,7 @@ static inline bool win32_init(void) {
return true;
}
-static inline void win32_end(void) {
+static inline void win32_end() {
// no error handling here because we'd crash either way. good luck!
SetWindowLongPtrA(gamewin, GWLP_WNDPROC, orig_wndproc);
}
@@ -191,7 +191,7 @@ static void inhook_start(volatile int *sig) {
inhookthr = CreateThread(0, 0, &inhookthrmain, (u32 *)sig, 0, &inhooktid);
}
-static void inhook_check(void) {
+static void inhook_check() {
if (WaitForSingleObject(inhookthr, 0) == WAIT_OBJECT_0) {
ulong status;
GetExitCodeThread(inhookthr, &status);
@@ -206,7 +206,7 @@ static void inhook_check(void) {
}
}
-static void inhook_stop(void) {
+static void inhook_stop() {
PostThreadMessageW(inhooktid, WM_QUIT, 0, 0);
if (WaitForSingleObject(inhookthr, INFINITE) == WAIT_FAILED) {
errmsg_warnsys("couldn't wait for thread, status unknown");
@@ -230,7 +230,7 @@ static void inhook_stop(void) {
#endif
-bool ac_enable(void) {
+bool ac_enable() {
if (!enabled) {
#ifdef _WIN32
volatile int sig = 0;
@@ -255,7 +255,7 @@ HANDLE_EVENT(Tick, bool simulating) {
#endif
}
-void ac_disable(void) {
+void ac_disable() {
if (enabled) {
#ifdef _WIN32
inhook_stop();
@@ -308,7 +308,7 @@ static void hook_Key_Event(struct inputevent *ev) {
orig_Key_Event(ev);
}
-static bool find_Key_Event(void) {
+static bool find_Key_Event() {
#ifdef _WIN32
// Crazy pointer-chasing path to get to DispatchInputEvent:
// IGameUIFuncs interface
@@ -372,10 +372,10 @@ HANDLE_EVENT(AllowPluginLoading, bool loading) {
return true;
}
-HANDLE_EVENT(PluginLoaded, void) {
+HANDLE_EVENT(PluginLoaded) {
// TODO(rta): do something with plugin list here
}
-HANDLE_EVENT(PluginUnloaded, void) {
+HANDLE_EVENT(PluginUnloaded) {
// TODO(rta): do something with plugin list here
}
diff --git a/src/ac.h b/src/ac.h
index 2da6446..2bc4593 100644
--- a/src/ac.h
+++ b/src/ac.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2023 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -17,8 +17,8 @@
#ifndef INC_AC_H
#define INC_AC_H
-bool ac_enable(void);
-void ac_disable(void);
+bool ac_enable();
+void ac_disable();
#endif
diff --git a/src/alias.c b/src/alias.c
index a2d2b21..1021a64 100644
--- a/src/alias.c
+++ b/src/alias.c
@@ -30,7 +30,7 @@ FEATURE("alias management")
struct alias **_alias_head;
-void alias_nuke(void) {
+void alias_nuke() {
for (struct alias *p = alias_head; p;) {
struct alias *next = p->next;
extfree(p->value); extfree(p);
diff --git a/src/alias.h b/src/alias.h
index c13f342..93b0931 100644
--- a/src/alias.h
+++ b/src/alias.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2022 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -26,7 +26,7 @@ extern struct alias **_alias_head;
#define alias_head (*_alias_head) // act as a global
/* Clears all aliases from the engine's internal list. */
-void alias_nuke(void);
+void alias_nuke();
/* Removes a specific named alias from the engine's internal list. */
void alias_rm(const char *name);
diff --git a/src/build/gluegen.c b/src/build/gluegen.c
index 4a0f4a1..717ff97 100644
--- a/src/build/gluegen.c
+++ b/src/build/gluegen.c
@@ -50,7 +50,7 @@ static _Alignas(64) char _arena[ARENASZ] = {0}, *const arena = _arena - 64;
static int arena_last = 0;
static int arena_used = 64; // using 0 indices as null; reserve and stay aligned
-static inline void _arena_align(void) {
+static inline void _arena_align() {
enum { ALIGN = ssizeof(void *) };
if (arena_used & ALIGN - 1) arena_used = (arena_used + ALIGN) & ~(ALIGN - 1);
}
@@ -124,7 +124,7 @@ static inline void *list_grow_p(struct list_chunkhdr **tailp, int amt) {
/* ... */
#define DEF_NEW(type, func, nvar, maxvar, desc) \
- static inline type func(void) { \
+ static inline type func() { \
if_cold (nvar == maxvar) { \
die(2, "out of " desc " - increase " #maxvar " in gluegen.c!"); \
} \
@@ -195,7 +195,7 @@ static SHUNT(struct radix, radices)[MAX_MODULES * 2 + MAX_EVENTS];
static int nradices = 1; // also reserve a null value
// NOTE: this will never fail, as node count is bounded by modules * 2 + events
-static inline s16 radix_new(void) { return nradices++; }
+static inline s16 radix_new() { return nradices++; }
static int matchlen(const char *s1, const char *s2, int len, bool ignorecase) {
uchar c1, c2;
@@ -591,13 +591,13 @@ static int dfs(s16 mod, bool first) {
return 0;
}
-static inline void sortfeatures(void) {
+static inline void sortfeatures() {
for (int i = 1; i < nmods; ++i) {
if ((mod_flags[i] & HAS_INIT) && dfs(i, true)) exit(2);
}
}
-static inline noreturn diewrite(void) { die(100, "couldn't write to file"); }
+static inline noreturn diewrite() { die(100, "couldn't write to file"); }
#define _(x) \
if (fprintf(out, "%s\n", x) < 0) diewrite();
#define F(f, ...) \
@@ -667,13 +667,13 @@ static int evargs_notype(FILE *out, s16 i, const char *suffix) {
static inline void gencode(FILE *out, s16 featdescs) {
for (int i = 1; i < nmods; ++i) {
if (mod_flags[i] & HAS_INIT) {
-F( "extern int _feat_init_%.*s(void);", mod_names[i].len, mod_names[i].s)
+F( "extern int _feat_init_%.*s();", mod_names[i].len, mod_names[i].s)
}
if (mod_flags[i] & HAS_PREINIT) {
-F( "extern int _feat_preinit_%.*s(void);", mod_names[i].len, mod_names[i].s)
+F( "extern int _feat_preinit_%.*s();", mod_names[i].len, mod_names[i].s)
}
if (mod_flags[i] & HAS_END) {
-F( "extern void _feat_end_%.*s(void);", mod_names[i].len, mod_names[i].s)
+F( "extern void _feat_end_%.*s();", mod_names[i].len, mod_names[i].s)
}
}
_( "")
@@ -717,7 +717,7 @@ F( "extern struct con_var *%.*s;", cvar_names[i].len, cvar_names[i].s);
F( "extern struct con_cmd *%.*s;", ccmd_names[i].len, ccmd_names[i].s);
}
_( "")
-_( "static inline void preinitfeatures(void) {")
+_( "static inline void preinitfeatures() {")
for (int i = 1; i < nmods; ++i) {
if (mod_flags[i] & HAS_PREINIT) {
F( " feats.preinit_%.*s = _feat_preinit_%.*s();",
@@ -726,7 +726,7 @@ F( " feats.preinit_%.*s = _feat_preinit_%.*s();",
}
_( "}")
_( "")
-_( "static inline void initfeatures(void) {")
+_( "static inline void initfeatures() {")
for (int i = 0; i < nfeatures; ++i) { // N.B.: this *should* be 0-indexed!
const char *else_ = "";
s16 mod = feat_initorder[i];
@@ -825,7 +825,7 @@ _( " con_colourmsg(&white, \"---- List of plugin features ---\\n\");");
recursefeatdescs(out, featdescs);
_( "}")
_( "")
-_( "static inline void endfeatures(void) {")
+_( "static inline void endfeatures() {")
for (int i = nfeatures - 1; i >= 0; --i) {
s16 mod = feat_initorder[i];
if (mod_flags[mod] & HAS_END) {
@@ -836,7 +836,7 @@ F( " if (has_%.*s) _feat_end_%.*s();",
}
_( "}")
_( "")
-_( "static inline void freevars(void) {")
+_( "static inline void freevars() {")
for (int i = 1; i < ncvars; ++i) {
F( " extfree(%.*s->strval);", cvar_names[i].len, cvar_names[i].s)
}
diff --git a/src/build/mkentprops.c b/src/build/mkentprops.c
index 3df21ed..802aeaf 100644
--- a/src/build/mkentprops.c
+++ b/src/build/mkentprops.c
@@ -56,7 +56,7 @@ static int art_nnodes = 0;
#define ART_NULL ((u16)-1)
-static inline int art_newnode(void) {
+static inline int art_newnode() {
if (art_nnodes == ART_MAXNODES) die(2, "out of tree nodes");
return art_nnodes++;
}
@@ -78,7 +78,7 @@ static u16 nclasses = 0; // similar short circuit for ServerClasses
static int decls[MAXDECLS];
static int ndecls = 0;
-static inline int art_newleaf(void) {
+static inline int art_newleaf() {
if (art_nleaves == ART_MAXLEAVES) die(2, "out of leaf nodes");
return art_nleaves++;
}
@@ -239,7 +239,7 @@ static inline void parse(const os_char *file, int len) {
}
}
-static inline noreturn diewrite(void) { die(100, "couldn't write to file"); }
+static inline noreturn diewrite() { die(100, "couldn't write to file"); }
#define _(x) if (fprintf(out, "%s\n", x) < 0) diewrite();
#define _i(x) for (int i = 0; i < indent; ++i) fputc('\t', out); _(x)
#define F(f, ...) if (fprintf(out, f "\n", __VA_ARGS__) < 0) diewrite();
diff --git a/src/build/mkgamedata.c b/src/build/mkgamedata.c
index ed8cf97..2f9c0cb 100644
--- a/src/build/mkgamedata.c
+++ b/src/build/mkgamedata.c
@@ -147,7 +147,7 @@ static void parse(int file, char *s, int len) {
}
}
-static inline noreturn diewrite(void) { die(100, "couldn't write to file"); }
+static inline noreturn diewrite() { die(100, "couldn't write to file"); }
#define _(x) if (fprintf(out, "%s\n", x) < 0) diewrite();
#define _i(x) for (int i = 0; i < indent; ++i) fputc('\t', out); _(x)
#define F(f, ...) if (fprintf(out, f "\n", __VA_ARGS__) < 0) diewrite();
@@ -227,7 +227,7 @@ F( "int %s = -2147483648;", sbase + tags[i])
}
static inline void init(FILE *out) {
-_( "static void initgamedata(void) {")
+_( "static void initgamedata() {")
int varidx;
int indent = 0;
for (int i = 0; i < nents; ++i) {
diff --git a/src/con_.c b/src/con_.c
index 1f306b8..9041e49 100644
--- a/src/con_.c
+++ b/src/con_.c
@@ -320,7 +320,7 @@ static int vtidx_SetValue_str = 2, vtidx_SetValue_f = 1, vtidx_SetValue_i = 0;
enum { vtidx_SetValue_str = 0, vtidx_SetValue_f = 1, vtidx_SetValue_i = 2 };
#endif
-void con_init(void) {
+void con_init() {
_con_colourmsgf = VFUNC(_con_iface, ConsoleColorPrintf);
dllid = AllocateDLLIdentifier(_con_iface);
@@ -400,7 +400,7 @@ static void helpuserhelpus(int pluginver, char ifaceverchar) {
// note: for now at least, not using errmsg_*() macros here because it doesn't
// really make sense for these messages to be coming from "con"
-static void warnoe(void) {
+static void warnoe() {
con_warn("sst: error: this engine version is not yet supported\n");
}
@@ -459,7 +459,7 @@ bool con_detect(int pluginver) {
return false;
}
-void con_disconnect(void) {
+void con_disconnect() {
UnregisterConCommands(_con_iface, dllid);
}
diff --git a/src/con_.h b/src/con_.h
index dc06335..de5e439 100644
--- a/src/con_.h
+++ b/src/con_.h
@@ -70,7 +70,7 @@ enum {
typedef void (*con_cmdcb)(const struct con_cmdargs *cmd);
/* Obsolete callback; not used by SST, but might still exist in the engine. */
-typedef void (*con_cmdcbv1)(void);
+typedef void (*con_cmdcbv1)();
/*
* This is an autocompletion callback for suggesting arguments to a command.
@@ -81,8 +81,8 @@ typedef int (*con_complcb)(const char *part,
/* These are called on plugin load/unload. They should not be used elsewhere. */
bool con_detect(int pluginver);
-void con_init(void);
-void con_disconnect(void);
+void con_init();
+void con_disconnect();
/*
* These types *pretty much* match those in the engine. Their fields can be
diff --git a/src/democustom.c b/src/democustom.c
index 749415b..c053371 100644
--- a/src/democustom.c
+++ b/src/democustom.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 2024 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -87,7 +87,7 @@ void democustom_write(const void *buf, int len) {
bitbuf_reset(&bb);
}
-static bool find_WriteMessages(void) {
+static bool find_WriteMessages() {
const uchar *insns = (*(uchar ***)demorecorder)[vtidx_RecordPacket];
// RecordPacket calls WriteMessages right away, so just look for a call
for (const uchar *p = insns; p - insns < 32;) {
diff --git a/src/demorec.c b/src/demorec.c
index 66ffa1d..039b24e 100644
--- a/src/demorec.c
+++ b/src/demorec.c
@@ -52,8 +52,8 @@ bool demorec_forceauto = false;
#define SIGNONSTATE_SPAWN 5
#define SIGNONSTATE_FULL 6
-DEF_PREDICATE(DemoControlAllowed, void)
-DEF_EVENT(DemoRecordStarting, void)
+DEF_PREDICATE(DemoControlAllowed)
+DEF_EVENT(DemoRecordStarting)
DEF_EVENT(DemoRecordStopped, int)
typedef void (*VCALLCONV SetSignonState_func)(void *, int);
@@ -169,7 +169,7 @@ static void hook_stop_cb(const struct con_cmdargs *args) {
wantstop = false;
}
-static inline bool find_demorecorder(void) {
+static inline bool find_demorecorder() {
#ifdef _WIN32
const uchar *insns = (const uchar *)orig_stop_cb;
// The stop command loads `demorecorder` into ECX to call IsRecording()
@@ -241,7 +241,7 @@ bool demorec_start(const char *name) {
return *recording;
}
-int demorec_stop(void) {
+int demorec_stop() {
// note: our set-to-0-and-back hack actually has the nice side effect of
// making this correct when recording and stopping in the menu lol
int ret = *demonum;
@@ -250,7 +250,7 @@ int demorec_stop(void) {
return ret;
}
-int demorec_demonum(void) {
+int demorec_demonum() {
return *recording ? *demonum : -1;
}
diff --git a/src/demorec.h b/src/demorec.h
index b53896f..0896a9d 100644
--- a/src/demorec.h
+++ b/src/demorec.h
@@ -1,6 +1,6 @@
/*
* Copyright © 2021 Willian Henrique <wsimanbrazil@yahoo.com.br>
- * Copyright © 2023 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -55,14 +55,14 @@ bool demorec_start(const char *name);
* have the _N.dem suffixes). Value will be zero if the recording is stopped
* before the game has even gotten a chance to create the first demo file.
*/
-int demorec_stop(void);
+int demorec_stop();
/*
* Returns the current number in the recording sequence, or -1 if not recording.
* Value may be 0 if recording was requested but has yet to start (say, because
* we have yet to join a map).
*/
-int demorec_demonum(void);
+int demorec_demonum();
/*
* Used to determine whether to allow usage of the normal record and stop
diff --git a/src/engineapi.c b/src/engineapi.c
index 62a4eb1..a8f4167 100644
--- a/src/engineapi.c
+++ b/src/engineapi.c
@@ -118,7 +118,7 @@ bool engineapi_init(int pluginver) {
return true;
}
-void engineapi_lateinit(void) {
+void engineapi_lateinit() {
// from AM L4D2 SDK headers:
// > SENDPROP_VECTORELEM makes [the offset] negative to start with so we
// > can detect that and set the SPROP_IS_VECTOR_ELEM flag.
diff --git a/src/engineapi.h b/src/engineapi.h
index 308e34e..6865311 100644
--- a/src/engineapi.h
+++ b/src/engineapi.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2024 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -196,7 +196,7 @@ bool engineapi_init(int pluginver);
* Called right before deferred feature initialisation to set up some additional
* (nonessential) core stuff - currently this means entprops data.
*/
-void engineapi_lateinit(void);
+void engineapi_lateinit();
#endif
diff --git a/src/errmsg.h b/src/errmsg.h
index cdf5095..80628cd 100644
--- a/src/errmsg.h
+++ b/src/errmsg.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2024 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -66,8 +66,8 @@ extern const char msg_note[], msg_warn[], msg_error[];
#define _errmsg_dl _errmsg_sys
#else
#define _errmsg_sys _errmsg_std
-static inline const char *_errmsg_dlerror(void) {
- char *dlerror(void);
+static inline const char *_errmsg_dlerror() {
+ char *dlerror();
const char *e = dlerror();
if (!e) return "Unknown error"; // just in case, better avoid weirdness!
return e;
diff --git a/src/feature.h b/src/feature.h
index 81370b1..7bab860 100644
--- a/src/feature.h
+++ b/src/feature.h
@@ -124,14 +124,14 @@ enum {
* Features which either fail to initialise or elect to skip loading will cause
* dependent features not to be enabled.
*/
-#define INIT int _FEATURE_CAT(_feat_init_, MODULE_NAME)(void) // { code... }
+#define INIT int _FEATURE_CAT(_feat_init_, MODULE_NAME)() // { code... }
/*
* Defines the special, optional feature shutdown function which is unique to
* this translation unit. This does not return a value, and may be either
* specified once, or left out if no cleanup is required for this feature.
*/
-#define END void _FEATURE_CAT(_feat_end_, MODULE_NAME)(void) // { code... }
+#define END void _FEATURE_CAT(_feat_end_, MODULE_NAME)() // { code... }
/*
* Defines a special feature pre-init function which performs early feature
@@ -154,7 +154,7 @@ enum {
* REQUIRE_GAMEDATA and REQUIRE_GLOBAL, however these only apply to the INIT
* block, *NOT* the PREINIT.
*/
-#define PREINIT int _FEATURE_CAT(_feat_preinit_, MODULE_NAME)(void) // {...}
+#define PREINIT int _FEATURE_CAT(_feat_preinit_, MODULE_NAME)() // {...}
#endif
diff --git a/src/fixes.c b/src/fixes.c
index dbb60f5..e6432c3 100644
--- a/src/fixes.c
+++ b/src/fixes.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 2024 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
* Copyright © 2023 Hayden K <imaciidz@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -44,7 +44,7 @@ static void chcmdflags(const char *name, int unset, int set) {
if (v) v->base.flags = v->base.flags & ~unset | set;
}
-static void generalfixes(void) {
+static void generalfixes() {
// Expose all the demo stuff, for games like L4D that hide it for some
// reason.
unhide("demo_debug");
@@ -104,7 +104,7 @@ static void generalfixes(void) {
}
}
-static void l4d2specific(void) {
+static void l4d2specific() {
// L4D2 doesn't let you set sv_cheats in lobbies, but turns out it skips all
// the lobby checks if this random command is developer-only, presumably
// because that flag is compiled out in debug builds and devs want to be
@@ -163,7 +163,7 @@ e:
chcmdflags("cl_fullupdate", CON_CHEAT, 0);
}
-static void l4d1specific(void) {
+static void l4d1specific() {
// For some reason, L4D1 hides mat_monitorgamma and doesn't archive it.
// This means on every startup it's necessary to manually set non-default
// values via the menu. This change here brings it in line with pretty much
@@ -186,7 +186,7 @@ static void l4d1specific(void) {
chcmdflags("update_addon_paths", 0, CON_CCMDEXEC);
}
-static void portal1specific(void) {
+static void portal1specific() {
#ifdef _WIN32
// TODO(compat): this is an absolutely atrocious way to implement this. it
// should only be temporary in the interests of getting 4104 working right
@@ -210,7 +210,7 @@ static void portal1specific(void) {
#endif
}
-void fixes_apply(void) {
+void fixes_apply() {
generalfixes();
if (GAMETYPE_MATCHES(L4D1)) l4d1specific();
else if (GAMETYPE_MATCHES(L4D2x)) l4d2specific();
diff --git a/src/fixes.h b/src/fixes.h
index ae863a8..1c1f127 100644
--- a/src/fixes.h
+++ b/src/fixes.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2022 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -18,6 +18,6 @@
* Makes a best-effort attempt to fix up random bugs and annoyances in some
* games. If anything fails, it's just ignored.
*/
-void fixes_apply(void);
+void fixes_apply();
// vi: sw=4 ts=4 noet tw=80 cc=80
diff --git a/src/gameinfo.c b/src/gameinfo.c
index 21205b7..c5bd36c 100644
--- a/src/gameinfo.c
+++ b/src/gameinfo.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 2024 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -41,7 +41,7 @@ const char *gameinfo_title = title;
DECL_VFUNC_DYN(const char *, GetGameDirectory)
-bool gameinfo_init(void) {
+bool gameinfo_init() {
if_cold (!has_vtidx_GetGameDirectory) {
errmsg_errorx("unsupported VEngineClient interface");
return false;
diff --git a/src/gameinfo.h b/src/gameinfo.h
index 76c3c57..3de2fa9 100644
--- a/src/gameinfo.h
+++ b/src/gameinfo.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2023 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -27,7 +27,7 @@ extern const os_char *gameinfo_gamedir; /* Absolute path to game directory */
extern const char *gameinfo_title; /* Name of the game (window title) */
/* Called early in plugin initialisation to set up the variables above. */
-bool gameinfo_init(void);
+bool gameinfo_init();
#endif
diff --git a/src/gameserver.c b/src/gameserver.c
index c2df33f..1c31466 100644
--- a/src/gameserver.c
+++ b/src/gameserver.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 2024 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -32,7 +32,7 @@ DECL_VFUNC_DYN(int, GetSpawnCount)
static void *sv;
-int gameserver_spawncount(void) { return GetSpawnCount(sv); }
+int gameserver_spawncount() { return GetSpawnCount(sv); }
static bool find_sv(con_cmdcb pause_cb) {
#ifdef _WIN32
diff --git a/src/gameserver.h b/src/gameserver.h
index f27ad5c..a8fe085 100644
--- a/src/gameserver.h
+++ b/src/gameserver.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2023 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -21,7 +21,7 @@
* Returns the spawn count / server number which the engine increments every new
* map. Can be used to help keep track of map changes, disconnects and such.
*/
-int gameserver_spawncount(void);
+int gameserver_spawncount();
#endif
diff --git a/src/hook.c b/src/hook.c
index 9e5d694..056db88 100644
--- a/src/hook.c
+++ b/src/hook.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 2024 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
* Copyright © 2022 Willian Henrique <wsimanbrazil@yahoo.com.br>
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -45,7 +45,7 @@ __declspec(align(4096))
static uchar trampolines[4096];
static uchar *nexttrampoline = trampolines;
-bool hook_init(void) {
+bool hook_init() {
// PE doesn't support rwx sections, not sure about ELF. Meh, just set it
// here instead.
return os_mprot(trampolines, sizeof(trampolines), PAGE_EXECUTE_READWRITE);
diff --git a/src/hook.h b/src/hook.h
index 700adc9..5b2271e 100644
--- a/src/hook.h
+++ b/src/hook.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2023 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -19,7 +19,7 @@
#include "intdefs.h"
-bool hook_init(void);
+bool hook_init();
/*
* Replaces a vtable entry with a target function and returns the original
diff --git a/src/hud.c b/src/hud.c
index 1e3c544..f95acbc 100644
--- a/src/hud.c
+++ b/src/hud.c
@@ -58,7 +58,7 @@ REQUIRE_GAMEDATA(vtidx_GetIScheme)
// IScheme
REQUIRE_GAMEDATA(vtidx_GetFont)
-DEF_EVENT(HudPaint, void)
+DEF_EVENT(HudPaint)
// we just use ulongs for API, but keep a struct for vcalls to ensure we get the
// right calling convention (x86 Windows/MSVC is funny about passing structs...)
diff --git a/src/inputhud.c b/src/inputhud.c
index da96d5e..0dd4f11 100644
--- a/src/inputhud.c
+++ b/src/inputhud.c
@@ -310,7 +310,7 @@ static const char *const fontnames[] = {
};
static struct { ulong h; int sz; } fonts[countof(fontnames)];
-HANDLE_EVENT(HudPaint, void) {
+HANDLE_EVENT(HudPaint) {
if (!con_getvari(sst_inputhud)) return;
int screenw, screenh;
hud_screensize(&screenw, &screenh);
diff --git a/src/kvsys.c b/src/kvsys.c
index bc9230e..fdd411e 100644
--- a/src/kvsys.c
+++ b/src/kvsys.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 2024 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
* Copyright © 2024 Willian Henrique <wsimanbrazil@yahoo.com.br>
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -32,7 +32,7 @@
FEATURE()
-void *KeyValuesSystem(void); // vstlib symbol
+void *KeyValuesSystem(); // vstlib symbol
static void *kvs;
static int vtidx_GetSymbolForString = 3, vtidx_GetStringForSymbol = 4;
static bool iskvv2 = false;
diff --git a/src/l4dmm.c b/src/l4dmm.c
index 40e6fd5..8d831fe 100644
--- a/src/l4dmm.c
+++ b/src/l4dmm.c
@@ -59,7 +59,7 @@ static union { // space saving
static int sym_chapter;
static char campaignbuf[32];
-const char *l4dmm_curcampaign(void) {
+const char *l4dmm_curcampaign() {
#ifdef _WIN32
if (!matchfwk) { // we must have oldmmiface, then
struct contextval *ctxt = unknown_contextlookup(oldmmiface,
@@ -96,7 +96,7 @@ const char *l4dmm_curcampaign(void) {
return ret;
}
-bool l4dmm_firstmap(void) {
+bool l4dmm_firstmap() {
#ifdef _WIN32
if (!matchfwk) { // we must have oldmmiface, then
struct contextval *ctxt = unknown_contextlookup(oldmmiface,
diff --git a/src/l4dmm.h b/src/l4dmm.h
index 7af0982..c319a49 100644
--- a/src/l4dmm.h
+++ b/src/l4dmm.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2023 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -25,13 +25,13 @@
* Returns null if no map is loaded (or the relevant metadata is somehow
* missing).
*/
-const char *l4dmm_curcampaign(void);
+const char *l4dmm_curcampaign();
/*
* Returns true if the current map is known to be the first map of a campaign,
* false otherwise.
*/
-bool l4dmm_firstmap(void);
+bool l4dmm_firstmap();
#endif
diff --git a/src/l4dreset.c b/src/l4dreset.c
index 8333839..411f666 100644
--- a/src/l4dreset.c
+++ b/src/l4dreset.c
@@ -87,7 +87,7 @@ static struct CVoteIssue *getissue(const char *textkey) {
}
}
-static inline void reset(void) {
+static inline void reset() {
// reset the vote cooldowns if possible (will skip L4D1). only necessary on
// versions >2045 and on map 1, but it's easiest to do unconditionally.
// This is equivalent to CUtlVector::RemoveAll() as there's no
diff --git a/src/l4dwarp.c b/src/l4dwarp.c
index eb638e4..fa50c17 100644
--- a/src/l4dwarp.c
+++ b/src/l4dwarp.c
@@ -293,7 +293,7 @@ static bool find_EntityPlacementTest(con_cmdcb z_add_cb) {
return false;
}
-static bool init_filter(void) {
+static bool init_filter() {
const uchar *insns = (const uchar *)EntityPlacementTest;
for (const uchar *p = insns; p - insns < 0x60;) {
if (p[0] == X86_CALL) {
diff --git a/src/os.c b/src/os.c
index e6d32e8..3fd5d66 100644
--- a/src/os.c
+++ b/src/os.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 2024 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2025 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -35,7 +35,7 @@
#ifdef _WIN32
-int os_lasterror(void) { return GetLastError(); }
+int os_lasterror() { return GetLastError(); }
// N.B. file handle values are 32-bit, even in 64-bit builds. I'm not crazy!
@@ -108,7 +108,7 @@ bool os_mprot(void *addr, int len, int mode) {
#else
-int os_lasterror(void) { return errno; }
+int os_lasterror() { return errno; }
int os_open_read(const char *path) {
return open(path, O_RDONLY | O_CLOEXEC);
diff --git a/src/os.h b/src/os.h
index ca376b7..cb78e06 100644
--- a/src/os.h
+++ b/src/os.h
@@ -131,7 +131,7 @@ static inline void os_spancopy(os_char *restrict dest,
* For standard libc functions (implemented by UCRT on Windows), the value of
* errno should be used directly instead.
*/
-int os_lasterror(void);
+int os_lasterror();
/*
* Opens a file for reading. Returns an OS-specific file handle, or -1 on error.
diff --git a/src/sst.c b/src/sst.c
index 726fe2d..d8a9b09 100644
--- a/src/sst.c
+++ b/src/sst.c
@@ -61,7 +61,7 @@ bool sst_userunloaded = false; // see hook_plugin_unload_cb() below
#ifdef _WIN32
extern long __ImageBase; // this is actually the PE header struct but don't care
-static inline void *ownhandle(void) { return &__ImageBase; }
+static inline void *ownhandle() { return &__ImageBase; }
#else
// sigh, _GNU_SOURCE crap. define here instead >:(
typedef struct {
@@ -71,7 +71,7 @@ typedef struct {
void *dli_saddr;
} Dl_info;
int dladdr1(const void *addr, Dl_info *info, void **extra_info, int flags);
-static void *ownhandle(void) {
+static void *ownhandle() {
static void *cached = 0;
Dl_info dontcare;
if_cold (!cached) {
@@ -287,7 +287,7 @@ static const char *const featmsgs[] = { // "
" [ FAILED! ] %s (failed to access engine)\n"
};
-static inline void successbanner(void) { // called by generated code
+static inline void successbanner() { // called by generated code
con_colourmsg(&(struct rgba){64, 255, 64, 255},
LONGNAME " v" VERSION " successfully loaded");
con_colourmsg(&(struct rgba){255, 255, 255, 255}, " for game ");
@@ -296,7 +296,7 @@ static inline void successbanner(void) { // called by generated code
#include <glue.gen.h> // generated by build/gluegen.c
-static void do_featureinit(void) {
+static void do_featureinit() {
engineapi_lateinit();
// load libs that might not be there early (...at least on Linux???)
clientlib = os_dlhandle(OS_LIT("client") OS_LIT(OS_DLSUFFIX));
@@ -361,7 +361,7 @@ DECL_VFUNC_DYN(bool, VGuiIsInitialized)
// startup, in order to init the features properly.
//
// Route credit to bill for helping figure a lot of this out - mike
-static bool deferinit(void) {
+static bool deferinit() {
if_cold (!vgui) {
errmsg_warnx("can't use VEngineVGui for deferred feature setup");
goto e;
@@ -388,8 +388,8 @@ e: con_warn("!!! SOME FEATURES MAY BE BROKEN !!!\n");
}
DEF_PREDICATE(AllowPluginLoading, bool)
-DEF_EVENT(PluginLoaded, void)
-DEF_EVENT(PluginUnloaded, void)
+DEF_EVENT(PluginLoaded)
+DEF_EVENT(PluginUnloaded)
static struct con_cmd *cmd_plugin_load, *cmd_plugin_unload;
static con_cmdcb orig_plugin_load_cb, orig_plugin_unload_cb;
@@ -473,7 +473,7 @@ static bool do_load(ifacefactory enginef, ifacefactory serverf) {
return true;
}
-static void do_unload(void) {
+static void do_unload() {
// slow path: reloading shouldn't happen all the time, prioritise fast exit
if_cold (sst_userunloaded) { // note: if we're here, pluginhandler is set
cmd_plugin_load->cb = orig_plugin_load_cb;
diff --git a/src/xhair.c b/src/xhair.c
index 30fc69b..1f9d1a6 100644
--- a/src/xhair.c
+++ b/src/xhair.c
@@ -54,7 +54,7 @@ static inline void drawrect(int x0, int y0, int x1, int y1, struct rgba colour,
if (outline) hud_drawrect(x0, y0, x1, y1, (struct rgba){.a = 255}, false);
}
-HANDLE_EVENT(HudPaint, void) {
+HANDLE_EVENT(HudPaint) {
if (!con_getvari(sst_xhair)) return;
if (has_vtidx_IsInGame && engclient && !IsInGame(engclient)) return;
int w, h;