A bit more clang-format

This commit is contained in:
Jasmine Iwanek
2022-11-19 08:49:04 -05:00
parent b04dd8cc8b
commit 3fe4f75108
223 changed files with 8047 additions and 7456 deletions

View File

@@ -25,11 +25,9 @@
#include <86box/86box.h>
#include <86box/plat_dynld.h>
#ifdef ENABLE_DYNLD_LOG
int dynld_do_log = ENABLE_DYNLD_LOG;
static void
dynld_log(const char *fmt, ...)
{
@@ -42,46 +40,44 @@ dynld_log(const char *fmt, ...)
}
}
#else
#define dynld_log(fmt, ...)
# define dynld_log(fmt, ...)
#endif
void *
dynld_module(const char *name, dllimp_t *table)
{
HMODULE h;
HMODULE h;
dllimp_t *imp;
void *func;
void *func;
/* See if we can load the desired module. */
if ((h = LoadLibrary(name)) == NULL) {
dynld_log("DynLd(\"%s\"): library not found! (%08X)\n", name, GetLastError());
return(NULL);
return (NULL);
}
/* Now load the desired function pointers. */
for (imp=table; imp->name!=NULL; imp++) {
for (imp = table; imp->name != NULL; imp++) {
func = GetProcAddress(h, imp->name);
if (func == NULL) {
dynld_log("DynLd(\"%s\"): function '%s' not found! (%08X)\n",
name, imp->name, GetLastError());
FreeLibrary(h);
return(NULL);
return (NULL);
}
/* To overcome typing issues.. */
*(char **)imp->func = (char *)func;
*(char **) imp->func = (char *) func;
}
/* All good. */
dynld_log("loaded %s\n", name);
return((void *)h);
return ((void *) h);
}
void
dynld_close(void *handle)
{
if (handle != NULL)
FreeLibrary((HMODULE)handle);
FreeLibrary((HMODULE) handle);
}