diff --git a/lib/atoi/a2i/a2s.h b/lib/atoi/a2i/a2s.h index 935e109a9..f47e4d1f6 100644 --- a/lib/atoi/a2i/a2s.h +++ b/lib/atoi/a2i/a2s.h @@ -8,49 +8,13 @@ #include -#include "atoi/a2i/a2s_c.h" -#include "atoi/a2i/a2s_nc.h" - - -#define a2sh(n, s, ...) \ -( \ - _Generic(s, \ - const char *: a2sh_c, \ - const void *: a2sh_c, \ - char *: a2sh_nc, \ - void *: a2sh_nc \ - )(n, s, __VA_ARGS__) \ -) - -#define a2si(n, s, ...) \ -( \ - _Generic(s, \ - const char *: a2si_c, \ - const void *: a2si_c, \ - char *: a2si_nc, \ - void *: a2si_nc \ - )(n, s, __VA_ARGS__) \ -) - -#define a2sl(n, s, ...) \ -( \ - _Generic(s, \ - const char *: a2sl_c, \ - const void *: a2sl_c, \ - char *: a2sl_nc, \ - void *: a2sl_nc \ - )(n, s, __VA_ARGS__) \ -) - -#define a2sll(n, s, ...) \ -( \ - _Generic(s, \ - const char *: a2sll_c, \ - const void *: a2sll_c, \ - char *: a2sll_nc, \ - void *: a2sll_nc \ - )(n, s, __VA_ARGS__) \ -) +#include "atoi/a2i/a2i.h" + + +#define a2sh(...) a2i(short, __VA_ARGS__) +#define a2si(...) a2i(int, __VA_ARGS__) +#define a2sl(...) a2i(long, __VA_ARGS__) +#define a2sll(...) a2i(long long, __VA_ARGS__) #endif // include guard diff --git a/lib/atoi/a2i/a2u.h b/lib/atoi/a2i/a2u.h index 2a3852e45..e33129be3 100644 --- a/lib/atoi/a2i/a2u.h +++ b/lib/atoi/a2i/a2u.h @@ -8,49 +8,13 @@ #include -#include "atoi/a2i/a2u_c.h" -#include "atoi/a2i/a2u_nc.h" - - -#define a2uh(n, s, ...) \ -( \ - _Generic(s, \ - const char *: a2uh_c, \ - const void *: a2uh_c, \ - char *: a2uh_nc, \ - void *: a2uh_nc \ - )(n, s, __VA_ARGS__) \ -) - -#define a2ui(n, s, ...) \ -( \ - _Generic(s, \ - const char *: a2ui_c, \ - const void *: a2ui_c, \ - char *: a2ui_nc, \ - void *: a2ui_nc \ - )(n, s, __VA_ARGS__) \ -) - -#define a2ul(n, s, ...) \ -( \ - _Generic(s, \ - const char *: a2ul_c, \ - const void *: a2ul_c, \ - char *: a2ul_nc, \ - void *: a2ul_nc \ - )(n, s, __VA_ARGS__) \ -) - -#define a2ull(n, s, ...) \ -( \ - _Generic(s, \ - const char *: a2ull_c, \ - const void *: a2ull_c, \ - char *: a2ull_nc, \ - void *: a2ull_nc \ - )(n, s, __VA_ARGS__) \ -) +#include "atoi/a2i/a2i.h" + + +#define a2uh(...) a2i(unsigned short, __VA_ARGS__) +#define a2ui(...) a2i(unsigned int, __VA_ARGS__) +#define a2ul(...) a2i(unsigned long, __VA_ARGS__) +#define a2ull(...) a2i(unsigned long long, __VA_ARGS__) #endif // include guard