# HG changeset patch # User Josef 'Jeff' Sipek # Date 1609350212 18000 # Node ID 18a4409b6f883d00d8b68c9fcedf03d147ca388b # Parent 93d6c996250f959d9aa1d4fa23aa3a7ffcd9e7ab val: str/sym VAL_* macros should assert on error This is consistent with the rest of the API. Signed-off-by: Josef 'Jeff' Sipek diff -r 93d6c996250f -r 18a4409b6f88 include/jeffpc/val.h --- a/include/jeffpc/val.h Wed Dec 30 10:34:10 2020 -0500 +++ b/include/jeffpc/val.h Wed Dec 30 12:43:32 2020 -0500 @@ -435,15 +435,15 @@ #define VAL_ALLOC_SYM(s) sym_cast_to_val(SYM_ALLOC(s)) #define STR_ALLOC_STATIC(s) _VAL_ALLOC(struct str, str_alloc_static(s)) #define SYM_ALLOC_STATIC(s) _VAL_ALLOC(struct sym, sym_alloc_static(s)) -#define VAL_ALLOC_STR_STATIC(s) str_cast_to_val(str_alloc_static(s)) -#define VAL_ALLOC_SYM_STATIC(s) sym_cast_to_val(sym_alloc_static(s)) +#define VAL_ALLOC_STR_STATIC(s) str_cast_to_val(STR_ALLOC_STATIC(s)) +#define VAL_ALLOC_SYM_STATIC(s) sym_cast_to_val(SYM_ALLOC_STATIC(s)) #define STR_DUP(s) _VAL_ALLOC(struct str, str_dup(s)) #define SYM_DUP(s) _VAL_ALLOC(struct sym, sym_dup(s)) -#define VAL_DUP_STR(s) str_cast_to_val(str_dup(s)) -#define VAL_DUP_SYM(s) sym_cast_to_val(sym_dup(s)) +#define VAL_DUP_STR(s) str_cast_to_val(STR_DUP(s)) +#define VAL_DUP_SYM(s) sym_cast_to_val(SYM_DUP(s)) #define STR_DUP_LEN(s, l) _VAL_ALLOC(struct str, str_dup_len((s), (l))) #define SYM_DUP_LEN(s, l) _VAL_ALLOC(struct sym, sym_dup_len((s), (l))) -#define VAL_DUP_STR_LEN(s, l) str_cast_to_val(str_dup_len((s), (l))) -#define VAL_DUP_SYM_LEN(s, l) sym_cast_to_val(sym_dup_len((s), (l))) +#define VAL_DUP_STR_LEN(s, l) str_cast_to_val(STR_DUP_LEN((s), (l))) +#define VAL_DUP_SYM_LEN(s, l) sym_cast_to_val(SYM_DUP_LEN((s), (l))) #endif