Avoid void pointer to function pointer casts

This commit is contained in:
Andrew Johnson 2024-06-23 16:02:17 +03:00
parent acc7758335
commit 4b5e033bc8

View file

@ -184,8 +184,7 @@ static JSValue js_printf_internal(JSContext *ctx,
int64_t int64_arg; int64_t int64_arg;
double double_arg; double double_arg;
const char *string_arg; const char *string_arg;
/* Use indirect call to dbuf_printf to prevent gcc warning */ int (*dbuf_printf_fun)(DynBuf *s, const char *fmt, ...) = dbuf_printf;
int (*dbuf_printf_fun)(DynBuf *s, const char *fmt, ...) = (void*)dbuf_printf;
js_std_dbuf_init(ctx, &dbuf); js_std_dbuf_init(ctx, &dbuf);
@ -518,7 +517,7 @@ static JSModuleDef *js_module_loader_so(JSContext *ctx,
goto fail; goto fail;
} }
init = dlsym(hd, "js_init_module"); init = (JSInitModuleFunc *)dlsym(hd, "js_init_module");
if (!init) { if (!init) {
JS_ThrowReferenceError(ctx, "could not load module filename '%s': js_init_module not found", JS_ThrowReferenceError(ctx, "could not load module filename '%s': js_init_module not found",
module_name); module_name);