X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/62fa1dac8cf3098d212c0e8f4b3cc2cadaddd4c5..HEAD:/src/intconv.h diff --git a/src/intconv.h b/src/intconv.h index 17644f2..6cc7819 100644 --- a/src/intconv.h +++ b/src/intconv.h @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Nick Bowler + * Copyright © 2023-2024 Nick Bowler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,6 @@ #include #include -#include enum { INTCONV_OCTAL = 8, INTCONV_DECIMAL = 10, INTCONV_HEXADECIMAL = 16 }; @@ -28,14 +27,14 @@ enum { INTCONV_OCTAL = 8, INTCONV_DECIMAL = 10, INTCONV_HEXADECIMAL = 16 }; * Multiply *v by base, which must be one of the above enumeration constants, * and add digit, updating *v with the result. * - * If the result does not fit in uintmax_t, then 0 is returned. Otherwise, + * If the result does not fit in cdecl_uintmax, then 0 is returned. Otherwise, * a non-zero result is returned. */ -static inline bool intconv_shift(uintmax_t *v, unsigned base, unsigned digit) +static inline bool intconv_shift(cdecl_uintmax *v, unsigned base, unsigned digit) { - uintmax_t old_v = *v; + cdecl_uintmax old_v = *v; - if (old_v > (uintmax_t)-1 / base) + if (old_v > (cdecl_uintmax)-1 / base) return false; old_v *= base;