From d17c5b8296c76bccbf00fedee0317e915caee38e Mon Sep 17 00:00:00 2001
From: David Lovemore
Date: Thu, 17 May 2012 15:18:50 +0100
Subject: [PATCH] Using mps_word_const instead of ull for proper fixes to
constants
Copied from Perforce
Change: 178196
ServerID: perforce.ravenbrook.com
---
mps/code/amcss.c | 4 +---
mps/code/amcsshe.c | 2 +-
mps/code/amcssth.c | 2 +-
mps/code/amsss.c | 2 +-
mps/code/amssshe.c | 3 +--
mps/code/exposet0.c | 2 +-
mps/code/mpsicv.c | 9 ++++-----
mps/code/segsmss.c | 3 +--
mps/code/steptest.c | 3 +--
mps/code/walkt0.c | 2 +-
10 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/mps/code/amcss.c b/mps/code/amcss.c
index 279b33ce407..277ffca434a 100644
--- a/mps/code/amcss.c
+++ b/mps/code/amcss.c
@@ -38,9 +38,7 @@ static mps_gen_param_s testChain[genCOUNT] = {
/* objNULL needs to be odd so that it's ignored in exactRoots. */
-/* @@@@ W3I6MV Temporary fix (ull) to prevent Microsoft C complaining. Need
- to work out what to do about such cases. */
-#define objNULL ((mps_addr_t)0xDECEA5EDull)
+#define objNULL ((mps_addr_t)MPS_WORD_CONST(0xDECEA5ED))
static mps_pool_t pool;
diff --git a/mps/code/amcsshe.c b/mps/code/amcsshe.c
index edc76a16deb..646f6c4f90b 100644
--- a/mps/code/amcsshe.c
+++ b/mps/code/amcsshe.c
@@ -41,7 +41,7 @@ static mps_gen_param_s testChain[genCOUNT] = {
/* objNULL needs to be odd so that it's ignored in exactRoots. */
-#define objNULL ((mps_addr_t)0xDECEA5ED)
+#define objNULL ((mps_addr_t)MPS_WORD_CONST(0xDECEA5ED))
static mps_pool_t pool;
diff --git a/mps/code/amcssth.c b/mps/code/amcssth.c
index e71849d72fa..08597be51a4 100644
--- a/mps/code/amcssth.c
+++ b/mps/code/amcssth.c
@@ -38,7 +38,7 @@ static mps_gen_param_s testChain[genCOUNT] = {
/* objNULL needs to be odd so that it's ignored in exactRoots. */
-#define objNULL ((mps_addr_t)0xDECEA5ED)
+#define objNULL ((mps_addr_t)MPS_WORD_CONST(0xDECEA5ED))
static mps_pool_t pool;
diff --git a/mps/code/amsss.c b/mps/code/amsss.c
index 394107abe29..c561aa96ff1 100644
--- a/mps/code/amsss.c
+++ b/mps/code/amsss.c
@@ -31,7 +31,7 @@
#define totalSizeSTEP 200 * (size_t)1024
/* objNULL needs to be odd so that it's ignored in exactRoots. */
/* @@@@ temporary fix W3I6MV */
-#define objNULL ((mps_addr_t)0xDECEA5EDull)
+#define objNULL ((mps_addr_t)MPS_WORD_CONST(0xDECEA5ED))
#define testArenaSIZE ((size_t)16<<20)
#define initTestFREQ 3000
#define splatTestFREQ 6000
diff --git a/mps/code/amssshe.c b/mps/code/amssshe.c
index d80a83f7aaa..4e7c09c10f0 100644
--- a/mps/code/amssshe.c
+++ b/mps/code/amssshe.c
@@ -28,8 +28,7 @@
#define totalSizeMAX 800 * (size_t)1024
#define totalSizeSTEP 200 * (size_t)1024
/* objNULL needs to be odd so that it's ignored in exactRoots. */
-/* @@@@ Temporary fix for W3I6MV build ull */
-#define objNULL ((mps_addr_t)0xDECEA5EDull)
+#define objNULL ((mps_addr_t)MPS_WORD_CONST(0xDECEA5ED))
#define testArenaSIZE ((size_t)16<<20)
#define initTestFREQ 6000
static mps_gen_param_s testChain[1] = { { 160, 0.90 } };
diff --git a/mps/code/exposet0.c b/mps/code/exposet0.c
index 009347ec8bd..c7000214d97 100644
--- a/mps/code/exposet0.c
+++ b/mps/code/exposet0.c
@@ -45,7 +45,7 @@ static mps_gen_param_s testChain[genCOUNT] = {
/* objNULL needs to be odd so that it's ignored in exactRoots. */
-#define objNULL ((mps_addr_t)0xDECEA5ED)
+#define objNULL ((mps_addr_t)MPS_WORD_CONST(0xDECEA5ED))
static mps_pool_t pool_g;
diff --git a/mps/code/mpsicv.c b/mps/code/mpsicv.c
index 0d4fcf88361..4440d648333 100644
--- a/mps/code/mpsicv.c
+++ b/mps/code/mpsicv.c
@@ -29,8 +29,7 @@
#define patternFREQ 100
/* objNULL needs to be odd so that it's ignored in exactRoots. */
-/* @@@@ Temporary fix W3I6MV ull */
-#define objNULL ((mps_addr_t)0xDECEA5EDull)
+#define objNULL ((mps_addr_t)MPS_WORD_CONST(0xDECEA5ED))
#define FILLER_OBJECT_SIZE 1023
#define genCOUNT 2
@@ -263,10 +262,10 @@ static void addr_pool_test(mps_arena_t arena,
mps_addr_t addr;
/* DISTInguished values are to observe overwrites. */
/* @@@@ Temporary fix W3I6MV ull */
- mps_pool_t poolDistinguished = (mps_pool_t)0x000d1521ull;
+ mps_pool_t poolDistinguished = (mps_pool_t)MPS_WORD_CONST(0x000d1521);
mps_pool_t pool = poolDistinguished;
/* @@@@ Temporary fix W3I6MV ull */
- mps_fmt_t fmtDistinguished = (mps_fmt_t)0x000d1521ull;
+ mps_fmt_t fmtDistinguished = (mps_fmt_t)MPS_WORD_CONST(0x000d1521);
mps_fmt_t fmt = fmtDistinguished;
/* 0a -- obj1 in pool1 (unformatted) */
@@ -441,7 +440,7 @@ static void *test(void *arg, size_t s)
die(mps_root_create_table_masked(&exactRoot, arena,
MPS_RANK_EXACT, (mps_rm_t)0,
&exactRoots[0], exactRootsCOUNT,
- (mps_word_t)1ull),
+ MPS_WORD_CONST(1)),
"root_create_table(exact)");
die(mps_root_create_table(&ambigRoot, arena,
MPS_RANK_AMBIG, (mps_rm_t)0,
diff --git a/mps/code/segsmss.c b/mps/code/segsmss.c
index c0b18af8f6f..75dffa5e772 100644
--- a/mps/code/segsmss.c
+++ b/mps/code/segsmss.c
@@ -714,8 +714,7 @@ static mps_class_t mps_class_amst(void)
#define totalSizeMAX sizeScale * 800 * (size_t)1024
#define totalSizeSTEP 200 * (size_t)1024
/* objNULL needs to be odd so that it's ignored in exactRoots. */
-/* @@@@ Temporary fix W3I6MV */
-#define objNULL ((mps_addr_t)0xDECEA5EDDECEA5ED)
+#define objNULL ((mps_addr_t)MPS_WORD_CONST(0xDECEA5ED))
#define testArenaSIZE ((size_t)16<<20)
#define initTestFREQ 6000
#define stressTestFREQ 40
diff --git a/mps/code/steptest.c b/mps/code/steptest.c
index 0f357c511ea..b36d4c4fa5d 100644
--- a/mps/code/steptest.c
+++ b/mps/code/steptest.c
@@ -63,8 +63,7 @@ static int test_number = 0;
/* objNULL needs to be odd so that it's ignored in exactRoots. */
-/* @@@@ Temporary fix W3I6MV */
-#define objNULL ((mps_addr_t)0xDECEA5EDull)
+#define objNULL ((mps_addr_t)MPS_WORD_CONST(0xDECEA5ED))
static mps_pool_t pool;
static mps_ap_t ap;
diff --git a/mps/code/walkt0.c b/mps/code/walkt0.c
index 1764b3f9f10..4b2163d88ee 100644
--- a/mps/code/walkt0.c
+++ b/mps/code/walkt0.c
@@ -42,7 +42,7 @@ static mps_gen_param_s testChain[genCOUNT] = {
};
/* objNULL needs to be odd so that it's ignored in exactRoots. */
-#define objNULL ((mps_addr_t)0xDECEA5ED)
+#define objNULL ((mps_addr_t)MPS_WORD_CONST(0xDECEA5ED))
static mps_ap_t ap;
static mps_addr_t exactRoots[exactRootsCOUNT];