summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-04-18 14:00:13 +0200
committerAlejandro Colomar <alx@kernel.org>2024-04-18 14:00:13 +0200
commita29abf9bb7d4c783da9a766e8d10feae7d8f5862 (patch)
tree09723ac78d77e4ee1513bb28116df71b120286a6
parent1f993c0cdebec0085c916260f62935d994437863 (diff)
include/a2i/strtoi.h: Remove helper macro
Keep it simpler. Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--include/a2i/strtoi.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/include/a2i/strtoi.h b/include/a2i/strtoi.h
index 9e4a1c2..ce6f8f0 100644
--- a/include/a2i/strtoi.h
+++ b/include/a2i/strtoi.h
@@ -17,15 +17,6 @@
#include <a2i/qual.h>
-#define a2i_strtoImax(TYPE, ...) \
-( \
- _Generic((TYPE) 0, \
- intmax_t: strtoimax, \
- uintmax_t: strtoumax \
- )(__VA_ARGS__) \
-)
-
-
#define a2i_strtoI(TYPE, s, endp, base, min, max, status) \
({ \
const char *s_ = s; \
@@ -51,7 +42,10 @@
} else { \
errno_saved_ = errno; \
errno = 0; \
- n_ = a2i_strtoImax(TYPE, s_, endp_, base_); \
+ n_ = _Generic((TYPE) 0, \
+ intmax_t: strtoimax, \
+ uintmax_t: strtoumax \
+ )(s_, endp_, base_); \
\
if (*endp_ == s_) \
*status_ = ECANCELED; \