diff --git a/mps/code/amcss.c b/mps/code/amcss.c index 1b32c849769..3f9afba4e82 100644 --- a/mps/code/amcss.c +++ b/mps/code/amcss.c @@ -196,7 +196,8 @@ static void test(mps_arena_t arena) collections = c; report(arena); - printf("%lu objects (mps_collections says: %lu)\n", objs, c); + printf("%lu objects (mps_collections says: %"PRIuLONGEST")\n", objs, + (ulongest_t)c); /* test mps_arena_has_addr */ { diff --git a/mps/code/amcsshe.c b/mps/code/amcsshe.c index 248929240d0..15dd342336c 100644 --- a/mps/code/amcsshe.c +++ b/mps/code/amcsshe.c @@ -173,7 +173,8 @@ static void *test(void *arg, size_t s) if (collections != c) { collections = c; - printf("\nCollection %lu, %lu objects.\n", c, objs); + printf("\nCollection %"PRIuLONGEST", %lu objects.\n", + (ulongest_t)c, objs); report(arena); for (r = 0; r < exactRootsCOUNT; ++r) { if (exactRoots[r] != objNULL) diff --git a/mps/code/apss.c b/mps/code/apss.c index 8016f9b1aa5..04818600510 100644 --- a/mps/code/apss.c +++ b/mps/code/apss.c @@ -43,14 +43,14 @@ static mps_res_t make(mps_addr_t *p, mps_ap_t ap, size_t size) /* stress -- create a pool of the requested type and allocate in it */ -static mps_res_t stress(mps_class_t class, size_t (*size)(unsigned long i), +static mps_res_t stress(mps_class_t class, size_t (*size)(size_t i), mps_arena_t arena, ...) { mps_res_t res = MPS_RES_OK; mps_pool_t pool; mps_ap_t ap; va_list arg; - unsigned long i, k; + size_t i, k; int *ps[testSetSIZE]; size_t ss[testSetSIZE]; @@ -78,7 +78,7 @@ static mps_res_t stress(mps_class_t class, size_t (*size)(unsigned long i), for (k=0; k */ cdie(root[objind] == NULL, "finalized live"); cdie(state[objind] == finalizableSTATE, "finalized dead"); diff --git a/mps/code/finaltest.c b/mps/code/finaltest.c index a6c23aebfd1..ee7a55ee3e7 100644 --- a/mps/code/finaltest.c +++ b/mps/code/finaltest.c @@ -188,7 +188,8 @@ static void *test(void *arg, size_t s) ++ final_this_time; } finals += final_this_time; - printf("%lu objects finalized: total %lu of %lu\n", + printf("%"PRIuLONGEST" objects finalized: total %"PRIuLONGEST + " of %"PRIuLONGEST"\n", final_this_time, finals, object_count); } @@ -226,7 +227,8 @@ static void *test(void *arg, size_t s) ++ final_this_time; } finals += final_this_time; - printf("%lu objects finalized: total %lu of %lu\n", + printf("%"PRIuLONGEST" objects finalized: total %"PRIuLONGEST + " of %"PRIuLONGEST"\n", final_this_time, finals, object_count); } diff --git a/mps/code/fmtdy.c b/mps/code/fmtdy.c index 498f8811635..758a7f4ebbb 100644 --- a/mps/code/fmtdy.c +++ b/mps/code/fmtdy.c @@ -493,15 +493,15 @@ extern mps_res_t dylan_scan1(mps_ss_t mps_ss, mps_addr_t *object_io) break; case 4: /* non-word */ - es = (vh & 0xff) >> 3; - vb = (vh >> 16) & 0xff; + es = (unsigned)(vh & 0xff) >> 3; + vb = (unsigned)((vh >> 16) & 0xff); vt += vb; p += NONWORD_LENGTH(vt, es); break; case 5: /* stretchy non-word */ - es = (vh & 0xff) >> 3; - vb = (vh >> 16) & 0xff; + es = (unsigned)(vh & 0xff) >> 3; + vb = (unsigned)((vh >> 16) & 0xff); vt += vb; p += NONWORD_LENGTH(vt, es) + 1; notreached(); /* DW doesn't create them yet */ @@ -678,8 +678,8 @@ static mps_addr_t dylan_skip(mps_addr_t object) if((vf & 6) == 4) /* non-word */ { - es = (vh & 0xff) >> 3; - vb = (vh >> 16) & 0xff; + es = (unsigned)(vh & 0xff) >> 3; + vb = (unsigned)((vh >> 16) & 0xff); vt += vb; p += NONWORD_LENGTH(vt, es); } diff --git a/mps/code/locbwcss.c b/mps/code/locbwcss.c index 3bc674c7d68..e37f59cbc30 100644 --- a/mps/code/locbwcss.c +++ b/mps/code/locbwcss.c @@ -110,7 +110,7 @@ static void poolStatInit(PoolStat stat, mps_pool_t pool, size_t objSize) static void allocMultiple(PoolStat stat) { mps_addr_t objects[allocsPerIteration]; - int i; + size_t i; /* allocate a few objects, and record stats for them */ for (i = 0; i < allocsPerIteration; i++) { diff --git a/mps/code/locusss.c b/mps/code/locusss.c index b399e58e8da..22a35ab6e4e 100644 --- a/mps/code/locusss.c +++ b/mps/code/locusss.c @@ -110,7 +110,7 @@ static void poolStatInit(PoolStat stat, mps_pool_t pool, size_t objSize) static mps_res_t allocMultiple(PoolStat stat) { mps_addr_t objects[contigAllocs]; - int i; + size_t i; /* allocate a few objects, and record stats for them */ for (i = 0; i < contigAllocs; i++) { diff --git a/mps/code/mpmss.c b/mps/code/mpmss.c index b2a48347382..9e592a7513c 100644 --- a/mps/code/mpmss.c +++ b/mps/code/mpmss.c @@ -30,13 +30,13 @@ extern mps_class_t PoolClassMFS(void); /* stress -- create a pool of the requested type and allocate in it */ -static mps_res_t stress(mps_class_t class, size_t (*size)(int i), +static mps_res_t stress(mps_class_t class, size_t (*size)(size_t i), mps_arena_t arena, ...) { mps_res_t res; mps_pool_t pool; va_list arg; - int i, k; + size_t i, k; int *ps[testSetSIZE]; size_t ss[testSetSIZE]; @@ -94,7 +94,7 @@ static mps_res_t stress(mps_class_t class, size_t (*size)(int i), /* randomSize -- produce sizes both latge and small */ -static size_t randomSize(int i) +static size_t randomSize(size_t i) { /* Make the range large enough to span three pages in the segment table: */ /* 160 segments/page, page size max 0x2000. */ @@ -106,7 +106,7 @@ static size_t randomSize(int i) /* randomSize8 -- produce sizes both latge and small, 8-byte aligned */ -static size_t randomSize8(int i) +static size_t randomSize8(size_t i) { size_t maxSize = 2 * 160 * 0x2000; /* Reduce by a factor of 2 every 10 cycles. Total allocation about 40 MB. */ diff --git a/mps/code/mps.c b/mps/code/mps.c index ce910bad927..0a8f29be9ba 100644 --- a/mps/code/mps.c +++ b/mps/code/mps.c @@ -229,6 +229,21 @@ #include "spw3i3.c" /* 32-bit Intel stack probe */ #include "mpsiw3.c" /* Windows interface layer extras */ +/* Windows on 64-bit Intel with Pelles C */ + +#elif defined(MPS_PF_W3I6PC) + +#include "lockw3.c" /* Windows locks */ +#include "thw3.c" /* Windows threading */ +#include "thw3i6.c" /* Windows on 64-bit Intel thread stack scan */ +#include "vmw3.c" /* Windows virtual memory */ +#include "protw3.c" /* Windows protection */ +#include "proti6.c" /* 64-bit Intel mutator context decoding */ +#include "prmci6w3.c" /* Windows on 64-bit Intel mutator context */ +#include "ssw3i6pc.c" /* Windows on 64-bit stack scan for Pelles C */ +#include "spw3i6.c" /* 64-bit Intel stack probe */ +#include "mpsiw3.c" /* Windows interface layer extras */ + #else #error "Unknown platform -- can't determine platform specific parts." diff --git a/mps/code/mpstd.h b/mps/code/mpstd.h index 891d5979647..1306281224b 100644 --- a/mps/code/mpstd.h +++ b/mps/code/mpstd.h @@ -97,6 +97,27 @@ #define MPS_PF_ALIGN 8 +/* PellesC version 7.00.25 with /Ze option (Microsoft compatibility mode) + * and /Tarm64-coff (Create a COFF object file for a X64 processor). + * Help node "Predefined preprocessor symbols (POCC)" + */ + +#elif defined(__POCC__) && defined(_WIN32) && defined(_WIN64) && defined(_M_X64) +#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_W3I6PC) +#error "specified CONFIG_PF_... inconsistent with detected w3i6pc" +#endif +#define MPS_PF_W3I6PC +#define MPS_PF_STRING "w3i6pc" +#define MPS_OS_W3 +#define MPS_ARCH_I6 +#define MPS_BUILD_PC +#define MPS_T_WORD unsigned __int64 +#define MPS_T_ULONGEST unsigned __int64 +#define MPS_WORD_WIDTH 64 +#define MPS_WORD_SHIFT 6 +#define MPS_PF_ALIGN 16 + + /* GCC 4.0.1 (As supplied by Apple on Mac OS X 10.4.8 on an Intel Mac), * gcc -E -dM * And above for xcppgc. diff --git a/mps/code/qs.c b/mps/code/qs.c index 2e573d0840b..2ccc9423184 100644 --- a/mps/code/qs.c +++ b/mps/code/qs.c @@ -186,7 +186,7 @@ static void swap(void) static void makerndlist(unsigned l) { - unsigned i; + size_t i; mps_word_t r; mps_addr_t addr; diff --git a/mps/code/replay.c b/mps/code/replay.c index 974ce5dcd07..0069e7415c1 100644 --- a/mps/code/replay.c +++ b/mps/code/replay.c @@ -21,7 +21,7 @@ #include "mpstd.h" -#ifdef MPS_PF_W3I6MV +#if defined(MPS_OS_W3) && defined(MPS_ARCH_I6) #define PRIuLONGEST "llu" #define PRIXPTR "016llX" typedef unsigned long long ulongest_t; diff --git a/mps/code/sacss.c b/mps/code/sacss.c index d48b41708d8..bfb0725ed47 100644 --- a/mps/code/sacss.c +++ b/mps/code/sacss.c @@ -47,13 +47,13 @@ static mps_res_t make(mps_addr_t *p, mps_sac_t sac, size_t size) static mps_res_t stress(mps_class_t class, size_t classes_count, mps_sac_classes_s *classes, - size_t (*size)(int i), mps_arena_t arena, ...) + size_t (*size)(size_t i), mps_arena_t arena, ...) { mps_res_t res; mps_pool_t pool; mps_sac_t sac; va_list arg; - int i, k; + size_t i, k; int *ps[testSetSIZE]; size_t ss[testSetSIZE]; @@ -127,7 +127,7 @@ static mps_res_t stress(mps_class_t class, /* randomSize8 -- produce sizes both latge and small */ -static size_t randomSize8(int i) +static size_t randomSize8(size_t i) { size_t maxSize = 2 * 160 * 0x2000; size_t size; diff --git a/mps/code/spw3i6.c b/mps/code/spw3i6.c index 10404d4559e..29b1f8b8dcf 100644 --- a/mps/code/spw3i6.c +++ b/mps/code/spw3i6.c @@ -22,7 +22,7 @@ void StackProbe(Size depth) { - _alloca(depth*sizeof(Word)); + (void)_alloca(depth*sizeof(Word)); } diff --git a/mps/code/ssw3i6pc.c b/mps/code/ssw3i6pc.c new file mode 100644 index 00000000000..c58e88f846a --- /dev/null +++ b/mps/code/ssw3i6pc.c @@ -0,0 +1,143 @@ +/* ssw3i6pc.c: STACK SCANNING FOR WIN32 WITH PELLES C + * + * $Id$ + * Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. + * + * This scans the stack and fixes the registers which may contain roots. + * See . + * + * .assume.ms-compat: We rely on the fact that Pelles C's setjmp stores + * the callee-save registers in the jmp_buf and is compatible with Microsoft + * C. The Pelles C 7.00 setjmp.h header has a comment "MS compatible". See + * also "Is Pelles C's jmp_buf compatible with Microsoft C's?" + * + * + * REFERENCES + * + * "Overview of x64 Calling Conventions"; MSDN; Microsoft Corporation; + * . + * + * "Caller/Callee Saved Registers"; MSDN; Microsoft Corporation; + * . + * + * "Register Usage"; MSDN; Microsoft Corporation; + * . + * + * "Calling conventions for different C++ compilers and operating systems"; + * Agner Fog; Copenhagen University College of Engineering; 2012-02-29; + * . + */ + +#include "mpm.h" +#include + +SRCID(ssw3i6pc, "$Id$"); + + +/* This definition isn't in the Pelles C headers, so we reproduce it here. + * See .assume.ms-compat. */ + +typedef /* _CRT_ALIGN(16) */ struct _SETJMP_FLOAT128 { + unsigned __int64 Part[2]; +} SETJMP_FLOAT128; + +typedef struct _JUMP_BUFFER { + unsigned __int64 Frame; + unsigned __int64 Rbx; + unsigned __int64 Rsp; + unsigned __int64 Rbp; + unsigned __int64 Rsi; + unsigned __int64 Rdi; + unsigned __int64 R12; + unsigned __int64 R13; + unsigned __int64 R14; + unsigned __int64 R15; + unsigned __int64 Rip; + unsigned __int64 Spare; + + SETJMP_FLOAT128 Xmm6; + SETJMP_FLOAT128 Xmm7; + SETJMP_FLOAT128 Xmm8; + SETJMP_FLOAT128 Xmm9; + SETJMP_FLOAT128 Xmm10; + SETJMP_FLOAT128 Xmm11; + SETJMP_FLOAT128 Xmm12; + SETJMP_FLOAT128 Xmm13; + SETJMP_FLOAT128 Xmm14; + SETJMP_FLOAT128 Xmm15; +} _JUMP_BUFFER; + + +Res StackScan(ScanState ss, Addr *stackBot) +{ + jmp_buf jb; + + /* We rely on the fact that Pelles C's setjmp stores the callee-save + registers in the jmp_buf. */ + (void)setjmp(jb); + + /* These checks will just serve to warn us at compile-time if the + setjmp.h header changes to indicate that the registers we want aren't + saved any more. */ + AVER(sizeof(((_JUMP_BUFFER *)jb)->Rdi) == sizeof(Addr)); + AVER(sizeof(((_JUMP_BUFFER *)jb)->Rsi) == sizeof(Addr)); + AVER(sizeof(((_JUMP_BUFFER *)jb)->Rbp) == sizeof(Addr)); + AVER(sizeof(((_JUMP_BUFFER *)jb)->R12) == sizeof(Addr)); + AVER(sizeof(((_JUMP_BUFFER *)jb)->R13) == sizeof(Addr)); + AVER(sizeof(((_JUMP_BUFFER *)jb)->R14) == sizeof(Addr)); + AVER(sizeof(((_JUMP_BUFFER *)jb)->R15) == sizeof(Addr)); + + /* The layout of the jmp_buf forces us to harmlessly scan Rsp as well. */ + AVER(offsetof(_JUMP_BUFFER, Rsp) == offsetof(_JUMP_BUFFER, Rbx) + 8); + AVER(offsetof(_JUMP_BUFFER, Rbp) == offsetof(_JUMP_BUFFER, Rbx) + 16); + AVER(offsetof(_JUMP_BUFFER, Rsi) == offsetof(_JUMP_BUFFER, Rbx) + 24); + AVER(offsetof(_JUMP_BUFFER, Rdi) == offsetof(_JUMP_BUFFER, Rbx) + 32); + AVER(offsetof(_JUMP_BUFFER, R12) == offsetof(_JUMP_BUFFER, Rbx) + 40); + AVER(offsetof(_JUMP_BUFFER, R13) == offsetof(_JUMP_BUFFER, Rbx) + 48); + AVER(offsetof(_JUMP_BUFFER, R14) == offsetof(_JUMP_BUFFER, Rbx) + 56); + AVER(offsetof(_JUMP_BUFFER, R15) == offsetof(_JUMP_BUFFER, Rbx) + 64); + + return StackScanInner(ss, stackBot, (Addr *)&((_JUMP_BUFFER *)jb)->Rbx, 9); +} + + +/* C. COPYRIGHT AND LICENSE + * + * Copyright (C) 2001-2014 Ravenbrook Limited . + * All rights reserved. This is an open source license. Contact + * Ravenbrook for commercial licensing options. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Redistributions in any form must be accompanied by information on how + * to obtain complete source code for this software and any accompanying + * software that uses this software. The source code must either be + * included in the distribution or be available for no more than the cost + * of distribution plus a nominal fee, and must be freely redistributable + * under reasonable conditions. For an executable file, complete source + * code means the source code for all modules it contains. It does not + * include source code for modules or files that typically accompany the + * major components of the operating system on which the executable file + * runs. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ diff --git a/mps/code/steptest.c b/mps/code/steptest.c index b6e08995125..4d6353e78df 100644 --- a/mps/code/steptest.c +++ b/mps/code/steptest.c @@ -420,8 +420,8 @@ static void *test(void *arg, size_t s) printf("Collection statistics:\n"); printf(" %"PRIuLONGEST" collections\n", (ulongest_t)collections); printf(" %"PRIuLONGEST" bytes condemned.\n", (ulongest_t)condemned); - printf(" %lu bytes not condemned.\n", - (unsigned long)not_condemned); + printf(" %"PRIuLONGEST" bytes not condemned.\n", + (ulongest_t)not_condemned); printf(" %"PRIuLONGEST" bytes survived.\n", (ulongest_t)live); if (condemned) { printf(" Mortality %5.2f%%.\n", @@ -430,10 +430,10 @@ static void *test(void *arg, size_t s) ((double)condemned/(condemned + not_condemned)) * 100.0); } if (collections) { - printf(" Condemned per collection %lu bytes.\n", - (unsigned long)condemned/collections); - printf(" Reclaimed per collection %lu bytes.\n", - (unsigned long)(condemned - live)/collections); + printf(" Condemned per collection %"PRIuLONGEST" bytes.\n", + (ulongest_t)condemned/collections); + printf(" Reclaimed per collection %"PRIuLONGEST" bytes.\n", + (ulongest_t)(condemned - live)/collections); } printf("Allocation statistics:\n"); diff --git a/mps/code/teletest.c b/mps/code/teletest.c index 1e0dca6a53e..312237f5251 100644 --- a/mps/code/teletest.c +++ b/mps/code/teletest.c @@ -19,19 +19,10 @@ SRCID(teletest, "$Id$"); static mps_arena_t arena; - +#define WORD_FORMAT "%" PRIwWORD PRIuLONGEST #define MAX_ARGS 3 #define INPUT_BUFFER_SIZE 512 -#if (MPS_WORD_WIDTH == 32) -#define WORD_FORMAT "0x%08lx" -#elif (MPS_WORD_WIDTH == 64) -#define WORD_FORMAT "0x%016lx" -#else -#error "Unrecognized word width" -#endif - - static mps_word_t args[MAX_ARGS]; static char *stringArg; static Count argCount; @@ -43,7 +34,8 @@ static void callControl(mps_word_t reset, mps_word_t flip) old = mps_telemetry_control(reset, flip); new = mps_telemetry_control((mps_word_t)0, (mps_word_t)0); - (void)printf(WORD_FORMAT " -> " WORD_FORMAT "\n", old, new); + (void)printf(WORD_FORMAT " -> " WORD_FORMAT "\n", + (ulongest_t)old, (ulongest_t)new); } @@ -58,7 +50,7 @@ static void doRead(void) mps_word_t old; old = mps_telemetry_control((mps_word_t)0, (mps_word_t)0); - (void)printf(WORD_FORMAT "\n", old); + (void)printf(WORD_FORMAT "\n", (ulongest_t)old); } @@ -85,7 +77,7 @@ static void doIntern(void) mps_word_t id; id = mps_telemetry_intern(stringArg); - (void)printf(WORD_FORMAT "\n", id); + (void)printf(WORD_FORMAT "\n", (ulongest_t)id); } static void doLabel(void) diff --git a/mps/code/testlib.h b/mps/code/testlib.h index aff3c108351..6dea9beae75 100644 --- a/mps/code/testlib.h +++ b/mps/code/testlib.h @@ -101,7 +101,7 @@ #error "How many beans make five?" #endif -#ifdef MPS_PF_W3I6MV +#if defined(MPS_OS_W3) && defined(MPS_ARCH_I6) #define PRIuLONGEST "llu" #define SCNuLONGEST "llu" #define SCNXLONGEST "llX" diff --git a/mps/code/w3i6pc.nmk b/mps/code/w3i6pc.nmk new file mode 100644 index 00000000000..fd3f798a9b5 --- /dev/null +++ b/mps/code/w3i6pc.nmk @@ -0,0 +1,175 @@ +# -*- makefile -*- +# +# w3i6pc.nmk: NMAKE FILE FOR WINDOWS/x64/PELLES C +# +# $Id: //info.ravenbrook.com/project/mps/branch/2014-03-21/pellesc/code/w3i6pc.nmk#1 $ +# Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. + +PFM = w3i6pc + +# /Gs appears to be necessary to suppress stack checks. Stack checks +# (if not suppressed) generate a dependency on the C library, __chkesp, +# which causes the linker step to fail when building the DLL, mpsdy.dll. +PFMDEFS = /DCONFIG_PF_STRING="w3i6pc" /DCONFIG_PF_W3I6PC /DWIN32 /D_WINDOWS + +!INCLUDE commpre.nmk +!INCLUDE pc.nmk + +CFLAGSCOMMONPRE = $(CFLAGSCOMMONPRE) /Tamd64-coff + +# MPM sources: core plus platform-specific. +MPM = $(MPMCOMMON) + + + +# Source to object file mappings and CFLAGS amalgamation +# +# %%VARIETY %%PART: When adding a new variety or part, add new macros which +# expand to the files included in the part for each variety +# +# %%VARIETY: When adding a new variety, add a CFLAGS macro which expands to +# the flags that that variety should use when compiling C. And a LINKFLAGS +# macro which expands to the flags that the variety should use when building +# executables. And a LIBFLAGS macro which expands to the flags that the +# variety should use when building libraries + +!IF "$(VARIETY)" == "hot" +CFLAGS=$(CFLAGSCOMMONPRE) $(CFHOT) $(CFLAGSCOMMONPOST) +CFLAGSSQL=$(CFLAGSSQLPRE) $(CFHOT) $(CFLAGSSQLPOST) +LINKFLAGS=$(LINKFLAGSCOMMON) $(LFHOT) +LIBFLAGS=$(LIBFLAGSCOMMON) $(LIBFLAGSHOT) +MPMOBJ0 = $(MPM:<=w3i6pc\hot\) +PLINTHOBJ0 = $(PLINTH:<=w3i6pc\hot\) +AMSOBJ0 = $(AMS:<=w3i6pc\hot\) +AMCOBJ0 = $(AMC:<=w3i6pc\hot\) +AWLOBJ0 = $(AWL:<=w3i6pc\hot\) +LOOBJ0 = $(LO:<=w3i6pc\hot\) +SNCOBJ0 = $(SNC:<=w3i6pc\hot\) +MVFFOBJ0 = $(MVFF:<=w3i6pc\hot\) +DWOBJ0 = $(DW:<=w3i6pc\hot\) +FMTTESTOBJ0 = $(FMTTEST:<=w3i6pc\hot\) +POOLNOBJ0 = $(POOLN:<=w3i6pc\hot\) +TESTLIBOBJ0 = $(TESTLIB:<=w3i6pc\hot\) + +!ELSEIF "$(VARIETY)" == "cool" +CFLAGS=$(CFLAGSCOMMONPRE) $(CFCOOL) $(CFLAGSCOMMONPOST) +CFLAGSSQL=$(CFLAGSSQLPRE) $(CFCOOL) $(CFLAGSSQLPOST) +LINKFLAGS=$(LINKFLAGSCOMMON) $(LFCOOL) +LIBFLAGS=$(LIBFLAGSCOMMON) $(LIBFLAGSCOOL) +MPMOBJ0 = $(MPM:<=w3i6pc\cool\) +PLINTHOBJ0 = $(PLINTH:<=w3i6pc\cool\) +AMSOBJ0 = $(AMS:<=w3i6pc\cool\) +AMCOBJ0 = $(AMC:<=w3i6pc\cool\) +AWLOBJ0 = $(AWL:<=w3i6pc\cool\) +LOOBJ0 = $(LO:<=w3i6pc\cool\) +SNCOBJ0 = $(SNC:<=w3i6pc\cool\) +MVFFOBJ0 = $(MVFF:<=w3i6pc\cool\) +DWOBJ0 = $(DW:<=w3i6pc\cool\) +FMTTESTOBJ0 = $(FMTTEST:<=w3i6pc\cool\) +POOLNOBJ0 = $(POOLN:<=w3i6pc\cool\) +TESTLIBOBJ0 = $(TESTLIB:<=w3i6pc\cool\) + +!ELSEIF "$(VARIETY)" == "rash" +CFLAGS=$(CFLAGSCOMMONPRE) $(CFRASH) $(CFLAGSCOMMONPOST) +CFLAGSSQL=$(CFLAGSSQLPRE) $(CFRASH) $(CFLAGSSQLPOST) +LINKFLAGS=$(LINKFLAGSCOMMON) $(LFRASH) +LIBFLAGS=$(LIBFLAGSCOMMON) $(LIBFLAGSRASH) +MPMOBJ0 = $(MPM:<=w3i6pc\rash\) +PLINTHOBJ0 = $(PLINTH:<=w3i6pc\rash\) +AMSOBJ0 = $(AMS:<=w3i6pc\rash\) +AMCOBJ0 = $(AMC:<=w3i6pc\rash\) +AWLOBJ0 = $(AWL:<=w3i6pc\rash\) +LOOBJ0 = $(LO:<=w3i6pc\rash\) +SNCOBJ0 = $(SNC:<=w3i6pc\rash\) +MVFFOBJ0 = $(MVFF:<=w3i6pc\rash\) +DWOBJ0 = $(DW:<=w3i6pc\rash\) +FMTTESTOBJ0 = $(FMTTEST:<=w3i6pc\rash\) +POOLNOBJ0 = $(POOLN:<=w3i6pc\rash\) +TESTLIBOBJ0 = $(TESTLIB:<=w3i6pc\rash\) + +#!ELSEIF "$(VARIETY)" == "cv" +#CFLAGS=$(CFLAGSCOMMON) $(CFCV) +#LINKFLAGS=$(LINKFLAGSCOMMON) $(LFCV) +#LIBFLAGS=$(LIBFLAGSCOMMON) $(LIBFLAGSCV) +#MPMOBJ0 = $(MPM:<=w3i6pc\cv\) +#MPMOBJ = $(MPMOBJ0:>=.obj) +#PLINTHOBJ0 = $(PLINTH:<=w3i6pc\cv\) +#PLINTHOBJ = $(PLINTHOBJ0:>=.obj) +#AMSOBJ0 = $(AMS:<=w3i6pc\cv\) +#AMSOBJ = $(AMSOBJ0:>=.obj) +#AMCOBJ0 = $(AMC:<=w3i6pc\cv\) +#AMCOBJ = $(AMCOBJ0:>=.obj) +#AWLOBJ0 = $(AWL:<=w3i6pc\cv\) +#AWLOBJ = $(AWLOBJ0:>=.obj) +#LOOBJ0 = $(LO:<=w3i6pc\cv\) +#LOOBJ = $(LOOBJ0:>=.obj) +#SNCOBJ0 = $(SNC:<=w3i6pc\cv\) +#SNCOBJ = $(SNCOBJ0:>=.obj) +#DWOBJ0 = $(DW:<=w3i6pc\cv\) +#DWOBJ = $(DWOBJ0:>=.obj) +#POOLNOBJ0 = $(POOLN:<=w3i6pc\cv\) +#POOLNOBJ = $(POOLNOBJ0:>=.obj) +#TESTLIBOBJ0 = $(TESTLIB:<=w3i6pc\cv\) +#TESTLIBOBJ = $(TESTLIBOBJ0:>=.obj) + +!ENDIF + +# %%PART: When adding a new part, add new macros which expand to the object +# files included in the part + +MPMOBJ = $(MPMOBJ0:>=.obj) +PLINTHOBJ = $(PLINTHOBJ0:>=.obj) +AMSOBJ = $(AMSOBJ0:>=.obj) +AMCOBJ = $(AMCOBJ0:>=.obj) +AWLOBJ = $(AWLOBJ0:>=.obj) +LOOBJ = $(LOOBJ0:>=.obj) +SNCOBJ = $(SNCOBJ0:>=.obj) +MVFFOBJ = $(MVFFOBJ0:>=.obj) +DWOBJ = $(DWOBJ0:>=.obj) +FMTTESTOBJ = $(FMTTESTOBJ0:>=.obj) +POOLNOBJ = $(POOLNOBJ0:>=.obj) +TESTLIBOBJ = $(TESTLIBOBJ0:>=.obj) + + +!INCLUDE commpost.nmk + + +# C. COPYRIGHT AND LICENSE +# +# Copyright (C) 2001-2014 Ravenbrook Limited . +# All rights reserved. This is an open source license. Contact +# Ravenbrook for commercial licensing options. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Redistributions in any form must be accompanied by information on how +# to obtain complete source code for this software and any accompanying +# software that uses this software. The source code must either be +# included in the distribution or be available for no more than the cost +# of distribution plus a nominal fee, and must be freely redistributable +# under reasonable conditions. For an executable file, complete source +# code means the source code for all modules it contains. It does not +# include source code for modules or files that typically accompany the +# major components of the operating system on which the executable file +# runs. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/mps/code/zcoll.c b/mps/code/zcoll.c index 9f8701ca1f5..646d8c7d30a 100644 --- a/mps/code/zcoll.c +++ b/mps/code/zcoll.c @@ -196,8 +196,8 @@ static void get(mps_arena_t arena) switch(type) { case mps_message_type_gc_start(): { mclockBegin = mps_message_clock(arena, message); - printf(" %5lu: (%5lu)", - mclockBegin, mclockBegin - mclockEnd); + printf(" %5"PRIuLONGEST": (%5"PRIuLONGEST")", + (ulongest_t)mclockBegin, (ulongest_t)(mclockBegin - mclockEnd)); printf(" Coll Begin (%s)\n", mps_message_gc_start_why(arena, message)); break; @@ -211,8 +211,8 @@ static void get(mps_arena_t arena) mclockEnd = mps_message_clock(arena, message); - printf(" %5lu: (%5lu)", - mclockEnd, mclockEnd - mclockBegin); + printf(" %5"PRIuLONGEST": (%5"PRIuLONGEST")", + (ulongest_t)mclockEnd, (ulongest_t)(mclockEnd - mclockBegin)); printf(" Coll End "); showStatsText(notcon, con, live); if(rnd()==0) showStatsAscii(notcon, con, live, alimit); @@ -222,7 +222,8 @@ static void get(mps_arena_t arena) mps_message_finalization_ref(&objaddr, arena, message); obj = objaddr; objind = DYLAN_INT_INT(DYLAN_VECTOR_SLOT(obj, 0)); - printf(" Finalization for object %lu at %p\n", objind, objaddr); + printf(" Finalization for object %"PRIuLONGEST" at %p\n", + (ulongest_t)objind, objaddr); break; } default: { @@ -301,7 +302,7 @@ static void CatalogCheck(void) mps_word_t w; void *Catalog, *Page, *Art, *Poly; unsigned long Catalogs = 0, Pages = 0, Arts = 0, Polys = 0; - int i, j, k; + size_t i, j, k; /* retrieve Catalog from root */ Catalog = myrootExact[CatalogRootIndex]; @@ -359,7 +360,7 @@ static void CatalogDo(mps_arena_t arena, mps_ap_t ap) { mps_word_t v; void *Catalog, *Page, *Art, *Poly; - int i, j, k; + size_t i, j, k; die(make_dylan_vector(&v, ap, CatalogFix + CatalogVar), "Catalog"); DYLAN_VECTOR_SLOT(v, 0) = DYLAN_INT(CatalogSig); @@ -381,7 +382,7 @@ static void CatalogDo(mps_arena_t arena, mps_ap_t ap) DYLAN_VECTOR_SLOT(Catalog, CatalogFix + i) = (mps_word_t)Page; get(arena); - printf("Page %d: make articles\n", i); + printf("Page %"PRIuLONGEST": make articles\n", (ulongest_t)i); (void)fflush(stdout); for(j = 0; j < PageVar; j += 1) { @@ -531,7 +532,7 @@ static void Make(mps_arena_t arena, mps_ap_t ap, unsigned randm, unsigned keep1i static void Rootdrop(char rank_char) { - unsigned i; + size_t i; if(rank_char == 'A') { for(i = 0; i < myrootAmbigCOUNT; ++i) { @@ -550,7 +551,7 @@ static void Rootdrop(char rank_char) #define stackwipedepth 50000 static void stackwipe(void) { - unsigned iw; + size_t iw; unsigned long aw[stackwipedepth]; /* Do some pointless work that the compiler won't optimise away, so that @@ -734,7 +735,7 @@ static void *testscriptB(void *arg, size_t s) mps_fmt_t fmt; mps_chain_t chain; mps_pool_t amc; - int i; + size_t i; mps_root_t root_table_Ambig; mps_root_t root_table_Exact; mps_ap_t ap; diff --git a/mps/code/zmess.c b/mps/code/zmess.c index e032b3f7620..2b6d533dfde 100644 --- a/mps/code/zmess.c +++ b/mps/code/zmess.c @@ -179,7 +179,8 @@ static void report(mps_arena_t arena, const char *pm, Bool discard) mps_message_finalization_ref(&objaddr, arena, message); obj = objaddr; objind = DYLAN_INT_INT(DYLAN_VECTOR_SLOT(obj, 0)); - printf(" Finalization for object %lu at %p\n", objind, objaddr); + printf(" Finalization for object %"PRIuLONGEST" at %p\n", + (ulongest_t)objind, objaddr); cdie(myroot[objind] == NULL, "finalized live"); cdie(state[objind] == finalizableSTATE, "not finalizable"); state[objind] = finalizedSTATE; @@ -308,7 +309,7 @@ static void *testscriptB(void *arg, size_t s) mps_root_t root_table; mps_ap_t ap; mps_root_t root_stackreg; - int i; + size_t i; int N = myrootCOUNT - 1; void *stack_starts_here; /* stack scanning starts here */