From c230d2ffaabd31704b09c3e8a14722cae5d3c2d2 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 8 Apr 2014 13:03:04 +0100 Subject: [PATCH] Remove unnecessary headers from the test suite. Copied from Perforce Change: 185340 ServerID: perforce.ravenbrook.com --- mps/code/abqtest.c | 3 ++- mps/code/amcss.c | 3 +-- mps/code/amcsshe.c | 3 +-- mps/code/amcssth.c | 7 +++---- mps/code/amsss.c | 5 +---- mps/code/amssshe.c | 5 +---- mps/code/apss.c | 2 +- mps/code/arenacv.c | 5 +++-- mps/code/awlut.c | 3 ++- mps/code/awluthe.c | 3 ++- mps/code/awlutth.c | 5 +++-- mps/code/btcv.c | 2 +- mps/code/bttest.c | 7 +++---- mps/code/exposet0.c | 3 +-- mps/code/expt825.c | 2 +- mps/code/fbmtest.c | 4 +--- mps/code/finalcv.c | 2 +- mps/code/finaltest.c | 2 +- mps/code/fotest.c | 2 +- mps/code/locbwcss.c | 3 +-- mps/code/lockcov.c | 4 +++- mps/code/locusss.c | 3 +-- mps/code/locv.c | 2 ++ mps/code/messtest.c | 3 +-- mps/code/mpmss.c | 12 +++--------- mps/code/mpsicv.c | 5 +---- mps/code/nailboardtest.c | 2 ++ mps/code/poolncv.c | 2 ++ mps/code/qs.c | 9 +++++---- mps/code/segsmss.c | 7 ++----- mps/code/steptest.c | 3 +-- mps/code/teletest.c | 7 ++++--- mps/code/testlib.c | 12 +++++------- mps/code/testlib.h | 7 ------- mps/code/walkt0.c | 3 +-- mps/code/zcoll.c | 3 +-- mps/code/zmess.c | 2 +- 37 files changed, 66 insertions(+), 91 deletions(-) diff --git a/mps/code/abqtest.c b/mps/code/abqtest.c index 4cff09f1745..49d285c761f 100644 --- a/mps/code/abqtest.c +++ b/mps/code/abqtest.c @@ -10,7 +10,8 @@ #include "mpstd.h" #include "testlib.h" -#include +#include /* free, malloc */ +#include /* printf */ SRCID(abqtest, "$Id$"); diff --git a/mps/code/amcss.c b/mps/code/amcss.c index e74849c0d28..20f4dae3740 100644 --- a/mps/code/amcss.c +++ b/mps/code/amcss.c @@ -15,8 +15,7 @@ #include "mps.h" #include "mpslib.h" -#include -#include +#include /* fflush, printf, putchar */ /* These values have been tuned in the hope of getting one dynamic collection. */ diff --git a/mps/code/amcsshe.c b/mps/code/amcsshe.c index 4c167224a88..11a5950f497 100644 --- a/mps/code/amcsshe.c +++ b/mps/code/amcsshe.c @@ -14,8 +14,7 @@ #include "mpstd.h" #include "mps.h" -#include -#include +#include /* fflush, printf, putchar */ /* These values have been tuned in the hope of getting one dynamic collection. */ diff --git a/mps/code/amcssth.c b/mps/code/amcssth.c index d766a16ab1e..684cd94edb5 100644 --- a/mps/code/amcssth.c +++ b/mps/code/amcssth.c @@ -15,10 +15,9 @@ #include "mpslib.h" #include "mpscamc.h" #include "mpsavm.h" -#include -#include -#include -#include + +#include /* pthread_create, pthread_join */ +#include /* fflush, printf, putchar */ /* These values have been tuned in the hope of getting one dynamic collection. */ diff --git a/mps/code/amsss.c b/mps/code/amsss.c index 6cddbe98fd3..1d04f199349 100644 --- a/mps/code/amsss.c +++ b/mps/code/amsss.c @@ -17,10 +17,7 @@ #include "mpstd.h" #include "mps.h" -#include -#include -#include -#include +#include /* fflush, printf */ #define exactRootsCOUNT 50 diff --git a/mps/code/amssshe.c b/mps/code/amssshe.c index cd5d1d370f7..ce5dd4800c8 100644 --- a/mps/code/amssshe.c +++ b/mps/code/amssshe.c @@ -15,10 +15,7 @@ #include "mpstd.h" #include "mps.h" -#include -#include -#include -#include +#include /* fflush, printf */ #define exactRootsCOUNT 50 diff --git a/mps/code/apss.c b/mps/code/apss.c index 3a60587d412..8c90536fa00 100644 --- a/mps/code/apss.c +++ b/mps/code/apss.c @@ -16,7 +16,7 @@ #include "testlib.h" #include "mpslib.h" -#include +#include /* printf */ #include /* malloc */ diff --git a/mps/code/arenacv.c b/mps/code/arenacv.c index 8b149c194bd..d5e56eaec2d 100644 --- a/mps/code/arenacv.c +++ b/mps/code/arenacv.c @@ -14,8 +14,6 @@ * being allocated; this requires using two adjacent zones. */ -#include - #include "mpm.h" #include "poolmv.h" #include "testlib.h" @@ -23,6 +21,9 @@ #include "mpsavm.h" #include "mpsacl.h" +#include /* printf */ +#include /* malloc */ + #define tractsSIZE 500 diff --git a/mps/code/awlut.c b/mps/code/awlut.c index 3a5e419666e..c62153ed44c 100644 --- a/mps/code/awlut.c +++ b/mps/code/awlut.c @@ -17,7 +17,8 @@ #include "mps.h" #include "mpstd.h" -#include +#include /* printf */ +#include /* strlen */ #define testArenaSIZE ((size_t)64<<20) diff --git a/mps/code/awluthe.c b/mps/code/awluthe.c index 3ccdff7110f..d3b2d572319 100644 --- a/mps/code/awluthe.c +++ b/mps/code/awluthe.c @@ -18,7 +18,8 @@ #include "mps.h" #include "mpstd.h" -#include +#include /* strlen */ +#include /* printf */ #define testArenaSIZE ((size_t)64<<20) diff --git a/mps/code/awlutth.c b/mps/code/awlutth.c index 505a46826a8..dda34a31c63 100644 --- a/mps/code/awlutth.c +++ b/mps/code/awlutth.c @@ -17,8 +17,9 @@ #include "mps.h" #include "mpstd.h" -#include -#include +#include /* pthread_create, pthread_join */ +#include /* printf, puts */ +#include /* strlen */ #define testArenaSIZE ((size_t)64<<20) diff --git a/mps/code/btcv.c b/mps/code/btcv.c index 414c3351161..33e3df8be26 100644 --- a/mps/code/btcv.c +++ b/mps/code/btcv.c @@ -18,7 +18,7 @@ #include "testlib.h" #include "mpslib.h" -#include +#include /* printf */ SRCID(btcv, "$Id$"); diff --git a/mps/code/bttest.c b/mps/code/bttest.c index 918463ef4b9..20bb4cab4e7 100644 --- a/mps/code/bttest.c +++ b/mps/code/bttest.c @@ -10,11 +10,10 @@ #include "mpsavm.h" #include "testlib.h" #include "mpslib.h" - -#include -#include #include "mpstd.h" -#include + +#include /* fflush, fgets, printf, putchar, puts */ +#include /* exit, strtol */ SRCID(bttest, "$Id$"); diff --git a/mps/code/exposet0.c b/mps/code/exposet0.c index e2ef9728cfe..dc8e860d855 100644 --- a/mps/code/exposet0.c +++ b/mps/code/exposet0.c @@ -21,8 +21,7 @@ #include "mpstd.h" #include "mps.h" -#include -#include +#include /* fflush, printf, puts, stdout */ /* These values have been tuned in the hope of getting one dynamic collection. */ diff --git a/mps/code/expt825.c b/mps/code/expt825.c index f72ec532859..5e775455909 100644 --- a/mps/code/expt825.c +++ b/mps/code/expt825.c @@ -35,7 +35,7 @@ #include "fmtdytst.h" #include "mpstd.h" -#include +#include /* printf, fflush, stdout */ #define testArenaSIZE ((size_t)16<<20) diff --git a/mps/code/fbmtest.c b/mps/code/fbmtest.c index 2b6437c216d..9f3754b3496 100644 --- a/mps/code/fbmtest.c +++ b/mps/code/fbmtest.c @@ -24,9 +24,7 @@ #include "mpstd.h" #include "testlib.h" -#include -#include -#include +#include /* printf */ SRCID(fbmtest, "$Id$"); diff --git a/mps/code/finalcv.c b/mps/code/finalcv.c index ce82197b657..1466e514ff8 100644 --- a/mps/code/finalcv.c +++ b/mps/code/finalcv.c @@ -27,7 +27,7 @@ #include "fmtdytst.h" #include "mpstd.h" -#include +#include /* printf */ #define testArenaSIZE ((size_t)16<<20) diff --git a/mps/code/finaltest.c b/mps/code/finaltest.c index f471e1c65f6..02c1448d137 100644 --- a/mps/code/finaltest.c +++ b/mps/code/finaltest.c @@ -28,7 +28,7 @@ #include "fmtdytst.h" #include "mpstd.h" -#include +#include /* fflush, printf, stdout */ #define testArenaSIZE ((size_t)16<<20) diff --git a/mps/code/fotest.c b/mps/code/fotest.c index 58b25d6b65c..9dab6650ede 100644 --- a/mps/code/fotest.c +++ b/mps/code/fotest.c @@ -28,7 +28,7 @@ #include "mpmtypes.h" #include "poolmfs.h" -#include +#include /* printf */ #define testArenaSIZE ((((size_t)3)<<24) - 4) diff --git a/mps/code/locbwcss.c b/mps/code/locbwcss.c index 0e40c254635..dbf54e7e881 100644 --- a/mps/code/locbwcss.c +++ b/mps/code/locbwcss.c @@ -11,8 +11,7 @@ #include "mpslib.h" #include "mps.h" -#include -#include +#include /* printf */ /* some constants */ diff --git a/mps/code/lockcov.c b/mps/code/lockcov.c index a8237f7de72..a7289dca9ce 100644 --- a/mps/code/lockcov.c +++ b/mps/code/lockcov.c @@ -7,7 +7,9 @@ #include "mpm.h" #include "testlib.h" #include "mpslib.h" -#include /* for malloc & free */ + +#include /* printf */ +#include /* free, malloc */ int main(int argc, char *argv[]) diff --git a/mps/code/locusss.c b/mps/code/locusss.c index 3dfbc78afe1..70cf313ed45 100644 --- a/mps/code/locusss.c +++ b/mps/code/locusss.c @@ -12,8 +12,7 @@ #include "mpslib.h" #include "mps.h" -#include -#include +#include /* printf */ /* some constants */ diff --git a/mps/code/locv.c b/mps/code/locv.c index 56c9a46d2c5..06d2722dac3 100644 --- a/mps/code/locv.c +++ b/mps/code/locv.c @@ -13,6 +13,8 @@ #include "mpsclo.h" #include "mpsavm.h" +#include /* printf */ + #define testArenaSIZE ((size_t)16<<20) diff --git a/mps/code/messtest.c b/mps/code/messtest.c index 7f96360f78e..96deeebfc58 100644 --- a/mps/code/messtest.c +++ b/mps/code/messtest.c @@ -10,8 +10,7 @@ #include "testlib.h" #include "mpslib.h" -#include -#include +#include /* printf */ SRCID(messtest, "$Id$"); diff --git a/mps/code/mpmss.c b/mps/code/mpmss.c index 9dd25574417..339ae5b54f4 100644 --- a/mps/code/mpmss.c +++ b/mps/code/mpmss.c @@ -7,19 +7,14 @@ #include "mpscmv.h" #include "mpscmvff.h" +#include "mpscmfs.h" #include "mpslib.h" #include "mpsavm.h" #include "testlib.h" #include "mpslib.h" #include "mps.h" -#include -#include - -/* TODO: Decide whether we should support the MPS pool class externally, - create mpscmfs.h, and replace this extern with proper use of its - interface. */ -extern mps_class_t PoolClassMFS(void); +#include /* printf */ #define testArenaSIZE ((((size_t)64)<<20) - 4) @@ -156,8 +151,7 @@ static void testInArena(mps_arena_t arena, mps_pool_debug_option_s *options) printf("MFS\n"); fixedSizeSize = 13; - die(stress(PoolClassMFS(), - fixedSize, arena, (size_t)100000, fixedSizeSize), + die(stress(mps_class_mfs(), fixedSize, arena, (size_t)100000, fixedSizeSize), "stress MFS"); printf("MV\n"); diff --git a/mps/code/mpsicv.c b/mps/code/mpsicv.c index 9cabc84c119..55396aee3fe 100644 --- a/mps/code/mpsicv.c +++ b/mps/code/mpsicv.c @@ -16,10 +16,7 @@ #include "mps.h" #include "mpstd.h" -#include -#include -#include -#include +#include /* printf */ #define exactRootsCOUNT 49 diff --git a/mps/code/nailboardtest.c b/mps/code/nailboardtest.c index a78ba4b3b9e..24bf3be36c2 100644 --- a/mps/code/nailboardtest.c +++ b/mps/code/nailboardtest.c @@ -12,6 +12,8 @@ #include "bt.h" #include "nailboard.h" +#include /* printf */ + static void test(mps_arena_t arena) { diff --git a/mps/code/poolncv.c b/mps/code/poolncv.c index 6d77542db58..8b8dab2a8a1 100644 --- a/mps/code/poolncv.c +++ b/mps/code/poolncv.c @@ -10,6 +10,8 @@ #include "testlib.h" #include "mpslib.h" +#include /* printf */ + static void testit(ArenaClass class, ArgList args) { diff --git a/mps/code/qs.c b/mps/code/qs.c index 0e73fd0d6da..4d78fc6bcb8 100644 --- a/mps/code/qs.c +++ b/mps/code/qs.c @@ -30,7 +30,8 @@ #include "mpscmv.h" #include "mpstd.h" -#include +#include /* printf */ +#include /* qsort */ #define testArenaSIZE ((size_t)1000*1024) @@ -316,14 +317,14 @@ static void validate(void) for(i = 0; i < listl; ++i) { cdie(((QSCell)reg[1])->tag == QSInt, "validate int"); if((mps_word_t)((QSCell)reg[1])->value != list[i]) { - (void)fprintf(stdout, "mps_res_t: Element %"PRIuLONGEST" of the " - "two lists do not match.\n", (ulongest_t)i); + printf("mps_res_t: Element %"PRIuLONGEST" of the " + "two lists do not match.\n", (ulongest_t)i); return; } reg[1] = (mps_addr_t)((QSCell)reg[1])->tail; } cdie(reg[1] == (mps_word_t)0, "validate end"); - (void)fprintf(stdout, "Note: Lists compare equal.\n"); + printf("Note: Lists compare equal.\n"); } diff --git a/mps/code/segsmss.c b/mps/code/segsmss.c index 91539a8feb9..978c352e0dd 100644 --- a/mps/code/segsmss.c +++ b/mps/code/segsmss.c @@ -23,10 +23,7 @@ #include "mpstd.h" #include "mps.h" -#include -#include -#include -#include +#include /* fflush, printf, puts, stdout */ /* Forward declarations */ @@ -789,7 +786,7 @@ static void *test(void *arg, size_t s) &ambigRoots[0], ambigRootsCOUNT), "root_create_table(ambig)"); - (void)fputs(indent, stdout); + puts(indent); /* create an ap, and leave it busy */ die(mps_reserve(&busy_init, busy_ap, 64), "mps_reserve busy"); diff --git a/mps/code/steptest.c b/mps/code/steptest.c index 74baa2662cb..5fae7270f0e 100644 --- a/mps/code/steptest.c +++ b/mps/code/steptest.c @@ -16,8 +16,7 @@ #include "mpstd.h" #include "mps.h" -#include -#include +#include /* fflush, printf, putchar, stdout */ #define testArenaSIZE ((size_t)((size_t)64 << 20)) #define avLEN 3 diff --git a/mps/code/teletest.c b/mps/code/teletest.c index 844fbc51329..1a6b1614553 100644 --- a/mps/code/teletest.c +++ b/mps/code/teletest.c @@ -12,7 +12,8 @@ #include "testlib.h" #include "mpslib.h" -#include +#include /* fflush, fgets, printf, stdin, stdout */ +#include /* exit, EXIT_SUCCESS, strtoul */ SRCID(teletest, "$Id$"); @@ -34,8 +35,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", - (ulongest_t)old, (ulongest_t)new); + printf(WORD_FORMAT " -> " WORD_FORMAT "\n", + (ulongest_t)old, (ulongest_t)new); } diff --git a/mps/code/testlib.c b/mps/code/testlib.c index 18fe005ae5b..6ecedad0bd6 100644 --- a/mps/code/testlib.c +++ b/mps/code/testlib.c @@ -11,13 +11,11 @@ #include "clock.h" /* for EVENT_CLOCK */ #include "mps.h" #include "misc.h" /* for NOOP */ -#include -#include -#include -#ifdef MPS_OS_IA -struct itimerspec; /* stop complaints from time.h */ -#endif -#include + +#include /* fmod */ +#include /* fflush, printf, stderr, sscanf, vfprintf */ +#include /* abort, exit, getenv */ +#include /* time */ /* fail -- like assert, but (notionally) returns a value, so usable in an expression */ diff --git a/mps/code/testlib.h b/mps/code/testlib.h index 447834254f4..aae5e396286 100644 --- a/mps/code/testlib.h +++ b/mps/code/testlib.h @@ -12,14 +12,7 @@ #include "mps.h" #include "misc.h" /* for STR */ - -/* Include system header hackery. */ #include "mpstd.h" -#ifdef MPS_OS_W3 -#include "mpswin.h" -#endif - -#include /* Suppress Visual C warnings at warning level 4, */ diff --git a/mps/code/walkt0.c b/mps/code/walkt0.c index 1095224a5ba..929408fc4b4 100644 --- a/mps/code/walkt0.c +++ b/mps/code/walkt0.c @@ -18,8 +18,7 @@ #include "mpstd.h" #include "mps.h" -#include -#include +#include /* printf */ #define testArenaSIZE ((size_t)((size_t)64 << 20)) #define avLEN 3 diff --git a/mps/code/zcoll.c b/mps/code/zcoll.c index 36931aa4860..06ef499f5b7 100644 --- a/mps/code/zcoll.c +++ b/mps/code/zcoll.c @@ -63,8 +63,7 @@ #include "fmtdytst.h" #include "mpstd.h" -#include -#include /* clock */ +#include /* fflush, printf, putchar, puts, stdout */ /* testChain -- generation parameters for the test */ diff --git a/mps/code/zmess.c b/mps/code/zmess.c index f7970de168d..555e7377d2c 100644 --- a/mps/code/zmess.c +++ b/mps/code/zmess.c @@ -108,7 +108,7 @@ #include "fmtdytst.h" #include "mpstd.h" -#include +#include /* printf */ #define testArenaSIZE ((size_t)16<<20)