]> git.draconx.ca Git - cdecl99.git/blobdiff - src/intconv.h
libcdecl: Replace uintmax_t with unsigned (long) long.
[cdecl99.git] / src / intconv.h
index 17644f2cdc70a0745c0f9d5ccdd018b67dfcda6a..6cc7819bb67fd02288778b9450736a06cbe51358 100644 (file)
@@ -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 <string.h>
 #include <stdbool.h>
-#include <inttypes.h>
 
 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;