diff options
author | Greg Hudson <ghudson@mit.edu> | 2014-02-01 16:26:51 -0500 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2014-02-26 16:15:20 -0500 |
commit | 1041af9f85e4be342339475cf5c8878fef1de10d (patch) | |
tree | a6d93682edb0e3fbc7f15963c8338a6ac5f8deb2 /src/include | |
parent | a7a2c02b618aea40ebd4f597ec956eaf0fe210f5 (diff) | |
download | krb5-1041af9f85e4be342339475cf5c8878fef1de10d.zip krb5-1041af9f85e4be342339475cf5c8878fef1de10d.tar.gz krb5-1041af9f85e4be342339475cf5c8878fef1de10d.tar.bz2 |
Eliminate internal fixed-width type wrappers
Directly use stdint.h names for integer types in preference to the
various internal names we have made up for them.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/k5-int.h | 14 | ||||
-rw-r--r-- | src/include/k5-platform.h | 31 |
2 files changed, 19 insertions, 26 deletions
diff --git a/src/include/k5-int.h b/src/include/k5-int.h index b4757a9..fbb8665 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -129,10 +129,6 @@ typedef unsigned char u_char; #include "k5-platform.h" -/* not used in krb5.h (yet) */ -typedef UINT64_TYPE krb5_ui_8; -typedef INT64_TYPE krb5_int64; - #define KRB5_KDB_MAX_LIFE (60*60*24) /* one day */ #define KRB5_KDB_MAX_RLIFE (60*60*24*7) /* one week */ @@ -1719,10 +1715,10 @@ krb5_ser_unpack_int32(krb5_int32 *, krb5_octet **, size_t *); /* [De]serialize 8-byte integer */ krb5_error_code KRB5_CALLCONV -krb5_ser_pack_int64(krb5_int64, krb5_octet **, size_t *); +krb5_ser_pack_int64(int64_t, krb5_octet **, size_t *); krb5_error_code KRB5_CALLCONV -krb5_ser_unpack_int64(krb5_int64 *, krb5_octet **, size_t *); +krb5_ser_unpack_int64(int64_t *, krb5_octet **, size_t *); /* [De]serialize byte string */ krb5_error_code KRB5_CALLCONV @@ -1758,10 +1754,10 @@ typedef struct _krb5int_access { krb5_error_code (*mandatory_cksumtype)(krb5_context, krb5_enctype, krb5_cksumtype *); - krb5_error_code (KRB5_CALLCONV *ser_pack_int64)(krb5_int64, krb5_octet **, + krb5_error_code (KRB5_CALLCONV *ser_pack_int64)(int64_t, krb5_octet **, size_t *); - krb5_error_code (KRB5_CALLCONV *ser_unpack_int64)(krb5_int64 *, - krb5_octet **, size_t *); + krb5_error_code (KRB5_CALLCONV *ser_unpack_int64)(int64_t *, krb5_octet **, + size_t *); /* Used for KDB LDAP back end. */ krb5_error_code diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h index 537c8ad..e5fd004 100644 --- a/src/include/k5-platform.h +++ b/src/include/k5-platform.h @@ -411,9 +411,6 @@ typedef struct { int error; unsigned char did_run; } k5_init_t; #endif -#define INT64_TYPE int64_t -#define UINT64_TYPE uint64_t - #ifndef SIZE_MAX # define SIZE_MAX ((size_t)((size_t)0 - 1)) #endif @@ -575,7 +572,7 @@ store_32_be (unsigned int val, void *vp) #endif } static inline void -store_64_be (UINT64_TYPE val, void *vp) +store_64_be (uint64_t val, void *vp) { unsigned char *p = (unsigned char *) vp; #if defined(__GNUC__) && defined(K5_BE) && !defined(__cplusplus) @@ -619,7 +616,7 @@ load_32_be (const void *cvp) | ((uint32_t) p[0] << 24)); #endif } -static inline UINT64_TYPE +static inline uint64_t load_64_be (const void *cvp) { const unsigned char *p = (const unsigned char *) cvp; @@ -628,7 +625,7 @@ load_64_be (const void *cvp) #elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP64) && !defined(__cplusplus) return GETSWAPPED(64,p); #else - return ((UINT64_TYPE)load_32_be(p) << 32) | load_32_be(p+4); + return ((uint64_t)load_32_be(p) << 32) | load_32_be(p+4); #endif } static inline void @@ -660,7 +657,7 @@ store_32_le (unsigned int val, void *vp) #endif } static inline void -store_64_le (UINT64_TYPE val, void *vp) +store_64_le (uint64_t val, void *vp) { unsigned char *p = (unsigned char *) vp; #if defined(__GNUC__) && defined(K5_LE) && !defined(__cplusplus) @@ -702,7 +699,7 @@ load_32_le (const void *cvp) return (p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24)); #endif } -static inline UINT64_TYPE +static inline uint64_t load_64_le (const void *cvp) { const unsigned char *p = (const unsigned char *) cvp; @@ -711,7 +708,7 @@ load_64_le (const void *cvp) #elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP64) && !defined(__cplusplus) return GETSWAPPED(64,p); #else - return ((UINT64_TYPE)load_32_le(p+4) << 32) | load_32_le(p); + return ((uint64_t)load_32_le(p+4) << 32) | load_32_le(p); #endif } @@ -731,9 +728,9 @@ store_32_n (unsigned int val, void *vp) memcpy(vp, &n, 4); } static inline void -store_64_n (UINT64_TYPE val, void *vp) +store_64_n (uint64_t val, void *vp) { - UINT64_TYPE n = val; + uint64_t n = val; memcpy(vp, &n, 8); } static inline unsigned short @@ -750,10 +747,10 @@ load_32_n (const void *p) memcpy(&n, p, 4); return n; } -static inline UINT64_TYPE +static inline uint64_t load_64_n (const void *p) { - UINT64_TYPE n; + uint64_t n; memcpy(&n, p, 8); return n; } @@ -761,8 +758,8 @@ load_64_n (const void *p) #undef UINT32_TYPE /* Assume for simplicity that these swaps are identical. */ -static inline UINT64_TYPE -k5_htonll (UINT64_TYPE val) +static inline uint64_t +k5_htonll (uint64_t val) { #ifdef K5_BE return val; @@ -772,8 +769,8 @@ k5_htonll (UINT64_TYPE val) return load_64_be ((unsigned char *)&val); #endif } -static inline UINT64_TYPE -k5_ntohll (UINT64_TYPE val) +static inline uint64_t +k5_ntohll (uint64_t val) { return k5_htonll (val); } |