all repos — hex @ 8341f3711a859aee82fff1153942a777f92ca394

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

Refactor inline functions for quotation integrity and stack validation; improves readability and maintains consistency in code style.
h3rald h3rald@h3rald.com
Wed, 10 Sep 2025 18:18:11 +0200
commit

8341f3711a859aee82fff1153942a777f92ca394

parent

fbfe0a5a18c61ce914aa62c64dfad328503eaf5a

3 files changed, 30 insertions(+), 6 deletions(-)

jump to
M src/hex.csrc/hex.c

@@ -386,8 +386,17 @@ #ifdef DEBUG

int hex_validate_quotation_integrity(hex_context_t *ctx, const hex_item_t *item); int hex_debug_validate_stack(hex_context_t *ctx); #else -static inline int hex_validate_quotation_integrity(hex_context_t *ctx, const hex_item_t *item) { (void)ctx; (void)item; return 0; } -static inline int hex_debug_validate_stack(hex_context_t *ctx) { (void)ctx; return 0; } +static inline int hex_validate_quotation_integrity(hex_context_t *ctx, const hex_item_t *item) +{ + (void)ctx; + (void)item; + return 0; +} +static inline int hex_debug_validate_stack(hex_context_t *ctx) +{ + (void)ctx; + return 0; +} #endif // Opcodes

@@ -6805,7 +6814,10 @@ }

int hex_debug_validate_stack(hex_context_t *ctx) { - if (!ctx || !ctx->stack) { return 0; } + if (!ctx || !ctx->stack) + { + return 0; + } for (int i = 0; i <= ctx->stack->top; i++) { hex_item_t *it = ctx->stack->entries[i];
M src/hex.hsrc/hex.h

@@ -383,8 +383,17 @@ #ifdef DEBUG

int hex_validate_quotation_integrity(hex_context_t *ctx, const hex_item_t *item); int hex_debug_validate_stack(hex_context_t *ctx); #else -static inline int hex_validate_quotation_integrity(hex_context_t *ctx, const hex_item_t *item) { (void)ctx; (void)item; return 0; } -static inline int hex_debug_validate_stack(hex_context_t *ctx) { (void)ctx; return 0; } +static inline int hex_validate_quotation_integrity(hex_context_t *ctx, const hex_item_t *item) +{ + (void)ctx; + (void)item; + return 0; +} +static inline int hex_debug_validate_stack(hex_context_t *ctx) +{ + (void)ctx; + return 0; +} #endif // Opcodes
M src/symbols.csrc/symbols.c

@@ -2849,7 +2849,10 @@ }

int hex_debug_validate_stack(hex_context_t *ctx) { - if (!ctx || !ctx->stack) { return 0; } + if (!ctx || !ctx->stack) + { + return 0; + } for (int i = 0; i <= ctx->stack->top; i++) { hex_item_t *it = ctx->stack->entries[i];