]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
64-bit cleanness: replace hard-wired 0xffffffff literals with something less
authorNicholas Nethercote <n.nethercote@gmail.com>
Thu, 4 Nov 2004 13:49:28 +0000 (13:49 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Thu, 4 Nov 2004 13:49:28 +0000 (13:49 +0000)
32-bit-specific.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2914

coregrind/vg_mylibc.c
massif/ms_main.c
memcheck/tests/brk.c

index e81c78cdfbfcf92adda1f6d59cc3be48e0feec90..93de8dc2d695f4993975f611e0ffdbe60c6bca62 100644 (file)
@@ -45,7 +45,7 @@ Int VG_(sigfillset)( vki_sigset_t* set )
    if (set == NULL)
       return -1;
    for (i = 0; i < _VKI_NSIG_WORDS; i++)
-      set->sig[i] = 0xFFFFFFFF;
+      set->sig[i] = ~(UWord)0x0;
    return 0;
 }
 
index fdb39d04f8368651f185e266d9d540e9c5b2462d..e88edbd3528a504d8ad2f0a28651114a8a4f8025 100644 (file)
@@ -415,7 +415,7 @@ static Bool is_alloc_fn(Addr eip)
 // to ensure this in certain cases.  See comments below.
 static XPt* get_XCon( ThreadId tid, Bool custom_malloc )
 {
-   // Static to minimise stack size.  +1 for added 0xffffffff %eip.
+   // Static to minimise stack size.  +1 for added ~0 %eip.
    static Addr eips[MAX_DEPTH + MAX_ALLOC_FNS + 1];
 
    XPt* xpt = alloc_xpt;
@@ -440,7 +440,7 @@ static XPt* get_XCon( ThreadId tid, Bool custom_malloc )
       // wasn't a bottom-XPt (now or later) it would cause problems later (eg.
       // the parent's approx_ST wouldn't be equal [or almost equal] to the
       // total of the childrens' approx_STs).  
-      eips[ n_eips++ ] = 0xffffffff;
+      eips[ n_eips++ ] = ~((Addr)0);
 
       // Skip over alloc functions in eips[]. 
       for (L = 0; is_alloc_fn(eips[L]) && L < n_eips; L++) { }
index 58c42604aab18f9a773d27236fb8c260a3023117..7b4f4dc767832fd6e48d15556a1d5372f8a9d3ff 100644 (file)
@@ -13,7 +13,7 @@ int main(void)
    void* ds = orig_ds;
    void* vals[10];
    void* res;
-
+#define EOL ((void*)( ~(long)0 ))
    vals[0] = (void*)0;
    vals[1] = (void*)1;
    vals[2] = ds - 0x1;          // small shrink
@@ -23,8 +23,8 @@ int main(void)
    vals[6] = ds + 0x500;        // shrink a little, but still above start size
    vals[7] = ds - 0x1;          // shrink below start size
 //   vals[8] = ds - 0x1000;       // shrink a lot below start size (into text)
-//   vals[9] = (void*)0xffffffff;
-   vals[8] = (void*)0xffffffff;
+//   vals[9] = EOL;
+   vals[8] = EOL;
 
    for (i = 0; (void*)0xffffffff != vals[i]; i++) {
       res = (void*)syscall(__NR_brk, vals[i]);
@@ -32,7 +32,7 @@ int main(void)
 
    assert( 0 == brk(orig_ds) );  // libc brk()
 
-   for (i = 0; (void*)0xffffffff != vals[i]; i++) {
+   for (i = 0; EOL != vals[i]; i++) {
       res = (void*)brk(vals[i]);
    }