From: Christof Hanke Date: Fri, 19 Nov 2010 20:30:21 +0000 (+0100) Subject: use proper 64bit casting for pointer-math X-Git-Tag: openafs-devel-1_7_1~1233 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=acdef43d818ee56e6c1f1dc29f508c02793c8355 use proper 64bit casting for pointer-math building with "./configure --enable-checking --enable-supergroups" fails, because on 64bit, the casting in map.c gives a warning. Just add another ifdef and cast according to the size of a pointer. Change-Id: Icb35d79f56cf8fec48c863061a524f9e29e6acd8 Reviewed-on: http://gerrit.openafs.org/3341 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/ptserver/map.c b/src/ptserver/map.c index 3ea4b26..c823516 100644 --- a/src/ptserver/map.c +++ b/src/ptserver/map.c @@ -36,6 +36,9 @@ #include #include #include +#ifdef HAVE_STDINT_H +# include +#endif #include "map.h" #undef PRINT_MAP_ERROR @@ -51,10 +54,10 @@ struct bitmap { int m_data[MDATA]; }; -#define MAP(p) ((struct bitmap*)((int)(p)&~1)) -#define NEGMAP(p) (((int)(p))&1) +#define MAP(p) ((struct bitmap*)((intptr_t)(p)&~1)) +#define NEGMAP(p) (((intptr_t)(p))&1) #define POSMAP(p) (!NEGMAP(p)) -#define NOT_MAP(mp) ((struct map *) (((int)(mp)) ^ 1)) +#define NOT_MAP(mp) ((struct map *) (((intptr_t)(mp)) ^ 1)) #define NUMBERTOBIT(n) ((n) & ((1<>LSHIFT) & ((1<