From 1041af9f85e4be342339475cf5c8878fef1de10d Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sat, 1 Feb 2014 16:26:51 -0500 Subject: 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. --- src/util/profile/prof_init.c | 26 ++++++++++++-------------- src/util/profile/prof_int.h | 2 +- src/util/support/t_unal.c | 2 +- 3 files changed, 14 insertions(+), 16 deletions(-) (limited to 'src/util') diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c index 9845a18b54..cc92248f42 100644 --- a/src/util/profile/prof_init.c +++ b/src/util/profile/prof_init.c @@ -13,8 +13,6 @@ #endif #include -typedef int32_t prof_int32; - /* Create a vtable profile, possibly with a library handle. The new profile * takes ownership of the handle refcount on success. */ static errcode_t @@ -529,20 +527,20 @@ errcode_t profile_ser_size(const char *unused, profile_t profile, size_t required; prf_file_t pfp; - required = 3*sizeof(prof_int32); + required = 3*sizeof(int32_t); for (pfp = profile->first_file; pfp; pfp = pfp->next) { - required += sizeof(prof_int32); + required += sizeof(int32_t); required += strlen(pfp->data->filespec); } *sizep += required; return 0; } -static void pack_int32(prof_int32 oval, unsigned char **bufpp, size_t *remainp) +static void pack_int32(int32_t oval, unsigned char **bufpp, size_t *remainp) { store_32_be(oval, *bufpp); - *bufpp += sizeof(prof_int32); - *remainp -= sizeof(prof_int32); + *bufpp += sizeof(int32_t); + *remainp -= sizeof(int32_t); } errcode_t profile_ser_externalize(const char *unused, profile_t profile, @@ -553,7 +551,7 @@ errcode_t profile_ser_externalize(const char *unused, profile_t profile, unsigned char *bp; size_t remain; prf_file_t pfp; - prof_int32 fcount, slen; + int32_t fcount, slen; required = 0; bp = *bufpp; @@ -569,7 +567,7 @@ errcode_t profile_ser_externalize(const char *unused, profile_t profile, pack_int32(PROF_MAGIC_PROFILE, &bp, &remain); pack_int32(fcount, &bp, &remain); for (pfp = profile->first_file; pfp; pfp = pfp->next) { - slen = (prof_int32) strlen(pfp->data->filespec); + slen = (int32_t) strlen(pfp->data->filespec); pack_int32(slen, &bp, &remain); if (slen) { memcpy(bp, pfp->data->filespec, (size_t) slen); @@ -586,13 +584,13 @@ errcode_t profile_ser_externalize(const char *unused, profile_t profile, return(retval); } -static int unpack_int32(prof_int32 *intp, unsigned char **bufpp, +static int unpack_int32(int32_t *intp, unsigned char **bufpp, size_t *remainp) { - if (*remainp >= sizeof(prof_int32)) { + if (*remainp >= sizeof(int32_t)) { *intp = load_32_be(*bufpp); - *bufpp += sizeof(prof_int32); - *remainp -= sizeof(prof_int32); + *bufpp += sizeof(int32_t); + *remainp -= sizeof(int32_t); return 0; } else @@ -606,7 +604,7 @@ errcode_t profile_ser_internalize(const char *unused, profile_t *profilep, unsigned char *bp; size_t remain; int i; - prof_int32 fcount, tmp; + int32_t fcount, tmp; profile_filespec_t *flist = 0; bp = *bufpp; diff --git a/src/util/profile/prof_int.h b/src/util/profile/prof_int.h index 6700b50760..cddc1fd9ad 100644 --- a/src/util/profile/prof_int.h +++ b/src/util/profile/prof_int.h @@ -49,7 +49,7 @@ struct _prf_data_t { This is icky. I just hope it's adequate. For next major release, fix this. */ - union { double d; void *p; UINT64_TYPE ll; k5_mutex_t m; } pad; + union { double d; void *p; uint64_t ll; k5_mutex_t m; } pad; int refcount; /* prf_file_t references */ struct _prf_data_t *next; diff --git a/src/util/support/t_unal.c b/src/util/support/t_unal.c index 6b2720b421..cc2f4c92ca 100644 --- a/src/util/support/t_unal.c +++ b/src/util/support/t_unal.c @@ -9,7 +9,7 @@ int main () on. */ union { - UINT64_TYPE n64; + uint64_t n64; uint32_t n32; uint16_t n16; unsigned char b[9]; -- cgit