From 0fdf9b3ed716a8baf048e7e302c4d9e727999df2 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 30 Dec 2025 20:29:48 +0000 Subject: Size-optimise a little more, and tweak minor stuff This isn't really making a difference right now but maybe it will in future builds with different section padding or LTO optimiser interactions or whatever. --- src/sst.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/sst.c') diff --git a/src/sst.c b/src/sst.c index f5f61bd..e732073 100644 --- a/src/sst.c +++ b/src/sst.c @@ -466,7 +466,7 @@ enum unload_action { UNLOAD_SELF, UNLOAD_OTHER }; -static int hook_plugin_unload_common(int argc, const char **argv) { +static opt_small int hook_plugin_unload_common(int argc, const char **argv) { if (argc > 1) { if (!CHECK_AllowPluginLoading(false)) return UNLOAD_SKIP; if (!*argv[1]) { @@ -513,7 +513,7 @@ static int hook_plugin_unload_common(int argc, const char **argv) { return UNLOAD_OTHER; } -static void hook_plugin_unload_cbv1() { +static opt_small void hook_plugin_unload_cbv1() { extern int *_con_argc; extern const char **_con_argv; int action = hook_plugin_unload_common(*_con_argc, _con_argv); @@ -527,7 +527,7 @@ static void hook_plugin_unload_cbv1() { EMIT_PluginUnloaded(); } } -static void hook_plugin_unload_cbv2(struct con_cmdargs *args) { +static opt_small void hook_plugin_unload_cbv2(struct con_cmdargs *args) { int action = hook_plugin_unload_common(args->argc, args->argv); switch_exhaust_enum(unload_action, action) { case UNLOAD_SKIP: @@ -540,7 +540,7 @@ static void hook_plugin_unload_cbv2(struct con_cmdargs *args) { } } -static bool do_load(ifacefactory enginef, ifacefactory serverf) { +static inline bool do_load(ifacefactory enginef, ifacefactory serverf) { factory_engine = enginef; factory_server = serverf; if_cold (!engineapi_init(ifacever)) return false; if (GAMETYPE_MATCHES(OE)) shuntvars(); // see also comment in con_detect() @@ -574,7 +574,7 @@ static bool do_load(ifacefactory enginef, ifacefactory serverf) { return true; } -static void do_unload() { +static inline 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 unhook_plugin_load_cb(cmd_plugin_load); -- cgit v1.2.3-54-g00ecf