From 8a669bc96ffdb9d0f6f54e464da11e3375c80a55 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 17 Apr 2025 01:39:10 +0100 Subject: Add type-safety to virtual calls and accessors This probably should have been the design from the start. It's still possible to use void pointers, and this is done in a couple of places for simplicity, but wherever possible, we have actual structs for things now. Additionally, in places where vtables are fiddled with, e.g. vtable hooks, we have actual struct definitions with vtable pointers so there's need for pointer-casting horror. --- src/gameinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gameinfo.c') diff --git a/src/gameinfo.c b/src/gameinfo.c index 7432073..a3f4eac 100644 --- a/src/gameinfo.c +++ b/src/gameinfo.c @@ -39,7 +39,7 @@ const os_char *gameinfo_gamedir ; const char *gameinfo_title = title; -DECL_VFUNC_DYN(const char *, GetGameDirectory) +DECL_VFUNC_DYN(struct VEngineClient, const char *, GetGameDirectory) bool gameinfo_init() { if_cold (!has_vtidx_GetGameDirectory) { -- cgit v1.2.3-54-g00ecf