/*
- * 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
#include <string.h>
#include <stdbool.h>
-#include <inttypes.h>
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;