From 22de4e6c0fa169ddc831e8cc552960ab8ea932f9 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 15 Dec 2003 16:15:30 +0000 Subject: [PATCH] * k5-platform.h: apply casts (unsigned char) to the assignments from 64-bit ints to unsigned char fields to avoid warnings ticket: 1471 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15925 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-platform.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h index e6d2ad0e4..48f846879 100644 --- a/src/include/k5-platform.h +++ b/src/include/k5-platform.h @@ -81,26 +81,26 @@ store_32_le (unsigned int val, unsigned char *p) static inline void store_64_be (UINT64_TYPE val, unsigned char *p) { - p[0] = (val >> 56) & 0xff; - p[1] = (val >> 48) & 0xff; - p[2] = (val >> 40) & 0xff; - p[3] = (val >> 32) & 0xff; - p[4] = (val >> 24) & 0xff; - p[5] = (val >> 16) & 0xff; - p[6] = (val >> 8) & 0xff; - p[7] = (val ) & 0xff; + p[0] = (unsigned char)((val >> 56) & 0xff); + p[1] = (unsigned char)((val >> 48) & 0xff); + p[2] = (unsigned char)((val >> 40) & 0xff); + p[3] = (unsigned char)((val >> 32) & 0xff); + p[4] = (unsigned char)((val >> 24) & 0xff); + p[5] = (unsigned char)((val >> 16) & 0xff); + p[6] = (unsigned char)((val >> 8) & 0xff); + p[7] = (unsigned char)((val ) & 0xff); } static inline void store_64_le (UINT64_TYPE val, unsigned char *p) { - p[7] = (val >> 56) & 0xff; - p[6] = (val >> 48) & 0xff; - p[5] = (val >> 40) & 0xff; - p[4] = (val >> 32) & 0xff; - p[3] = (val >> 24) & 0xff; - p[2] = (val >> 16) & 0xff; - p[1] = (val >> 8) & 0xff; - p[0] = (val ) & 0xff; + p[7] = (unsigned char)((val >> 56) & 0xff); + p[6] = (unsigned char)((val >> 48) & 0xff); + p[5] = (unsigned char)((val >> 40) & 0xff); + p[4] = (unsigned char)((val >> 32) & 0xff); + p[3] = (unsigned char)((val >> 24) & 0xff); + p[2] = (unsigned char)((val >> 16) & 0xff); + p[1] = (unsigned char)((val >> 8) & 0xff); + p[0] = (unsigned char)((val ) & 0xff); } static inline unsigned short load_16_be (unsigned char *p) -- 2.26.2