all repos — hex @ 26c007878803f95adf0d34bff538909b1e4bfcc5

A tiny, minimalist, slightly-esoteric concatenative programming lannguage.

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
commit

26c007878803f95adf0d34bff538909b1e4bfcc5

parent

eaaeed8727ca2c5254b95448e4f73be256c83053

3 files changed, 4 insertions(+), 4 deletions(-)

jump to
M src/hex.csrc/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.hsrc/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.csrc/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)