aboutsummaryrefslogtreecommitdiff
path: root/src/include/k5-platform.h
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2009-02-05 21:56:21 +0000
committerKen Raeburn <raeburn@mit.edu>2009-02-05 21:56:21 +0000
commitc3272bc0361680bec74e063df8c42410dcdf5c7e (patch)
tree32eb42f24f7c46e49fb4437f967801cbef290e11 /src/include/k5-platform.h
parent29e1221373f5547c8a46f1e809e94b96bbca69d6 (diff)
downloadkrb5-c3272bc0361680bec74e063df8c42410dcdf5c7e.zip
krb5-c3272bc0361680bec74e063df8c42410dcdf5c7e.tar.gz
krb5-c3272bc0361680bec74e063df8c42410dcdf5c7e.tar.bz2
use casts, for c++ compilation on windows
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21902 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include/k5-platform.h')
-rw-r--r--src/include/k5-platform.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h
index 1734e42..797c493 100644
--- a/src/include/k5-platform.h
+++ b/src/include/k5-platform.h
@@ -533,10 +533,12 @@ static inline unsigned int k5_swap16 (unsigned int x) {
# define SWAP64 OSSwapInt64
#endif
+/* Note that on Windows at least this file can be included from C++
+ source, so casts *from* void* are required. */
static inline void
store_16_be (unsigned int val, void *vp)
{
- unsigned char *p = vp;
+ unsigned char *p = (unsigned char *) vp;
#if defined(__GNUC__) && defined(K5_BE)
PUT(16,p,val);
#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP16)
@@ -549,7 +551,7 @@ store_16_be (unsigned int val, void *vp)
static inline void
store_32_be (unsigned int val, void *vp)
{
- unsigned char *p = vp;
+ unsigned char *p = (unsigned char *) vp;
#if defined(__GNUC__) && defined(K5_BE)
PUT(32,p,val);
#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP32)
@@ -564,7 +566,7 @@ store_32_be (unsigned int val, void *vp)
static inline void
store_64_be (UINT64_TYPE val, void *vp)
{
- unsigned char *p = vp;
+ unsigned char *p = (unsigned char *) vp;
#if defined(__GNUC__) && defined(K5_BE)
PUT(64,p,val);
#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP64)
@@ -583,7 +585,7 @@ store_64_be (UINT64_TYPE val, void *vp)
static inline unsigned short
load_16_be (const void *cvp)
{
- const unsigned char *p = cvp;
+ const unsigned char *p = (const unsigned char *) cvp;
#if defined(__GNUC__) && defined(K5_BE)
return GET(16,p);
#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP16)
@@ -595,7 +597,7 @@ load_16_be (const void *cvp)
static inline unsigned int
load_32_be (const void *cvp)
{
- const unsigned char *p = cvp;
+ const unsigned char *p = (const unsigned char *) cvp;
#if defined(__GNUC__) && defined(K5_BE)
return GET(32,p);
#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP32)
@@ -609,7 +611,7 @@ load_32_be (const void *cvp)
static inline UINT64_TYPE
load_64_be (const void *cvp)
{
- const unsigned char *p = cvp;
+ const unsigned char *p = (const unsigned char *) cvp;
#if defined(__GNUC__) && defined(K5_BE)
return GET(64,p);
#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP64)
@@ -621,7 +623,7 @@ load_64_be (const void *cvp)
static inline void
store_16_le (unsigned int val, void *vp)
{
- unsigned char *p = vp;
+ unsigned char *p = (unsigned char *) vp;
#if defined(__GNUC__) && defined(K5_LE)
PUT(16,p,val);
#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP16)
@@ -634,7 +636,7 @@ store_16_le (unsigned int val, void *vp)
static inline void
store_32_le (unsigned int val, void *vp)
{
- unsigned char *p = vp;
+ unsigned char *p = (unsigned char *) vp;
#if defined(__GNUC__) && defined(K5_LE)
PUT(32,p,val);
#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP32)
@@ -649,7 +651,7 @@ store_32_le (unsigned int val, void *vp)
static inline void
store_64_le (UINT64_TYPE val, void *vp)
{
- unsigned char *p = vp;
+ unsigned char *p = (unsigned char *) vp;
#if defined(__GNUC__) && defined(K5_LE)
PUT(64,p,val);
#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP64)
@@ -668,7 +670,7 @@ store_64_le (UINT64_TYPE val, void *vp)
static inline unsigned short
load_16_le (const void *cvp)
{
- const unsigned char *p = cvp;
+ const unsigned char *p = (const unsigned char *) cvp;
#if defined(__GNUC__) && defined(K5_LE)
return GET(16,p);
#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP16)
@@ -680,7 +682,7 @@ load_16_le (const void *cvp)
static inline unsigned int
load_32_le (const void *cvp)
{
- const unsigned char *p = cvp;
+ const unsigned char *p = (const unsigned char *) cvp;
#if defined(__GNUC__) && defined(K5_LE)
return GET(32,p);
#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP32)
@@ -692,7 +694,7 @@ load_32_le (const void *cvp)
static inline UINT64_TYPE
load_64_le (const void *cvp)
{
- const unsigned char *p = cvp;
+ const unsigned char *p = (const unsigned char *) cvp;
#if defined(__GNUC__) && defined(K5_LE)
return GET(64,p);
#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP64)