Fix incompatible function pointer type in hex_set_native_symbol Change parameter from int (*func)() (unspecified params) to int (*func)(hex_context_t *) to match the fn_value struct field and actual symbol function signatures. Fixes -Wincompatible-pointer-types errors on Windows GCC.
h3rald h3rald@h3rald.com
Wed, 04 Mar 2026 21:11:49 +0100
3 files changed,
4 insertions(+),
4 deletions(-)
M
src/hex.c
→
src/hex.c
@@ -263,7 +263,7 @@ void hex_registry_destroy(hex_context_t *ctx);
int hex_valid_user_symbol(hex_context_t *ctx, const char *symbol); int hex_valid_native_symbol(hex_context_t *ctx, const char *symbol); int hex_set_symbol(hex_context_t *ctx, const char *key, hex_item_t *value, int native); -void hex_set_native_symbol(hex_context_t *ctx, const char *name, int (*func)()); +void hex_set_native_symbol(hex_context_t *ctx, const char *name, int (*func)(hex_context_t *)); int hex_get_symbol(hex_context_t *ctx, const char *key, hex_item_t *result); int hex_delete_symbol(hex_context_t *ctx, const char *key);@@ -1218,7 +1218,7 @@
return 0; } -void hex_set_native_symbol(hex_context_t *ctx, const char *name, int (*func)()) +void hex_set_native_symbol(hex_context_t *ctx, const char *name, int (*func)(hex_context_t *)) { hex_item_t *func_item = calloc(1, sizeof(hex_item_t)); if (func_item == NULL)
M
src/hex.h
→
src/hex.h
@@ -260,7 +260,7 @@ void hex_registry_destroy(hex_context_t *ctx);
int hex_valid_user_symbol(hex_context_t *ctx, const char *symbol); int hex_valid_native_symbol(hex_context_t *ctx, const char *symbol); int hex_set_symbol(hex_context_t *ctx, const char *key, hex_item_t *value, int native); -void hex_set_native_symbol(hex_context_t *ctx, const char *name, int (*func)()); +void hex_set_native_symbol(hex_context_t *ctx, const char *name, int (*func)(hex_context_t *)); int hex_get_symbol(hex_context_t *ctx, const char *key, hex_item_t *result); int hex_delete_symbol(hex_context_t *ctx, const char *key);
M
src/registry.c
→
src/registry.c
@@ -218,7 +218,7 @@
return 0; } -void hex_set_native_symbol(hex_context_t *ctx, const char *name, int (*func)()) +void hex_set_native_symbol(hex_context_t *ctx, const char *name, int (*func)(hex_context_t *)) { hex_item_t *func_item = calloc(1, sizeof(hex_item_t)); if (func_item == NULL)