summaryrefslogtreecommitdiffstats
path: root/src/util/profile/prof_init.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2008-08-02 06:39:29 +0000
committerKen Raeburn <raeburn@mit.edu>2008-08-02 06:39:29 +0000
commit9b933432c7bfefbcda36a4d87c0193cf6ee6be46 (patch)
tree53d87ea77f44037041f353572826f70654e81335 /src/util/profile/prof_init.c
parent4c3157497d4394cb6b09565a94091256aa3d5b54 (diff)
downloadkrb5-9b933432c7bfefbcda36a4d87c0193cf6ee6be46.tar.gz
krb5-9b933432c7bfefbcda36a4d87c0193cf6ee6be46.tar.xz
krb5-9b933432c7bfefbcda36a4d87c0193cf6ee6be46.zip
Use load/store_32_be instead of open-coding
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20600 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/profile/prof_init.c')
-rw-r--r--src/util/profile/prof_init.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c
index fbcbead128..6d05ce79be 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;