From: Julian Seward Date: Mon, 2 May 2005 12:53:38 +0000 (+0000) Subject: Fix compile warnings on 32-bit platforms, hopefully without breaking X-Git-Tag: svn/VALGRIND_3_0_0~722 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e219d86e6dc9047bd8d787e2e15bb05541303b13;p=thirdparty%2Fvalgrind.git Fix compile warnings on 32-bit platforms, hopefully without breaking 64-bit platforms. (a.k.a The Portability Game) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3596 --- diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index a33571c6e3..ca4a36f54a 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -50,11 +50,6 @@ */ #define VG_DEBUG_MEMORY 0 - -typedef enum { - MC_Ok = 5, MC_AddrErr = 6, MC_ValueErr = 7 -} MC_ReadResult; - #define DEBUG(fmt, args...) //VG_(printf)(fmt, ## args) @@ -116,7 +111,7 @@ typedef enum { /* Only change this. N_PRIMARY_MAP *must* be a power of 2. */ -#if VEX_HOST_WORDSIZE == 4 +#if VG_WORDSIZE == 4 /* cover the entire address space */ # define N_PRIMARY_BITS 16 @@ -131,7 +126,7 @@ typedef enum { /* Do not change this. */ -#define N_PRIMARY_MAP (1ULL << N_PRIMARY_BITS) +#define N_PRIMARY_MAP ( ((UWord)1) << N_PRIMARY_BITS) /* Do not change this. */ #define MAX_PRIMARY_ADDRESS (Addr)((((Addr)65536) * N_PRIMARY_MAP)-1) @@ -918,6 +913,15 @@ SP_UPDATE_HANDLERS ( make_aligned_word32_writable, /*--- Checking memory ---*/ /*------------------------------------------------------------*/ +typedef + enum { + MC_Ok = 5, + MC_AddrErr = 6, + MC_ValueErr = 7 + } + MC_ReadResult; + + /* Check permissions for address range. If inadequate permissions exist, *bad_addr is set to the offending address, so the caller can know what it is. */