6 weeks ago
ucx CX_STR fix
ucx/cx/string.h | file | annotate | diff | comparison | revisions |
--- a/ucx/cx/string.h Sun Feb 23 13:11:32 2025 +0100 +++ b/ucx/cx/string.h Sun Feb 23 13:27:27 2025 +0100 @@ -151,7 +151,7 @@ * * @param literal the string literal */ -#define CX_STR(literal) (cxstring){literal, sizeof(literal) - 1} +#define CX_STR(literal) ((cxstring){literal, sizeof(literal) - 1}) #endif @@ -879,7 +879,7 @@ * @see cx_strfree_a() */ #define cx_strdup_a(allocator, string) \ - cx_strdup_a_((allocator), cx_strcast((string))) + cx_strdup_a_((allocator), cx_strcast(string)) /** * Creates a duplicate of the specified string. @@ -894,7 +894,7 @@ * @see cx_strdup_a() * @see cx_strfree() */ -#define cx_strdup(string) cx_strdup_a_(cxDefaultAllocator, string) +#define cx_strdup(string) cx_strdup_a(cxDefaultAllocator, string) /** * Omits leading and trailing spaces. @@ -1091,7 +1091,7 @@ * @return (@c CxStrtokCtx) a new string tokenization context */ #define cx_strtok(str, delim, limit) \ - cx_strtok_(cx_strcast((str)), cx_strcast((delim)), (limit)) + cx_strtok_(cx_strcast(str), cx_strcast(delim), (limit)) /** * Returns the next token.