From 1765c26f60e11a7ca505631c05528d7da9bd906e Mon Sep 17 00:00:00 2001 From: Rick Bird Date: Tue, 19 Apr 2011 03:07:04 -0400 Subject: [PATCH] Renamed FUNCRET to FUNCPTR considering it doesn't actually get a return. It just returns a PTR to be used to call a module function to get a return value. --- hdrs/modules.h | 2 +- src/modules.c | 8 ++------ src/utils.c | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/hdrs/modules.h b/hdrs/modules.h index d4b5500..dfc2f94 100644 --- a/hdrs/modules.h +++ b/hdrs/modules.h @@ -39,6 +39,6 @@ int modules_shutdown(void); h(); \ } -#define MODULE_FUNCRET(var, m, func) *((void **) (&var)) = lt_dlsym(m, func) +#define MODULE_FUNCPTR(var, m, func) *((void **) (&var)) = lt_dlsym(m, func) #endif /* _MODULES_H_ */ diff --git a/src/modules.c b/src/modules.c index a687103..9e538df 100644 --- a/src/modules.c +++ b/src/modules.c @@ -20,10 +20,6 @@ struct module_entry_t *module_list = NULL; -/* Function utility pointer for module system macros. - * This gets us through the ISO C warnings about our posix compliance issues. - **/ - /* Ads a module entry and returns */ struct module_entry_t *module_entry_add(char *name) { struct module_entry_t *entry; @@ -92,7 +88,7 @@ int module_open(char *path, char *name) { } /* Some OSes may need symbols to be prefixed with _.. Will need to look into autoconfig code for this */ - MODULE_FUNCRET(module_loader, handle, "module_load"); + MODULE_FUNCPTR(module_loader, handle, "module_load"); if(!module_loader) { do_rawlog(LT_ERR, "Error Loading Module: Could not call module_load | %s", file); @@ -106,7 +102,7 @@ int module_open(char *path, char *name) { } module->handle = handle; module->load = module_loader; - MODULE_FUNCRET(module->unload, handle, "module_unload"); + MODULE_FUNCPTR(module->unload, handle, "module_unload"); /* Grab info and version from module & put it in */ /* Success.. Call the module */ diff --git a/src/utils.c b/src/utils.c index 148f934..caefcdb 100644 --- a/src/utils.c +++ b/src/utils.c @@ -889,7 +889,7 @@ can_interact(dbref from, dbref to, int type) /* This function can override standard checks! */ /* This doohicky is the replacement for local_can_interact_first */ MODULE_ITER(m) { - MODULE_FUNCRET(handle, m->handle, "module_can_interact_first"); + MODULE_FUNCPTR(handle, m->handle, "module_can_interact_first"); if (handle) { if ((lci = handle(from, to , type)) != NOTHING) return lci; @@ -913,7 +913,7 @@ can_interact(dbref from, dbref to, int type) return 1; MODULE_ITER(m) { - MODULE_FUNCRET(handle, m->handle, "module_can_interact_last"); + MODULE_FUNCPTR(handle, m->handle, "module_can_interact_last"); if (handle) { if ((lci = handle(from, to , type)) != NOTHING) return lci; -- 2.30.2