diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/skalibs/biguint.h | 57 | ||||
-rw-r--r-- | src/include/skalibs/tai.h | 2 |
2 files changed, 30 insertions, 29 deletions
diff --git a/src/include/skalibs/biguint.h b/src/include/skalibs/biguint.h index 94e99a9..66dbd1d 100644 --- a/src/include/skalibs/biguint.h +++ b/src/include/skalibs/biguint.h @@ -3,44 +3,45 @@ #ifndef BIGUINT_H #define BIGUINT_H +#include <sys/types.h> +#include <stdint.h> #include <skalibs/gccattributes.h> -#include <skalibs/uint32.h> -extern void bu_pack (char *, uint32 const *, unsigned int) ; -extern void bu_unpack (char const *, uint32 *, unsigned int) ; -extern void bu_pack_big (char *, uint32 const *, unsigned int) ; -extern void bu_unpack_big (char const *, uint32 *, unsigned int) ; -extern unsigned int bu_fmt (char *, uint32 const *, unsigned int) ; -extern unsigned int bu_scanlen (char const *, unsigned int *) ; -extern int bu_scan (char const *, unsigned int, uint32 *, unsigned int, unsigned int) ; +extern void bu_pack (char *, uint32_t const *, unsigned int) ; +extern void bu_unpack (char const *, uint32_t *, unsigned int) ; +extern void bu_pack_big (char *, uint32_t const *, unsigned int) ; +extern void bu_unpack_big (char const *, uint32_t *, unsigned int) ; +extern size_t bu_fmt (char *, uint32_t const *, unsigned int) ; +extern size_t bu_scanlen (char const *, size_t *) ; +extern int bu_scan (char const *, size_t, uint32_t *, unsigned int, size_t) ; -extern unsigned int bu_len (uint32 const *, unsigned int) gccattr_pure ; -extern void bu_zero (uint32 *, unsigned int) ; -extern int bu_copy (uint32 *, unsigned int, uint32 const *, unsigned int) ; -extern int bu_cmp (uint32 const *, unsigned int, uint32 const *, unsigned int) gccattr_pure ; +extern unsigned int bu_len (uint32_t const *, unsigned int) gccattr_pure ; +extern void bu_zero (uint32_t *, unsigned int) ; +extern int bu_copy (uint32_t *, unsigned int, uint32_t const *, unsigned int) ; +extern int bu_cmp (uint32_t const *, unsigned int, uint32_t const *, unsigned int) gccattr_pure ; #define bu_add(c, cn, a, an, b, bn) bu_addc(c, cn, a, an, b, (bn), 0) -extern int bu_addc (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int, int) ; +extern int bu_addc (uint32_t *, unsigned int, uint32_t const *, unsigned int, uint32_t const *, unsigned int, int) ; #define bu_sub(c, cn, a, an, b, bn) bu_subc(c, cn, a, an, b, (bn), 0) -extern int bu_subc (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int, int) ; -extern int bu_mul (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int) ; -extern int bu_div (uint32 const *, unsigned int, uint32 const *, unsigned int, uint32 *, unsigned int, uint32 *, unsigned int) ; -extern int bu_mod (uint32 *, unsigned int, uint32 const *, unsigned int) ; -extern int bu_gcd (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int) ; +extern int bu_subc (uint32_t *, unsigned int, uint32_t const *, unsigned int, uint32_t const *, unsigned int, int) ; +extern int bu_mul (uint32_t *, unsigned int, uint32_t const *, unsigned int, uint32_t const *, unsigned int) ; +extern int bu_div (uint32_t const *, unsigned int, uint32_t const *, unsigned int, uint32_t *, unsigned int, uint32_t *, unsigned int) ; +extern int bu_mod (uint32_t *, unsigned int, uint32_t const *, unsigned int) ; +extern int bu_gcd (uint32_t *, unsigned int, uint32_t const *, unsigned int, uint32_t const *, unsigned int) ; #define bu_slb(a, n) bu_slbc(a, n, 0) -extern int bu_slbc (uint32 *, unsigned int, int) ; +extern int bu_slbc (uint32_t *, unsigned int, int) ; #define bu_srb(a, n) bu_srbc(a, n, 0) -extern int bu_srbc (uint32 *, unsigned int, int) ; +extern int bu_srbc (uint32_t *, unsigned int, int) ; -extern int bu_addmod (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int) ; -extern int bu_submod (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int) ; -extern int bu_invmod (uint32 *, unsigned int, uint32 const *, unsigned int) ; -extern int bu_divmod (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int) ; +extern int bu_addmod (uint32_t *, unsigned int, uint32_t const *, unsigned int, uint32_t const *, unsigned int, uint32_t const *, unsigned int) ; +extern int bu_submod (uint32_t *, unsigned int, uint32_t const *, unsigned int, uint32_t const *, unsigned int, uint32_t const *, unsigned int) ; +extern int bu_invmod (uint32_t *, unsigned int, uint32_t const *, unsigned int) ; +extern int bu_divmod (uint32_t *, unsigned int, uint32_t const *, unsigned int, uint32_t const *, unsigned int, uint32_t const *, unsigned int) ; -extern void bu_scan_internal (char const *, unsigned int, uint32 *) ; -extern void bu_copy_internal (uint32 *, uint32 const *, unsigned int) ; -extern void bu_div_internal (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 *, unsigned int) ; -extern void bu_divmod_internal (uint32 *, uint32 *, uint32 const *, unsigned int) ; +extern void bu_scan_internal (char const *, size_t, uint32_t *) ; +extern void bu_copy_internal (uint32_t *, uint32_t const *, unsigned int) ; +extern void bu_div_internal (uint32_t *, unsigned int, uint32_t const *, unsigned int, uint32_t *, unsigned int) ; +extern void bu_divmod_internal (uint32_t *, uint32_t *, uint32_t const *, unsigned int) ; #endif diff --git a/src/include/skalibs/tai.h b/src/include/skalibs/tai.h index e411ff0..64e81cf 100644 --- a/src/include/skalibs/tai.h +++ b/src/include/skalibs/tai.h @@ -20,7 +20,7 @@ struct tai_s #define TAI_ZERO { .x = 0 } #define TAI_MAGIC ((uint64)4611686018427387904ULL) #define TAI_EPOCH { .x = TAI_MAGIC + 10UL } -#define TAI_INFINITE_RELATIVE { .x = ((uint64)1 << 60) } +#define TAI_INFINITE_RELATIVE { .x = (uint64)1 << 60 } #define TAI_INFINITE { .x = TAI_MAGIC + ((uint64)1 << 61) } #define tai_sec(t) ((t)->x) |