diff options
| author | David Lovemore | 2012-05-03 16:43:57 +0100 |
|---|---|---|
| committer | David Lovemore | 2012-05-03 16:43:57 +0100 |
| commit | 8f87261a136c91d4cd00d5ccc08b86ac864037ec (patch) | |
| tree | d296ba55ec6de62431ddb3f31368e1a7a300d125 /mps/code | |
| parent | 52db7a8d59afb7e43ab675de91a079245c3d104b (diff) | |
| parent | 9bf482ea08a4800df14251b30422a8cb9faf85b9 (diff) | |
| download | emacs-8f87261a136c91d4cd00d5ccc08b86ac864037ec.tar.gz emacs-8f87261a136c91d4cd00d5ccc08b86ac864037ec.zip | |
Merged from branch/2012-03-27/longest to pick up extra vararg fixes and casts on shift operands.
Copied from Perforce
Change: 178096
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
| -rw-r--r-- | mps/code/arena.c | 2 | ||||
| -rw-r--r-- | mps/code/arenavm.c | 51 | ||||
| -rw-r--r-- | mps/code/awlut.c | 12 | ||||
| -rw-r--r-- | mps/code/awluthe.c | 12 | ||||
| -rw-r--r-- | mps/code/awlutth.c | 12 | ||||
| -rw-r--r-- | mps/code/config.h | 2 | ||||
| -rw-r--r-- | mps/code/diag.c | 32 | ||||
| -rw-r--r-- | mps/code/fmtdy.c | 4 | ||||
| -rw-r--r-- | mps/code/fmthe.h | 4 | ||||
| -rw-r--r-- | mps/code/locus.c | 6 | ||||
| -rw-r--r-- | mps/code/mpm.c | 10 | ||||
| -rw-r--r-- | mps/code/mps.h | 2 | ||||
| -rw-r--r-- | mps/code/poolamc.c | 46 | ||||
| -rw-r--r-- | mps/code/poolawl.c | 2 | ||||
| -rw-r--r-- | mps/code/poollo.c | 2 | ||||
| -rw-r--r-- | mps/code/ref.c | 2 | ||||
| -rw-r--r-- | mps/code/steptest.c | 2 | ||||
| -rw-r--r-- | mps/code/table.c | 2 | ||||
| -rw-r--r-- | mps/code/trace.c | 22 | ||||
| -rw-r--r-- | mps/code/vmix.c | 8 | ||||
| -rw-r--r-- | mps/code/walkt0.c | 2 | ||||
| -rw-r--r-- | mps/code/zcoll.c | 6 |
22 files changed, 128 insertions, 115 deletions
diff --git a/mps/code/arena.c b/mps/code/arena.c index 4436e10ccf5..704d13f60db 100644 --- a/mps/code/arena.c +++ b/mps/code/arena.c | |||
| @@ -172,7 +172,7 @@ Res ArenaInit(Arena arena, ArenaClass class) | |||
| 172 | arena->spareCommitted = (Size)0; | 172 | arena->spareCommitted = (Size)0; |
| 173 | arena->spareCommitLimit = ARENA_INIT_SPARE_COMMIT_LIMIT; | 173 | arena->spareCommitLimit = ARENA_INIT_SPARE_COMMIT_LIMIT; |
| 174 | /* alignment is usually overridden by init */ | 174 | /* alignment is usually overridden by init */ |
| 175 | arena->alignment = 1 << ARENA_ZONESHIFT; | 175 | arena->alignment = (Align)1 << ARENA_ZONESHIFT; |
| 176 | /* zoneShift is usually overridden by init */ | 176 | /* zoneShift is usually overridden by init */ |
| 177 | arena->zoneShift = ARENA_ZONESHIFT; | 177 | arena->zoneShift = ARENA_ZONESHIFT; |
| 178 | arena->poolReady = FALSE; /* <design/arena/#pool.ready> */ | 178 | arena->poolReady = FALSE; /* <design/arena/#pool.ready> */ |
diff --git a/mps/code/arenavm.c b/mps/code/arenavm.c index 40a4d28a9b7..2b8a473d6bd 100644 --- a/mps/code/arenavm.c +++ b/mps/code/arenavm.c | |||
| @@ -1086,9 +1086,10 @@ static Res vmArenaExtend(VMArena vmArena, Size size) | |||
| 1086 | 1086 | ||
| 1087 | 1087 | ||
| 1088 | DIAG_SINGLEF(( "vmArenaExtend_Start", | 1088 | DIAG_SINGLEF(( "vmArenaExtend_Start", |
| 1089 | "to accommodate size $W, try chunkSize $W", size, chunkSize, | 1089 | "to accommodate size $W, try chunkSize $W", (WriteFW)size, (WriteFW)chunkSize, |
| 1090 | " (VMArenaReserved currently $W bytes)\n", | 1090 | " (VMArenaReserved currently $W bytes)\n", |
| 1091 | VMArenaReserved(VMArena2Arena(vmArena)), NULL )); | 1091 | (WriteFW)VMArenaReserved(VMArena2Arena(vmArena)), |
| 1092 | NULL )); | ||
| 1092 | 1093 | ||
| 1093 | /* .chunk-create.fail: If we fail, try again with a smaller size */ | 1094 | /* .chunk-create.fail: If we fail, try again with a smaller size */ |
| 1094 | { | 1095 | { |
| @@ -1111,9 +1112,10 @@ static Res vmArenaExtend(VMArena vmArena, Size size) | |||
| 1111 | for(; chunkSize > chunkHalf; chunkSize -= sliceSize) { | 1112 | for(; chunkSize > chunkHalf; chunkSize -= sliceSize) { |
| 1112 | if(chunkSize < chunkMin) { | 1113 | if(chunkSize < chunkMin) { |
| 1113 | DIAG_SINGLEF(( "vmArenaExtend_FailMin", | 1114 | DIAG_SINGLEF(( "vmArenaExtend_FailMin", |
| 1114 | "no remaining address-space chunk >= min($W)", chunkMin, | 1115 | "no remaining address-space chunk >= min($W)", (WriteFW)chunkMin, |
| 1115 | " (so VMArenaReserved remains $W bytes)\n", | 1116 | " (so VMArenaReserved remains $W bytes)\n", |
| 1116 | VMArenaReserved(VMArena2Arena(vmArena)), NULL )); | 1117 | (WriteFW)VMArenaReserved(VMArena2Arena(vmArena)), |
| 1118 | NULL )); | ||
| 1117 | return ResRESOURCE; | 1119 | return ResRESOURCE; |
| 1118 | } | 1120 | } |
| 1119 | res = VMChunkCreate(&newChunk, vmArena, chunkSize); | 1121 | res = VMChunkCreate(&newChunk, vmArena, chunkSize); |
| @@ -1126,9 +1128,10 @@ static Res vmArenaExtend(VMArena vmArena, Size size) | |||
| 1126 | vmArenaExtend_Done: | 1128 | vmArenaExtend_Done: |
| 1127 | 1129 | ||
| 1128 | DIAG_SINGLEF(( "vmArenaExtend_Done", | 1130 | DIAG_SINGLEF(( "vmArenaExtend_Done", |
| 1129 | "Request for new chunk of VM $W bytes succeeded", chunkSize, | 1131 | "Request for new chunk of VM $W bytes succeeded", (WriteFW)chunkSize, |
| 1130 | " (VMArenaReserved now $W bytes)\n", | 1132 | " (VMArenaReserved now $W bytes)\n", |
| 1131 | VMArenaReserved(VMArena2Arena(vmArena)), NULL )); | 1133 | (WriteFW)VMArenaReserved(VMArena2Arena(vmArena)), |
| 1134 | NULL )); | ||
| 1132 | 1135 | ||
| 1133 | return res; | 1136 | return res; |
| 1134 | } | 1137 | } |
| @@ -1628,16 +1631,16 @@ static void VMFree(Addr base, Size size, Pool pool) | |||
| 1628 | * Input: 208896 | 1631 | * Input: 208896 |
| 1629 | * Output: (Megabytes) 0m209 | 1632 | * Output: (Megabytes) 0m209 |
| 1630 | */ | 1633 | */ |
| 1631 | #define bPerM (1000000UL) /* Megabytes */ | 1634 | #define bPerM ((Size)1000000) /* Megabytes */ |
| 1632 | #define bThou (1000UL) | 1635 | #define bThou ((Size)1000) |
| 1633 | DIAG_DECL( | 1636 | DIAG_DECL( |
| 1634 | static Count M_whole(size_t bytes) | 1637 | static Count M_whole(Size bytes) |
| 1635 | { | 1638 | { |
| 1636 | size_t M; /* MBs */ | 1639 | Count M; /* MBs */ |
| 1637 | M = (bytes + (bThou / 2)) / bPerM; | 1640 | M = (bytes + (bThou / 2)) / bPerM; |
| 1638 | return M; | 1641 | return M; |
| 1639 | } | 1642 | } |
| 1640 | static Count M_frac(size_t bytes) | 1643 | static Count M_frac(Size bytes) |
| 1641 | { | 1644 | { |
| 1642 | Count Mthou; /* thousandths of a MB */ | 1645 | Count Mthou; /* thousandths of a MB */ |
| 1643 | Mthou = (bytes + (bThou / 2)) / bThou; | 1646 | Mthou = (bytes + (bThou / 2)) / bThou; |
| @@ -1689,16 +1692,22 @@ static void VMCompact(Arena arena, Trace trace) | |||
| 1689 | || vmem0 != vmem1 | 1692 | || vmem0 != vmem1 |
| 1690 | || vmem1 != vmem2) { | 1693 | || vmem1 != vmem2) { |
| 1691 | DIAG_SINGLEF(( "VMCompact", | 1694 | DIAG_SINGLEF(( "VMCompact", |
| 1692 | "pre-collection vmem was $Um$3, ", M_whole(vmem0), M_frac(vmem0), | 1695 | "pre-collection vmem was $Um$3, ", |
| 1693 | "peaked at $Um$3, ", M_whole(vmem1), M_frac(vmem1), | 1696 | (WriteFU)M_whole(vmem0), (WriteFU)M_frac(vmem0), |
| 1694 | "released $Um$3, ", M_whole(vmemD), M_frac(vmemD), | 1697 | "peaked at $Um$3, ", (WriteFU)M_whole(vmem1), (WriteFU)M_frac(vmem1), |
| 1695 | "now $Um$3", M_whole(vmem2), M_frac(vmem2), | 1698 | "released $Um$3, ", (WriteFU)M_whole(vmemD), (WriteFU)M_frac(vmemD), |
| 1696 | " (why $U", trace->why, | 1699 | "now $Um$3", (WriteFU)M_whole(vmem2), (WriteFU)M_frac(vmem2), |
| 1697 | ": $Um$3", M_whole(trace->condemned), M_frac(trace->condemned), | 1700 | " (why $U", (WriteFU)trace->why, |
| 1698 | "[->$Um$3", M_whole(live), M_frac(live), | 1701 | ": $Um$3", |
| 1699 | " $U%-live", livePerc, | 1702 | (WriteFU)M_whole(trace->condemned), (WriteFU)M_frac(trace->condemned), |
| 1700 | " $Um$3-stuck]", M_whole(trace->preservedInPlaceSize), M_frac(trace->preservedInPlaceSize), | 1703 | "[->$Um$3", (WriteFU)M_whole(live), (WriteFU)M_frac(live), |
| 1701 | " ($Um$3-not)", M_whole(trace->notCondemned), M_frac(trace->notCondemned), | 1704 | " $U%-live", (WriteFU)livePerc, |
| 1705 | " $Um$3-stuck]", | ||
| 1706 | (WriteFU)M_whole(trace->preservedInPlaceSize), | ||
| 1707 | (WriteFU)M_frac(trace->preservedInPlaceSize), | ||
| 1708 | " ($Um$3-not)", | ||
| 1709 | (WriteFU)M_whole(trace->notCondemned), | ||
| 1710 | (WriteFU)M_frac(trace->notCondemned), | ||
| 1702 | " )", | 1711 | " )", |
| 1703 | NULL)); | 1712 | NULL)); |
| 1704 | } | 1713 | } |
diff --git a/mps/code/awlut.c b/mps/code/awlut.c index ddcd1c7ab5d..d52abae9030 100644 --- a/mps/code/awlut.c +++ b/mps/code/awlut.c | |||
| @@ -43,9 +43,9 @@ static mps_word_t wrapper_wrapper[] = { | |||
| 43 | UNINIT, /* wrapper */ | 43 | UNINIT, /* wrapper */ |
| 44 | UNINIT, /* class */ | 44 | UNINIT, /* class */ |
| 45 | 0, /* Extra word */ | 45 | 0, /* Extra word */ |
| 46 | 4uL<<2|2, /* F */ | 46 | (mps_word_t)4<<2|2, /* F */ |
| 47 | 2uL<<(MPS_WORD_WIDTH - 8), /* V */ | 47 | (mps_word_t)2<<(MPS_WORD_WIDTH - 8), /* V */ |
| 48 | 1uL<<2|1, /* VL */ | 48 | (mps_word_t)1<<2|1, /* VL */ |
| 49 | 1 /* patterns */ | 49 | 1 /* patterns */ |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| @@ -55,7 +55,7 @@ static mps_word_t string_wrapper[] = { | |||
| 55 | UNINIT, /* class */ | 55 | UNINIT, /* class */ |
| 56 | 0, /* extra word */ | 56 | 0, /* extra word */ |
| 57 | 0, /* F */ | 57 | 0, /* F */ |
| 58 | 2uL<<(MPS_WORD_WIDTH - 8)|3uL<<3|4, /* V */ | 58 | (mps_word_t)2<<(MPS_WORD_WIDTH - 8)|(mps_word_t)3<<3|4, /* V */ |
| 59 | 1 /* VL */ | 59 | 1 /* VL */ |
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| @@ -63,8 +63,8 @@ static mps_word_t table_wrapper[] = { | |||
| 63 | UNINIT, /* wrapper */ | 63 | UNINIT, /* wrapper */ |
| 64 | UNINIT, /* class */ | 64 | UNINIT, /* class */ |
| 65 | 0, /* extra word */ | 65 | 0, /* extra word */ |
| 66 | 1uL<<2|1, /* F */ | 66 | (mps_word_t)1<<2|1, /* F */ |
| 67 | 2uL<<(MPS_WORD_WIDTH - 8)|2, /* V */ | 67 | (mps_word_t)2<<(MPS_WORD_WIDTH - 8)|2, /* V */ |
| 68 | 1 /* VL */ | 68 | 1 /* VL */ |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
diff --git a/mps/code/awluthe.c b/mps/code/awluthe.c index be40f115b38..d70d12cb342 100644 --- a/mps/code/awluthe.c +++ b/mps/code/awluthe.c | |||
| @@ -44,9 +44,9 @@ static mps_word_t wrapper_wrapper[] = { | |||
| 44 | UNINIT, /* wrapper */ | 44 | UNINIT, /* wrapper */ |
| 45 | UNINIT, /* class */ | 45 | UNINIT, /* class */ |
| 46 | 0, /* Extra word */ | 46 | 0, /* Extra word */ |
| 47 | 4uL<<2|2, /* F */ | 47 | (mps_word_t)4<<2|2, /* F */ |
| 48 | 2uL<<(MPS_WORD_WIDTH - 8), /* V */ | 48 | (mps_word_t)2<<(MPS_WORD_WIDTH - 8), /* V */ |
| 49 | 1uL<<2|1, /* VL */ | 49 | (mps_word_t)1<<2|1, /* VL */ |
| 50 | 1 /* patterns */ | 50 | 1 /* patterns */ |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| @@ -56,7 +56,7 @@ static mps_word_t string_wrapper[] = { | |||
| 56 | UNINIT, /* class */ | 56 | UNINIT, /* class */ |
| 57 | 0, /* extra word */ | 57 | 0, /* extra word */ |
| 58 | 0, /* F */ | 58 | 0, /* F */ |
| 59 | 2uL<<(MPS_WORD_WIDTH - 8)|3uL<<3|4, /* V */ | 59 | (mps_word_t)2<<(MPS_WORD_WIDTH - 8)|(mps_word_t)3<<3|4, /* V */ |
| 60 | 1 /* VL */ | 60 | 1 /* VL */ |
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| @@ -64,8 +64,8 @@ static mps_word_t table_wrapper[] = { | |||
| 64 | UNINIT, /* wrapper */ | 64 | UNINIT, /* wrapper */ |
| 65 | UNINIT, /* class */ | 65 | UNINIT, /* class */ |
| 66 | 0, /* extra word */ | 66 | 0, /* extra word */ |
| 67 | 1uL<<2|1, /* F */ | 67 | (mps_word_t)1<<2|1, /* F */ |
| 68 | 2uL<<(MPS_WORD_WIDTH - 8)|2, /* V */ | 68 | (mps_word_t)2<<(MPS_WORD_WIDTH - 8)|2, /* V */ |
| 69 | 1 /* VL */ | 69 | 1 /* VL */ |
| 70 | }; | 70 | }; |
| 71 | 71 | ||
diff --git a/mps/code/awlutth.c b/mps/code/awlutth.c index 37a27fc0125..26ef8c2c70d 100644 --- a/mps/code/awlutth.c +++ b/mps/code/awlutth.c | |||
| @@ -45,9 +45,9 @@ static mps_word_t wrapper_wrapper[] = { | |||
| 45 | UNINIT, /* wrapper */ | 45 | UNINIT, /* wrapper */ |
| 46 | UNINIT, /* class */ | 46 | UNINIT, /* class */ |
| 47 | 0, /* Extra word */ | 47 | 0, /* Extra word */ |
| 48 | 4uL<<2|2, /* F */ | 48 | (mps_word_t)4<<2|2, /* F */ |
| 49 | 2uL<<(MPS_WORD_WIDTH - 8), /* V */ | 49 | (mps_word_t)2<<(MPS_WORD_WIDTH - 8), /* V */ |
| 50 | 1uL<<2|1, /* VL */ | 50 | (mps_word_t)1<<2|1, /* VL */ |
| 51 | 1 /* patterns */ | 51 | 1 /* patterns */ |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| @@ -57,7 +57,7 @@ static mps_word_t string_wrapper[] = { | |||
| 57 | UNINIT, /* class */ | 57 | UNINIT, /* class */ |
| 58 | 0, /* extra word */ | 58 | 0, /* extra word */ |
| 59 | 0, /* F */ | 59 | 0, /* F */ |
| 60 | 2uL<<(MPS_WORD_WIDTH - 8)|3uL<<3|4, /* V */ | 60 | (mps_word_t)2<<(MPS_WORD_WIDTH - 8)|(mps_word_t)3<<3|4, /* V */ |
| 61 | 1 /* VL */ | 61 | 1 /* VL */ |
| 62 | }; | 62 | }; |
| 63 | 63 | ||
| @@ -65,8 +65,8 @@ static mps_word_t table_wrapper[] = { | |||
| 65 | UNINIT, /* wrapper */ | 65 | UNINIT, /* wrapper */ |
| 66 | UNINIT, /* class */ | 66 | UNINIT, /* class */ |
| 67 | 0, /* extra word */ | 67 | 0, /* extra word */ |
| 68 | 1uL<<2|1, /* F */ | 68 | (mps_word_t)1<<2|1, /* F */ |
| 69 | 2uL<<(MPS_WORD_WIDTH - 8)|2, /* V */ | 69 | (mps_word_t)2<<(MPS_WORD_WIDTH - 8)|2, /* V */ |
| 70 | 1 /* VL */ | 70 | 1 /* VL */ |
| 71 | }; | 71 | }; |
| 72 | 72 | ||
diff --git a/mps/code/config.h b/mps/code/config.h index ca6e796e48c..025e775ea88 100644 --- a/mps/code/config.h +++ b/mps/code/config.h | |||
| @@ -193,7 +193,7 @@ | |||
| 193 | * design.mps.poolepvm.arch.segment.size. | 193 | * design.mps.poolepvm.arch.segment.size. |
| 194 | */ | 194 | */ |
| 195 | 195 | ||
| 196 | #define EPVMDefaultSubsequentSegSIZE (64ul * 1024) | 196 | #define EPVMDefaultSubsequentSegSIZE ((Size)64 * 1024) |
| 197 | 197 | ||
| 198 | 198 | ||
| 199 | /* Arena Configuration -- see <code/arena.c> | 199 | /* Arena Configuration -- see <code/arena.c> |
diff --git a/mps/code/diag.c b/mps/code/diag.c index 03d95492c90..1cca976da03 100644 --- a/mps/code/diag.c +++ b/mps/code/diag.c | |||
| @@ -194,7 +194,7 @@ enum { | |||
| 194 | static void version_diag(void) | 194 | static void version_diag(void) |
| 195 | { | 195 | { |
| 196 | DIAG_SINGLEF(( "MPSVersion", | 196 | DIAG_SINGLEF(( "MPSVersion", |
| 197 | "$S", MPSVersion(), NULL )); | 197 | "$S", (WriteFS)MPSVersion(), NULL )); |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | static void rules_diag(Rule rules) | 200 | static void rules_diag(Rule rules) |
| @@ -207,8 +207,8 @@ static void rules_diag(Rule rules) | |||
| 207 | " rules:\n", NULL )); | 207 | " rules:\n", NULL )); |
| 208 | for(ir = 0; rules[ir].action != NULL; ir++) { | 208 | for(ir = 0; rules[ir].action != NULL; ir++) { |
| 209 | DIAG_DECL( Rule rule = &rules[ir]; ) | 209 | DIAG_DECL( Rule rule = &rules[ir]; ) |
| 210 | DIAG_MOREF(( "$S$S/$S/$S\n", rule->action, rule->tag, | 210 | DIAG_MOREF(( "$S$S/$S/$S\n", (WriteFS)rule->action, (WriteFS)rule->tag, |
| 211 | rule->para, rule->line, | 211 | (WriteFS)rule->para, (WriteFS)rule->line, |
| 212 | NULL )); | 212 | NULL )); |
| 213 | } | 213 | } |
| 214 | DIAG_END("DiagFilter_Rules"); | 214 | DIAG_END("DiagFilter_Rules"); |
| @@ -378,7 +378,7 @@ static void filterStream_Output(Diag diag, Rule rules) | |||
| 378 | if(rules[ir].action[0] == '+' || diag->overflow) { | 378 | if(rules[ir].action[0] == '+' || diag->overflow) { |
| 379 | if(nolinesyet) { | 379 | if(nolinesyet) { |
| 380 | res = WriteF(filterStream_under(), | 380 | res = WriteF(filterStream_under(), |
| 381 | DIAG_PREFIX_TAGSTART "$S {", diag->tag, NULL); | 381 | DIAG_PREFIX_TAGSTART "$S {", (WriteFS)diag->tag, NULL); |
| 382 | AVER(res == ResOK); | 382 | AVER(res == ResOK); |
| 383 | nolinesyet = FALSE; | 383 | nolinesyet = FALSE; |
| 384 | } | 384 | } |
| @@ -452,7 +452,7 @@ static void filterStream_TagEnd(mps_lib_FILE *stream, const char *tag) | |||
| 452 | (void) WriteF(filterStream_under(), | 452 | (void) WriteF(filterStream_under(), |
| 453 | "\nWARNING: diag tag \"$S\" is current, " | 453 | "\nWARNING: diag tag \"$S\" is current, " |
| 454 | "but got DIAG_END(\"$S\"). (They must match).", | 454 | "but got DIAG_END(\"$S\"). (They must match).", |
| 455 | diag->tag, tag, NULL); | 455 | (WriteFS)diag->tag, (WriteFS)tag, NULL); |
| 456 | } | 456 | } |
| 457 | AVER(StringEqual(diag->tag, tag)); | 457 | AVER(StringEqual(diag->tag, tag)); |
| 458 | 458 | ||
| @@ -551,7 +551,7 @@ static void diagTagBegin(mps_lib_FILE *stream, const char *tag) | |||
| 551 | filterStream_TagBegin(stream, tag); | 551 | filterStream_TagBegin(stream, tag); |
| 552 | } else { | 552 | } else { |
| 553 | Res res; | 553 | Res res; |
| 554 | res = WriteF(stream, DIAG_PREFIX_TAGSTART "$S {\n", tag, NULL); | 554 | res = WriteF(stream, DIAG_PREFIX_TAGSTART "$S {\n", (WriteFS)tag, NULL); |
| 555 | AVER(res == ResOK); | 555 | AVER(res == ResOK); |
| 556 | } | 556 | } |
| 557 | } | 557 | } |
| @@ -672,7 +672,7 @@ static void patternOccurs_test(Bool expect, const char *patt, | |||
| 672 | 672 | ||
| 673 | static void diag_test(void) | 673 | static void diag_test(void) |
| 674 | { | 674 | { |
| 675 | DIAG_SINGLEF(( "DIAGTEST_Tag1", "text $U.\n", 42, NULL )); | 675 | DIAG_SINGLEF(( "DIAGTEST_Tag1", "text $U.\n", (WriteFU)42, NULL )); |
| 676 | 676 | ||
| 677 | DIAG_SINGLEF(( "DIAGTEST_EmptyDiag", NULL )); | 677 | DIAG_SINGLEF(( "DIAGTEST_EmptyDiag", NULL )); |
| 678 | 678 | ||
| @@ -682,12 +682,12 @@ static void diag_test(void) | |||
| 682 | StringEqual("Fred", "Fred"), | 682 | StringEqual("Fred", "Fred"), |
| 683 | NULL | 683 | NULL |
| 684 | )); | 684 | )); |
| 685 | DIAG_MOREF(("Fred = Tom: $U.\n", StringEqual("Fred", "Tom"), NULL)); | 685 | DIAG_MOREF(("Fred = Tom: $U.\n", (WriteFU)StringEqual("Fred", "Tom"), NULL)); |
| 686 | DIAG_MOREF(("Tom = Fred: $U.\n", StringEqual("Tom", "Fred"), NULL)); | 686 | DIAG_MOREF(("Tom = Fred: $U.\n", (WriteFU)StringEqual("Tom", "Fred"), NULL)); |
| 687 | DIAG_MOREF(("0 = Fred: $U.\n", StringEqual("", "Fred"), NULL)); | 687 | DIAG_MOREF(("0 = Fred: $U.\n", (WriteFU)StringEqual("", "Fred"), NULL)); |
| 688 | DIAG_MOREF(("Fred = 0: $U.\n", StringEqual("Fred", ""), NULL)); | 688 | DIAG_MOREF(("Fred = 0: $U.\n", (WriteFU)StringEqual("Fred", ""), NULL)); |
| 689 | DIAG_MOREF(("0 = 0: $U.\n", StringEqual("", ""), NULL)); | 689 | DIAG_MOREF(("0 = 0: $U.\n", (WriteFU)StringEqual("", ""), NULL)); |
| 690 | DIAG_MOREF(("0 = 000: $U.\n", StringEqual("", "\0\0"), NULL)); | 690 | DIAG_MOREF(("0 = 000: $U.\n", (WriteFU)StringEqual("", "\0\0"), NULL)); |
| 691 | DIAG_END("DIAGTEST_StringEqual"); | 691 | DIAG_END("DIAGTEST_StringEqual"); |
| 692 | 692 | ||
| 693 | DIAG_FIRSTF(( "DIAGTEST_patternOccurs", NULL )); | 693 | DIAG_FIRSTF(( "DIAGTEST_patternOccurs", NULL )); |
| @@ -718,11 +718,11 @@ static void diag_test(void) | |||
| 718 | DIAG_END("DIAGTEST_patternOccurs"); | 718 | DIAG_END("DIAGTEST_patternOccurs"); |
| 719 | 719 | ||
| 720 | #if 0 | 720 | #if 0 |
| 721 | DIAG_FIRSTF(( "TestTag2", "text $U.\n", 42, NULL )); | 721 | DIAG_FIRSTF(( "TestTag2", "text $U.\n", (WriteFU)42, NULL )); |
| 722 | DIAG_MOREF(( NULL )); | 722 | DIAG_MOREF(( NULL )); |
| 723 | DIAG_MOREF(( "string $S.\n", "fooey!", NULL )); | 723 | DIAG_MOREF(( "string $S.\n", (WriteFS)"fooey!", NULL )); |
| 724 | DIAG_MOREF(( NULL )); | 724 | DIAG_MOREF(( NULL )); |
| 725 | DIAG_MOREF(( "Another string $S.\n", "baloney!", NULL )); | 725 | DIAG_MOREF(( "Another string $S.\n", (WriteFS)"baloney!", NULL )); |
| 726 | DIAG_END( "TestTag2" ); | 726 | DIAG_END( "TestTag2" ); |
| 727 | #endif | 727 | #endif |
| 728 | } | 728 | } |
diff --git a/mps/code/fmtdy.c b/mps/code/fmtdy.c index 1485476394f..ec87c1fa001 100644 --- a/mps/code/fmtdy.c +++ b/mps/code/fmtdy.c | |||
| @@ -247,7 +247,7 @@ extern mps_addr_t dylan_weak_dependent(mps_addr_t parent) | |||
| 247 | ff = fword & 3; | 247 | ff = fword & 3; |
| 248 | /* traceable fixed part */ | 248 | /* traceable fixed part */ |
| 249 | assert(ff == 1); | 249 | assert(ff == 1); |
| 250 | fl = fword & ~3uL; | 250 | fl = fword & ~(mps_word_t)3; |
| 251 | /* at least one fixed field */ | 251 | /* at least one fixed field */ |
| 252 | assert(fl >= 1); | 252 | assert(fl >= 1); |
| 253 | return (mps_addr_t) object[1]; | 253 | return (mps_addr_t) object[1]; |
| @@ -354,7 +354,7 @@ static mps_res_t dylan_scan_pat(mps_ss_t mps_ss, | |||
| 354 | 354 | ||
| 355 | #define NONWORD_LENGTH(_vt, _es) \ | 355 | #define NONWORD_LENGTH(_vt, _es) \ |
| 356 | ((_es) < MPS_WORD_SHIFT ? \ | 356 | ((_es) < MPS_WORD_SHIFT ? \ |
| 357 | ((_vt) + (1 << (MPS_WORD_SHIFT - (_es))) - 1) >> \ | 357 | ((_vt) + ((mps_word_t)1 << (MPS_WORD_SHIFT - (_es))) - 1) >> \ |
| 358 | (MPS_WORD_SHIFT - (_es)) : \ | 358 | (MPS_WORD_SHIFT - (_es)) : \ |
| 359 | (_vt) << ((_es) - MPS_WORD_SHIFT)) | 359 | (_vt) << ((_es) - MPS_WORD_SHIFT)) |
| 360 | 360 | ||
diff --git a/mps/code/fmthe.h b/mps/code/fmthe.h index 391ead0ef55..369a6b4a926 100644 --- a/mps/code/fmthe.h +++ b/mps/code/fmthe.h | |||
| @@ -21,9 +21,9 @@ extern mps_res_t HeaderWeakFormatCheck(mps_addr_t addr); | |||
| 21 | #define realTYPE 0x33 | 21 | #define realTYPE 0x33 |
| 22 | #define realHeader (realTYPE + 0x12345600) | 22 | #define realHeader (realTYPE + 0x12345600) |
| 23 | #define padTYPE 0xaa | 23 | #define padTYPE 0xaa |
| 24 | #define headerType(header) ((header) & ((1 << headerTypeBits) - 1)) | 24 | #define headerType(header) ((header) & (((mps_word_t)1 << headerTypeBits) - 1)) |
| 25 | #define headerPadSize(header) ((header) >> headerTypeBits) | 25 | #define headerPadSize(header) ((header) >> headerTypeBits) |
| 26 | #define padHeader(size) ((size << headerTypeBits) | padTYPE) | 26 | #define padHeader(size) (((mps_word_t)size << headerTypeBits) | padTYPE) |
| 27 | 27 | ||
| 28 | #endif /* fmthe_h */ | 28 | #endif /* fmthe_h */ |
| 29 | 29 | ||
diff --git a/mps/code/locus.c b/mps/code/locus.c index 2c94d0f71b3..56e7a1208c6 100644 --- a/mps/code/locus.c +++ b/mps/code/locus.c | |||
| @@ -296,9 +296,9 @@ Res ChainCondemnAuto(double *mortalityReturn, Chain chain, Trace trace) | |||
| 296 | } while (genNewSize >= gen->capacity * (Size)1024); | 296 | } while (genNewSize >= gen->capacity * (Size)1024); |
| 297 | 297 | ||
| 298 | DIAG_SINGLEF(( "ChainCondemnAuto", | 298 | DIAG_SINGLEF(( "ChainCondemnAuto", |
| 299 | "condemn gens [0..$U]", topCondemnedGenSerial, | 299 | "condemn gens [0..$U]", (WriteFU)topCondemnedGenSerial, |
| 300 | " (of $U)", chain->genCount, | 300 | " (of $U)", (WriteFU)chain->genCount, |
| 301 | " of this chain $P.", (void*)chain, | 301 | " of this chain $P.", (WriteFP)chain, |
| 302 | NULL )); | 302 | NULL )); |
| 303 | 303 | ||
| 304 | /* Condemn everything in these zones. */ | 304 | /* Condemn everything in these zones. */ |
diff --git a/mps/code/mpm.c b/mps/code/mpm.c index 8af2ffff7ee..4f9af3f888c 100644 --- a/mps/code/mpm.c +++ b/mps/code/mpm.c | |||
| @@ -34,7 +34,7 @@ unsigned CheckLevel = CHECKLEVEL_INITIAL; | |||
| 34 | Bool MPMCheck(void) | 34 | Bool MPMCheck(void) |
| 35 | { | 35 | { |
| 36 | CHECKL(sizeof(Word) * CHAR_BIT == MPS_WORD_WIDTH); | 36 | CHECKL(sizeof(Word) * CHAR_BIT == MPS_WORD_WIDTH); |
| 37 | CHECKL(1uL << MPS_WORD_SHIFT == MPS_WORD_WIDTH); | 37 | CHECKL((Word)1 << MPS_WORD_SHIFT == MPS_WORD_WIDTH); |
| 38 | CHECKL(AlignCheck(MPS_PF_ALIGN)); | 38 | CHECKL(AlignCheck(MPS_PF_ALIGN)); |
| 39 | /* Check that trace ids will fit in the TraceId type. */ | 39 | /* Check that trace ids will fit in the TraceId type. */ |
| 40 | CHECKL(TraceLIMIT <= UINT_MAX); | 40 | CHECKL(TraceLIMIT <= UINT_MAX); |
| @@ -52,10 +52,10 @@ Bool MPMCheck(void) | |||
| 52 | CHECKL(!SizeIsAligned(31051, 1024)); | 52 | CHECKL(!SizeIsAligned(31051, 1024)); |
| 53 | CHECKL(!SizeIsP2(0)); | 53 | CHECKL(!SizeIsP2(0)); |
| 54 | CHECKL(SizeIsP2(128)); | 54 | CHECKL(SizeIsP2(128)); |
| 55 | CHECKL(SizeLog2(1L) == 0); | 55 | CHECKL(SizeLog2((Size)1) == 0); |
| 56 | CHECKL(SizeLog2(256L) == 8); | 56 | CHECKL(SizeLog2((Size)256) == 8); |
| 57 | CHECKL(SizeLog2(65536L) == 16); | 57 | CHECKL(SizeLog2((Size)65536) == 16); |
| 58 | CHECKL(SizeLog2(131072L) == 17); | 58 | CHECKL(SizeLog2((Size)131072) == 17); |
| 59 | 59 | ||
| 60 | /* .check.writef: We check that various types will fit in a Word; */ | 60 | /* .check.writef: We check that various types will fit in a Word; */ |
| 61 | /* See .writef.check. Don't need to check WriteFS or WriteFF as they */ | 61 | /* See .writef.check. Don't need to check WriteFS or WriteFF as they */ |
diff --git a/mps/code/mps.h b/mps/code/mps.h index af718b7ce5d..fd2c850ccf0 100644 --- a/mps/code/mps.h +++ b/mps/code/mps.h | |||
| @@ -631,7 +631,7 @@ extern mps_res_t mps_fix(mps_ss_t, mps_addr_t *); | |||
| 631 | { | 631 | { |
| 632 | 632 | ||
| 633 | #define MPS_FIX1(ss, ref) \ | 633 | #define MPS_FIX1(ss, ref) \ |
| 634 | (_mps_wt = 1uL << ((mps_word_t)(ref) >> _mps_w0 \ | 634 | (_mps_wt = (mps_word_t)1 << ((mps_word_t)(ref) >> _mps_w0 \ |
| 635 | & (sizeof(mps_word_t) * CHAR_BIT - 1)), \ | 635 | & (sizeof(mps_word_t) * CHAR_BIT - 1)), \ |
| 636 | _mps_w2 |= _mps_wt, \ | 636 | _mps_w2 |= _mps_wt, \ |
| 637 | _mps_w1 & _mps_wt) | 637 | _mps_w1 & _mps_wt) |
diff --git a/mps/code/poolamc.c b/mps/code/poolamc.c index fc33cbbe548..3614590c8a8 100644 --- a/mps/code/poolamc.c +++ b/mps/code/poolamc.c | |||
| @@ -536,7 +536,7 @@ static Bool amcNailboardCheck(amcNailboard board) | |||
| 536 | /* We know that shift corresponds to pool->align. */ | 536 | /* We know that shift corresponds to pool->align. */ |
| 537 | CHECKL(BoolCheck(board->newMarks)); | 537 | CHECKL(BoolCheck(board->newMarks)); |
| 538 | CHECKL(board->distinctNails <= board->nails); | 538 | CHECKL(board->distinctNails <= board->nails); |
| 539 | CHECKL(1uL << board->markShift | 539 | CHECKL((Align)1 << board->markShift |
| 540 | == PoolAlignment(amcGenPool(board->gen))); | 540 | == PoolAlignment(amcGenPool(board->gen))); |
| 541 | /* weak check for BTs @@@@ */ | 541 | /* weak check for BTs @@@@ */ |
| 542 | CHECKL(board->mark != NULL); | 542 | CHECKL(board->mark != NULL); |
| @@ -2219,28 +2219,28 @@ static void AMCTraceEnd(Pool pool, Trace trace) | |||
| 2219 | 2219 | ||
| 2220 | if(amc->pageretstruct[ti].pRet >= pRetMin) { | 2220 | if(amc->pageretstruct[ti].pRet >= pRetMin) { |
| 2221 | DIAG_SINGLEF(( "AMCTraceEnd_pageret", | 2221 | DIAG_SINGLEF(( "AMCTraceEnd_pageret", |
| 2222 | " $U", ArenaEpoch(pool->arena), | 2222 | " $U", (WriteFU)ArenaEpoch(pool->arena), |
| 2223 | " $U", trace->why, | 2223 | " $U", (WriteFU)trace->why, |
| 2224 | " $S", trace->emergency ? "Emergency" : "-", | 2224 | " $S", (WriteFS)(trace->emergency ? "Emergency" : "-"), |
| 2225 | " $U", amc->pageretstruct[ti].pCond, | 2225 | " $U", (WriteFU)amc->pageretstruct[ti].pCond, |
| 2226 | " $U", amc->pageretstruct[ti].pRet, ",", | 2226 | " $U", (WriteFU)amc->pageretstruct[ti].pRet, ",", |
| 2227 | " $U", amc->pageretstruct[ti].pCS, | 2227 | " $U", (WriteFU)amc->pageretstruct[ti].pCS, |
| 2228 | " $U", amc->pageretstruct[ti].pRS, ",", | 2228 | " $U", (WriteFU)amc->pageretstruct[ti].pRS, ",", |
| 2229 | " $U", amc->pageretstruct[ti].sCM, | 2229 | " $U", (WriteFU)amc->pageretstruct[ti].sCM, |
| 2230 | " $U", amc->pageretstruct[ti].pCM, | 2230 | " $U", (WriteFU)amc->pageretstruct[ti].pCM, |
| 2231 | " $U", amc->pageretstruct[ti].sRM, | 2231 | " $U", (WriteFU)amc->pageretstruct[ti].sRM, |
| 2232 | " $U", amc->pageretstruct[ti].pRM, | 2232 | " $U", (WriteFU)amc->pageretstruct[ti].pRM, |
| 2233 | " $U", amc->pageretstruct[ti].pRM1, | 2233 | " $U", (WriteFU)amc->pageretstruct[ti].pRM1, |
| 2234 | " $U", amc->pageretstruct[ti].pRMrr, | 2234 | " $U", (WriteFU)amc->pageretstruct[ti].pRMrr, |
| 2235 | " $U", amc->pageretstruct[ti].pRMr1, ",", | 2235 | " $U", (WriteFU)amc->pageretstruct[ti].pRMr1, ",", |
| 2236 | " $U", amc->pageretstruct[ti].sCL, | 2236 | " $U", (WriteFU)amc->pageretstruct[ti].sCL, |
| 2237 | " $U", amc->pageretstruct[ti].pCL, | 2237 | " $U", (WriteFU)amc->pageretstruct[ti].pCL, |
| 2238 | " $U", amc->pageretstruct[ti].sRL, | 2238 | " $U", (WriteFU)amc->pageretstruct[ti].sRL, |
| 2239 | " $U", amc->pageretstruct[ti].pRL, | 2239 | " $U", (WriteFU)amc->pageretstruct[ti].pRL, |
| 2240 | " $U", amc->pageretstruct[ti].pRLr, | 2240 | " $U", (WriteFU)amc->pageretstruct[ti].pRLr, |
| 2241 | " (page = $Ub,", ArenaAlign(pool->arena), | 2241 | " (page = $Ub,", (WriteFU)ArenaAlign(pool->arena), |
| 2242 | " Large >= $Up,", AMCLargeSegPAGES, | 2242 | " Large >= $Up,", (WriteFU)AMCLargeSegPAGES, |
| 2243 | " pRetMin $U)", pRetMin, | 2243 | " pRetMin $U)", (WriteFU)pRetMin, |
| 2244 | NULL )); | 2244 | NULL )); |
| 2245 | } | 2245 | } |
| 2246 | 2246 | ||
diff --git a/mps/code/poolawl.c b/mps/code/poolawl.c index 38673219495..bb010854a6a 100644 --- a/mps/code/poolawl.c +++ b/mps/code/poolawl.c | |||
| @@ -1242,7 +1242,7 @@ static Bool AWLCheck(AWL awl) | |||
| 1242 | CHECKS(AWL, awl); | 1242 | CHECKS(AWL, awl); |
| 1243 | CHECKD(Pool, &awl->poolStruct); | 1243 | CHECKD(Pool, &awl->poolStruct); |
| 1244 | CHECKL(awl->poolStruct.class == AWLPoolClassGet()); | 1244 | CHECKL(awl->poolStruct.class == AWLPoolClassGet()); |
| 1245 | CHECKL(1uL << awl->alignShift == awl->poolStruct.alignment); | 1245 | CHECKL((Align)1 << awl->alignShift == awl->poolStruct.alignment); |
| 1246 | CHECKD(Chain, awl->chain); | 1246 | CHECKD(Chain, awl->chain); |
| 1247 | /* 30 is just a sanity check really, not a constraint. */ | 1247 | /* 30 is just a sanity check really, not a constraint. */ |
| 1248 | CHECKL(0 <= awl->gen); | 1248 | CHECKL(0 <= awl->gen); |
diff --git a/mps/code/poollo.c b/mps/code/poollo.c index c6f22a595cf..49346f4cb56 100644 --- a/mps/code/poollo.c +++ b/mps/code/poollo.c | |||
| @@ -817,7 +817,7 @@ static Bool LOCheck(LO lo) | |||
| 817 | CHECKD(Pool, &lo->poolStruct); | 817 | CHECKD(Pool, &lo->poolStruct); |
| 818 | CHECKL(lo->poolStruct.class == EnsureLOPoolClass()); | 818 | CHECKL(lo->poolStruct.class == EnsureLOPoolClass()); |
| 819 | CHECKL(ShiftCheck(lo->alignShift)); | 819 | CHECKL(ShiftCheck(lo->alignShift)); |
| 820 | CHECKL(1uL << lo->alignShift == PoolAlignment(&lo->poolStruct)); | 820 | CHECKL((Align)1 << lo->alignShift == PoolAlignment(&lo->poolStruct)); |
| 821 | CHECKD(Chain, lo->chain); | 821 | CHECKD(Chain, lo->chain); |
| 822 | CHECKD(PoolGen, &lo->pgen); | 822 | CHECKD(PoolGen, &lo->pgen); |
| 823 | return TRUE; | 823 | return TRUE; |
diff --git a/mps/code/ref.c b/mps/code/ref.c index a52fd60064b..fd11743cb1e 100644 --- a/mps/code/ref.c +++ b/mps/code/ref.c | |||
| @@ -27,7 +27,7 @@ Bool RankCheck(Rank rank) | |||
| 27 | 27 | ||
| 28 | Bool RankSetCheck(RankSet rankSet) | 28 | Bool RankSetCheck(RankSet rankSet) |
| 29 | { | 29 | { |
| 30 | CHECKL(rankSet < (1uL << RankLIMIT)); | 30 | CHECKL(rankSet < ((ULongest)1 << RankLIMIT)); |
| 31 | UNUSED(rankSet); /* <code/mpm.c#check.unused> */ | 31 | UNUSED(rankSet); /* <code/mpm.c#check.unused> */ |
| 32 | return TRUE; | 32 | return TRUE; |
| 33 | } | 33 | } |
diff --git a/mps/code/steptest.c b/mps/code/steptest.c index 821a0d5c95a..16477d10f8e 100644 --- a/mps/code/steptest.c +++ b/mps/code/steptest.c | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | #include <stdlib.h> | 19 | #include <stdlib.h> |
| 20 | #include <string.h> | 20 | #include <string.h> |
| 21 | 21 | ||
| 22 | #define testArenaSIZE ((size_t)(64l << 20)) | 22 | #define testArenaSIZE ((size_t)((size_t)64 << 20)) |
| 23 | #define avLEN 3 | 23 | #define avLEN 3 |
| 24 | #define exactRootsCOUNT 200 | 24 | #define exactRootsCOUNT 200 |
| 25 | #define ambigRootsCOUNT 50 | 25 | #define ambigRootsCOUNT 50 |
diff --git a/mps/code/table.c b/mps/code/table.c index e1db04202b3..772e45d9d30 100644 --- a/mps/code/table.c +++ b/mps/code/table.c | |||
| @@ -157,7 +157,7 @@ extern Res TableCreate(Table *tableReturn, size_t length) | |||
| 157 | if(table == NULL) goto failMallocTable; | 157 | if(table == NULL) goto failMallocTable; |
| 158 | if (length < 2) length = 2; | 158 | if (length < 2) length = 2; |
| 159 | /* Table size is length rounded up to the next power of 2. */ | 159 | /* Table size is length rounded up to the next power of 2. */ |
| 160 | table->length = 1 << (sizeFloorLog2(length-1) + 1); | 160 | table->length = (size_t)1 << (sizeFloorLog2(length-1) + 1); |
| 161 | table->count = 0; | 161 | table->count = 0; |
| 162 | table->limit = (size_t)(.5 * length); | 162 | table->limit = (size_t)(.5 * length); |
| 163 | table->array = malloc(sizeof(TableEntryStruct) * length); | 163 | table->array = malloc(sizeof(TableEntryStruct) * length); |
diff --git a/mps/code/trace.c b/mps/code/trace.c index e553d160318..0a7b73efa70 100644 --- a/mps/code/trace.c +++ b/mps/code/trace.c | |||
| @@ -123,7 +123,7 @@ Bool TraceIdCheck(TraceId ti) | |||
| 123 | 123 | ||
| 124 | Bool TraceSetCheck(TraceSet ts) | 124 | Bool TraceSetCheck(TraceSet ts) |
| 125 | { | 125 | { |
| 126 | CHECKL(ts < (1uL << TraceLIMIT)); | 126 | CHECKL(ts < ((ULongest)1 << TraceLIMIT)); |
| 127 | UNUSED(ts); /* <code/mpm.c#check.unused> */ | 127 | UNUSED(ts); /* <code/mpm.c#check.unused> */ |
| 128 | return TRUE; | 128 | return TRUE; |
| 129 | } | 129 | } |
| @@ -309,7 +309,7 @@ static void traceSetSignalEmergency(TraceSet ts, Arena arena) | |||
| 309 | Trace trace; | 309 | Trace trace; |
| 310 | 310 | ||
| 311 | DIAG_SINGLEF(( "traceSetSignalEmergency", | 311 | DIAG_SINGLEF(( "traceSetSignalEmergency", |
| 312 | "traceSet: $B", ts, NULL )); | 312 | "traceSet: $B", (WriteFB)ts, NULL )); |
| 313 | 313 | ||
| 314 | TRACE_SET_ITER(ti, trace, ts, arena) | 314 | TRACE_SET_ITER(ti, trace, ts, arena) |
| 315 | trace->emergency = TRUE; | 315 | trace->emergency = TRUE; |
| @@ -1527,20 +1527,20 @@ static void TraceStartGenDesc_diag(GenDesc desc, int i) | |||
| 1527 | NULL )); | 1527 | NULL )); |
| 1528 | } else { | 1528 | } else { |
| 1529 | DIAG_WRITEF(( DIAG_STREAM, | 1529 | DIAG_WRITEF(( DIAG_STREAM, |
| 1530 | " GenDesc [$U]", i, | 1530 | " GenDesc [$U]", (WriteFU)i, |
| 1531 | NULL )); | 1531 | NULL )); |
| 1532 | } | 1532 | } |
| 1533 | DIAG_WRITEF(( DIAG_STREAM, | 1533 | DIAG_WRITEF(( DIAG_STREAM, |
| 1534 | " $P capacity: $U KiB, mortality $D\n", | 1534 | " $P capacity: $U KiB, mortality $D\n", |
| 1535 | (void *)desc, desc->capacity, desc->mortality, | 1535 | (WriteFP)desc, (WriteFU)desc->capacity, (WriteFD)desc->mortality, |
| 1536 | " ZoneSet:$B\n", desc->zones, | 1536 | " ZoneSet:$B\n", (WriteFB)desc->zones, |
| 1537 | NULL )); | 1537 | NULL )); |
| 1538 | RING_FOR(n, &desc->locusRing, nn) { | 1538 | RING_FOR(n, &desc->locusRing, nn) { |
| 1539 | DIAG_DECL( PoolGen gen = RING_ELT(PoolGen, genRing, n); ) | 1539 | DIAG_DECL( PoolGen gen = RING_ELT(PoolGen, genRing, n); ) |
| 1540 | DIAG_WRITEF(( DIAG_STREAM, | 1540 | DIAG_WRITEF(( DIAG_STREAM, |
| 1541 | " PoolGen $U ($S)", gen->nr, gen->pool->class->name, | 1541 | " PoolGen $U ($S)", (WriteFU)gen->nr, (WriteFS)gen->pool->class->name, |
| 1542 | " totalSize $U", gen->totalSize, | 1542 | " totalSize $U", (WriteFU)gen->totalSize, |
| 1543 | " newSize $U\n", gen->newSizeAtCreate, | 1543 | " newSize $U\n", (WriteFU)gen->newSizeAtCreate, |
| 1544 | NULL )); | 1544 | NULL )); |
| 1545 | } | 1545 | } |
| 1546 | } | 1546 | } |
| @@ -1606,14 +1606,14 @@ void TraceStart(Trace trace, double mortality, double finishingTime) | |||
| 1606 | 1606 | ||
| 1607 | DIAG_FIRSTF(( "TraceStart", | 1607 | DIAG_FIRSTF(( "TraceStart", |
| 1608 | "because code $U: $S\n", | 1608 | "because code $U: $S\n", |
| 1609 | trace->why, TraceStartWhyToString(trace->why), | 1609 | (WriteFU)trace->why, (WriteFS)TraceStartWhyToString(trace->why), |
| 1610 | NULL )); | 1610 | NULL )); |
| 1611 | 1611 | ||
| 1612 | DIAG( ArenaDescribe(arena, DIAG_STREAM); ); | 1612 | DIAG( ArenaDescribe(arena, DIAG_STREAM); ); |
| 1613 | 1613 | ||
| 1614 | DIAG_MOREF(( | 1614 | DIAG_MOREF(( |
| 1615 | " white set:$B\n", | 1615 | " white set:$B\n", |
| 1616 | trace->white, | 1616 | (WriteFB)trace->white, |
| 1617 | NULL )); | 1617 | NULL )); |
| 1618 | 1618 | ||
| 1619 | { | 1619 | { |
| @@ -1626,7 +1626,7 @@ void TraceStart(Trace trace, double mortality, double finishingTime) | |||
| 1626 | RING_FOR(node, &arena->chainRing, nextNode) { | 1626 | RING_FOR(node, &arena->chainRing, nextNode) { |
| 1627 | Chain chain = RING_ELT(Chain, chainRing, node); | 1627 | Chain chain = RING_ELT(Chain, chainRing, node); |
| 1628 | DIAG_WRITEF(( DIAG_STREAM, | 1628 | DIAG_WRITEF(( DIAG_STREAM, |
| 1629 | " Chain $P\n", (void *)chain, | 1629 | " Chain $P\n", (WriteFP)chain, |
| 1630 | NULL )); | 1630 | NULL )); |
| 1631 | 1631 | ||
| 1632 | for(i = 0; i < chain->genCount; ++i) { | 1632 | for(i = 0; i < chain->genCount; ++i) { |
diff --git a/mps/code/vmix.c b/mps/code/vmix.c index 71f6354a32c..f5ba622f7c9 100644 --- a/mps/code/vmix.c +++ b/mps/code/vmix.c | |||
| @@ -164,7 +164,9 @@ Res VMCreate(VM *vmReturn, Size size) | |||
| 164 | DIAG_SINGLEF(( | 164 | DIAG_SINGLEF(( |
| 165 | "VM_ix_Create_ok", | 165 | "VM_ix_Create_ok", |
| 166 | "[$W..<$W>..$W)", | 166 | "[$W..<$W>..$W)", |
| 167 | vm->base, (char*)vm->limit - (char*)vm->base, vm->limit, | 167 | (WriteFW)vm->base, |
| 168 | (WriteFW)AddrOffset(vm->base, vm->limit), | ||
| 169 | (WriteFW)vm->limit, | ||
| 168 | NULL )); | 170 | NULL )); |
| 169 | 171 | ||
| 170 | *vmReturn = vm; | 172 | *vmReturn = vm; |
| @@ -188,7 +190,9 @@ void VMDestroy(VM vm) | |||
| 188 | DIAG_SINGLEF(( | 190 | DIAG_SINGLEF(( |
| 189 | "VM_ix_Destroy", | 191 | "VM_ix_Destroy", |
| 190 | "[$W..<$W>..$W)", | 192 | "[$W..<$W>..$W)", |
| 191 | vm->base, (char*)vm->limit - (char*)vm->base, vm->limit, | 193 | (WriteFW)vm->base, |
| 194 | (WriteFW)AddrOffset(vm->base, vm->limit), | ||
| 195 | (WriteFW)vm->limit, | ||
| 192 | NULL )); | 196 | NULL )); |
| 193 | 197 | ||
| 194 | /* This appears to be pretty pointless, since the descriptor */ | 198 | /* This appears to be pretty pointless, since the descriptor */ |
diff --git a/mps/code/walkt0.c b/mps/code/walkt0.c index 44b7a38d1f4..1764b3f9f10 100644 --- a/mps/code/walkt0.c +++ b/mps/code/walkt0.c | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | #include <stdlib.h> | 20 | #include <stdlib.h> |
| 21 | #include <string.h> | 21 | #include <string.h> |
| 22 | 22 | ||
| 23 | #define testArenaSIZE ((size_t)(64l << 20)) | 23 | #define testArenaSIZE ((size_t)((size_t)64 << 20)) |
| 24 | #define avLEN 3 | 24 | #define avLEN 3 |
| 25 | #define exactRootsCOUNT 200 | 25 | #define exactRootsCOUNT 200 |
| 26 | #define objCOUNT 20000 | 26 | #define objCOUNT 20000 |
diff --git a/mps/code/zcoll.c b/mps/code/zcoll.c index 546e6b50def..21b1ffbd07d 100644 --- a/mps/code/zcoll.c +++ b/mps/code/zcoll.c | |||
| @@ -97,7 +97,7 @@ static ulongest_t cols(size_t bytes) | |||
| 97 | double M; /* Mebibytes */ | 97 | double M; /* Mebibytes */ |
| 98 | ulongest_t cM; /* hundredths of a Mebibyte */ | 98 | ulongest_t cM; /* hundredths of a Mebibyte */ |
| 99 | 99 | ||
| 100 | M = (double)bytes / (1UL<<20); | 100 | M = (double)bytes / ((ulongest_t)1<<20); |
| 101 | cM = (ulongest_t)(M * 100.0 + 0.5); /* round to nearest */ | 101 | cM = (ulongest_t)(M * 100.0 + 0.5); /* round to nearest */ |
| 102 | return cM; | 102 | return cM; |
| 103 | } | 103 | } |
| @@ -139,9 +139,9 @@ static void showStatsAscii(size_t notcon, size_t con, size_t live, size_t alimit | |||
| 139 | * Output: (Megabytes) 0m209 | 139 | * Output: (Megabytes) 0m209 |
| 140 | */ | 140 | */ |
| 141 | #if 0 | 141 | #if 0 |
| 142 | #define bPerM (1UL << 20) /* Mebibytes */ | 142 | #define bPerM ((size_t)1 << 20) /* Mebibytes */ |
| 143 | #else | 143 | #else |
| 144 | #define bPerM (1000000UL) /* Megabytes */ | 144 | #define bPerM ((size_t)1000000) /* Megabytes */ |
| 145 | #endif | 145 | #endif |
| 146 | static void print_M(size_t bytes) | 146 | static void print_M(size_t bytes) |
| 147 | { | 147 | { |