From 9b933432c7bfefbcda36a4d87c0193cf6ee6be46 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 2 Aug 2008 06:39:29 +0000 Subject: Use load/store_32_be instead of open-coding git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20600 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/profile/prof_init.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/util') diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c index fbcbead..6d05ce7 100644 --- a/src/util/profile/prof_init.c +++ b/src/util/profile/prof_init.c @@ -272,10 +272,7 @@ errcode_t profile_ser_size(const char *unused, profile_t profile, static void pack_int32(prof_int32 oval, unsigned char **bufpp, size_t *remainp) { - (*bufpp)[0] = (unsigned char) ((oval >> 24) & 0xff); - (*bufpp)[1] = (unsigned char) ((oval >> 16) & 0xff); - (*bufpp)[2] = (unsigned char) ((oval >> 8) & 0xff); - (*bufpp)[3] = (unsigned char) (oval & 0xff); + store_32_be(oval, *bufpp); *bufpp += sizeof(prof_int32); *remainp -= sizeof(prof_int32); } @@ -325,10 +322,7 @@ static int unpack_int32(prof_int32 *intp, unsigned char **bufpp, size_t *remainp) { if (*remainp >= sizeof(prof_int32)) { - *intp = (((prof_int32) (*bufpp)[0] << 24) | - ((prof_int32) (*bufpp)[1] << 16) | - ((prof_int32) (*bufpp)[2] << 8) | - ((prof_int32) (*bufpp)[3])); + *intp = load_32_be(*bufpp); *bufpp += sizeof(prof_int32); *remainp -= sizeof(prof_int32); return 0; -- cgit v1.1