From a265802dff1e9fe77c89158382951629aba1fa2c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 8 Nov 2010 00:13:58 +0100 Subject: [PATCH] Fix warning: cast from pointer to integer of different size. --- tools/mbspc/botlib/l_struct.h | 3 ++- tools/mbspc/mbspc/aas_cfg.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/mbspc/botlib/l_struct.h b/tools/mbspc/botlib/l_struct.h index b8ef7196..84652bcb 100644 --- a/tools/mbspc/botlib/l_struct.h +++ b/tools/mbspc/botlib/l_struct.h @@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ +#include #define MAX_STRINGFIELD 80 //field types @@ -48,7 +49,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA typedef struct fielddef_s { char *name; //name of the field - int offset; //offset in the structure + size_t offset; //offset in the structure int type; //type of the field //type specific fields int maxarray; //maximum array size diff --git a/tools/mbspc/mbspc/aas_cfg.c b/tools/mbspc/mbspc/aas_cfg.c index b8051766..1d26db35 100644 --- a/tools/mbspc/mbspc/aas_cfg.c +++ b/tools/mbspc/mbspc/aas_cfg.c @@ -29,9 +29,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "../botlib/l_struct.h" #include "../botlib/l_libvar.h" +#include + //structure field offsets -#define BBOX_OFS(x) (int)&(((aas_bbox_t *)0)->x) -#define CFG_OFS(x) (int)&(((cfg_t *)0)->x) +#define BBOX_OFS(x) offsetof(aas_bbox_t, x) +#define CFG_OFS(x) offsetof(cfg_t, x) //bounding box definition fielddef_t bbox_fields[] =