aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc/compile-layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds-kbdc/compile-layout.c')
-rw-r--r--src/mds-kbdc/compile-layout.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mds-kbdc/compile-layout.c b/src/mds-kbdc/compile-layout.c
index 574f818..011d2d0 100644
--- a/src/mds-kbdc/compile-layout.c
+++ b/src/mds-kbdc/compile-layout.c
@@ -633,20 +633,20 @@ static char32_t* parse_escape(mds_kbdc_tree_t* restrict tree, const char* restri
#define R(LOWER, UPPER) (((LOWER) <= c) && (c <= (UPPER)))
#define CR(COND, LOWER, UPPER) ((*escape == (COND)) && R(LOWER, UPPER))
#define VARIABLE (int)(raw - raw_) - (c == '.'), raw_
-#define RETURN_ERROR(...) \
- do \
- { \
- NEW_ERROR(__VA_ARGS__); \
- error->start = lineoff; \
- error->end = lineoff + (size_t)(raw - raw_); \
- tree->processed = PROCESS_LEVEL; \
- *escape = 0; \
- if (rc) \
- goto done; \
- fail_if (rc = malloc(sizeof(char32_t)), rc == NULL); \
- *rc = -1; \
- goto done; \
- } \
+#define RETURN_ERROR(...) \
+ do \
+ { \
+ NEW_ERROR(__VA_ARGS__); \
+ error->start = lineoff; \
+ error->end = lineoff + (size_t)(raw - raw_); \
+ tree->processed = PROCESS_LEVEL; \
+ *escape = 0; \
+ if (rc) \
+ goto done; \
+ fail_if (xmalloc(rc, 1, char32_t)); \
+ *rc = -1; \
+ goto done; \
+ } \
while (0)
const char* restrict raw_ = raw++;
@@ -900,7 +900,7 @@ static char32_t* parse_unquoted_string(mds_kbdc_tree_t* restrict tree, const cha
else CHAR_ERROR(tree, ERROR, "stray ‘%c’", c);
done:
- fail_if (rc = malloc(2 * sizeof(char32_t)), rc == NULL);
+ fail_if (xmalloc(rc, 2, char32_t));
return rc[0] = buf, rc[1] = -1, rc;
fail: