[PATCH xts 3/4] Unifdef TET_LITE.

Eric Anholt eric at anholt.net
Sat Sep 24 08:39:49 UTC 2016


We set it globally in configure.ac, and it seems unlikely that we
would use more of this test framework's features in the future.

Generated with:

git ls-tree --name-only -r HEAD | \
    grep -E "*\.(c|cpp|h)$" | \
    xargs unifdef -m -DTET_LITE=1

Signed-off-by: Eric Anholt <eric at anholt.net>
---

Just including a couple of files in this diff to save ML space.  The
whole diff is 260k.

 include/tet_api.h            |  72 -----
 src/tet3/apilib/dresfile.c   |  60 ----
 src/tet3/apilib/exit.c       |  23 --
 src/tet3/apilib/getlist.c    |  50 ----
 src/tet3/apilib/getsys.c     |   4 -
 src/tet3/apilib/getsysid.c   |  49 ----
 src/tet3/apilib/libvers.c    |   4 -
 src/tet3/apilib/remexec.c    | 668 -------------------------------------------
 src/tet3/apilib/remkill.c    |  45 ---
 src/tet3/apilib/remtime.c    |  65 -----
 src/tet3/apilib/remwait.c    |  78 -----
 src/tet3/apilib/rtab.c       | 109 -------
 src/tet3/apilib/sync.c       | 326 ---------------------
 src/tet3/apilib/tdiscon.c    |  37 ---
 src/tet3/apilib/tet_exec.c   |  30 --
 src/tet3/apilib/tet_fork.c   |   9 -
 src/tet3/apilib/tet_spawn.c  |   7 -
 src/tet3/dtet2lib/avmsg.c    | 167 -----------
 src/tet3/dtet2lib/btmsg.c    |  62 ----
 src/tet3/dtet2lib/dtmsg.c    |  62 ----
 src/tet3/dtet2lib/errmap.c   |   7 -
 src/tet3/dtet2lib/fcopy.c    |   5 -
 src/tet3/dtet2lib/genfatal.c |   3 -
 src/tet3/dtet2lib/ldst.c     | 226 ---------------
 src/tet3/dtet2lib/prerror.c  |   2 -
 src/tet3/dtet2lib/ptflags.c  |  36 ---
 src/tet3/dtet2lib/ptspid.c   |  33 ---
 src/tet3/dtet2lib/ptstate.c  |  44 ---
 src/tet3/dtet2lib/ptstype.c  |  32 ---
 src/tet3/dtet2lib/pttype.c   |  32 ---
 src/tet3/dtet2lib/rtoa.c     |  35 ---
 src/tet3/dtet2lib/svote.c    |  32 ---
 src/tet3/dtet2lib/sysbyid.c  |  32 ---
 src/tet3/dtet2lib/sysent.c   |  92 ------
 src/tet3/dtet2lib/systate.c  |  39 ---
 src/tet3/dtet2lib/trace.c    |  19 --
 src/tet3/dtet2lib/valmsg.c   | 188 ------------
 src/tet3/inc/apilib.h        |  14 -
 src/tet3/inc/dtetlib.h       |   3 -
 src/tet3/inc/dtmac.h         |   4 -
 src/tet3/inc/error.h         |   4 -
 src/tet3/inc/ptab.h          | 152 ----------
 src/tet3/inc/server.h        |  20 --
 src/tet3/inc/servlib.h       |  87 ------
 src/tet3/inc/synreq.h        |  95 ------
 src/tet3/inc/tcclib.h        |   8 -
 src/tet3/inc/tslib.h         |  16 --
 src/tet3/tcc/config.c        | 401 --------------------------
 src/tet3/tcc/copysave.c      | 190 ------------
 src/tet3/tcc/dirtab.c        |  40 ---
 src/tet3/tcc/dirtab.h        |   6 -
 src/tet3/tcc/dtcc.c          | 327 ---------------------
 src/tet3/tcc/dtcc.h          |  10 -
 src/tet3/tcc/environ.c       |  17 --
 src/tet3/tcc/error.c         |   8 -
 src/tet3/tcc/exec.c          |  15 -
 src/tet3/tcc/fake.c          |  42 ---
 src/tet3/tcc/jnlproc.c       | 103 -------
 src/tet3/tcc/journal.c       | 102 -------
 src/tet3/tcc/lock.c          |   8 -
 src/tet3/tcc/procdir.c       | 189 ------------
 src/tet3/tcc/proctab.c       |  12 -
 src/tet3/tcc/proctab.h       |  42 ---
 src/tet3/tcc/proctc.c        | 162 -----------
 src/tet3/tcc/proctcd.c       | 300 -------------------
 src/tet3/tcc/rescode.c       | 137 ---------
 src/tet3/tcc/rrproc.c        |  52 ----
 src/tet3/tcc/scen1.c         |  27 --
 src/tet3/tcc/scen2.c         |  53 ----
 src/tet3/tcc/scenpp.c        |  12 -
 src/tet3/tcc/scentab.c       |  20 --
 src/tet3/tcc/service.c       |  22 --
 src/tet3/tcc/sigtrap.c       |   4 -
 src/tet3/tcc/syscall.c       |  60 ----
 src/tet3/tcc/systab.c        |  63 ----
 src/tet3/tcc/systab.h        |   8 -
 src/tet3/tcc/tcc.c           |  25 --
 src/tet3/tcc/tcc.h           |   9 -
 src/tet3/tcc/tcc_bs.c        | 188 ------------
 src/tet3/tcc/tcc_in.c        | 346 ----------------------
 src/tet3/tcc/tool.c          |  93 ------
 src/tet3/tcclib/procdir.c    |  27 --
 src/tet3/tcclib/tcfexec.c    |  19 --
 src/tet3/tcm/ckversion.c     |   4 -
 src/tet3/tcm/dtcm.c          | 113 --------
 src/tet3/tcm/ictp.c          | 359 -----------------------
 src/tet3/tcm/tcm.c           | 228 ---------------
 src/tet3/tcm/tcmchild.c      | 228 ---------------
 src/tet3/tcm/tcmfuncs.c      | 177 ------------
 src/tet3/tcm/tcmfuncs.h      |   6 -
 90 files changed, 7441 deletions(-)

diff --git a/include/tet_api.h b/include/tet_api.h
index 36561eaf0364..94e2b73162b9 100644
--- a/include/tet_api.h
+++ b/include/tet_api.h
@@ -254,57 +254,6 @@ extern "C" {
 #define TET_NULLFP	((void (*) ()) 0)
 
 
-#ifndef TET_LITE /* -START-LITE-CUT- */
-
-   /*
-   ** sync requests and sync error reporting
-   */
-
-   /* structure used in tet_msync() and tet_remsync() calls */
-   struct tet_synmsg {
-   	char *tsm_data;	/* ptr to sync message data buffer */
-   	int tsm_dlen;	/* no of bytes in sm_data */
-   	int tsm_sysid;	/* id of system sending sync message data */
-   	int tsm_flags;	/* flags - see below */
-   };
-
-   /* values for tsm_flags (a bit field) */
-#  define TET_SMSNDMSG	001	/* system is sending message data */
-#  define TET_SMRCVMSG	002	/* system is receiving message data */
-#  define TET_SMDUP	004	/* more than one system attempted to send */
-#  define TET_SMTRUNC	010	/* message data was truncated */
-
-#  define TET_SMMSGMAX	1024	/* maximum size of a tet_msync message -
-   				   size must be expressable in 12 bits
-   				   (see ST_COUNTMASK in ldst.h) */
-
-   /* sync votes */
-#  define TET_SV_YES		1
-#  define TET_SV_NO		2
-
-   /* structure of an element in the array describing sync status
-      that is passed by the API to the sync error reporting function */
-   struct tet_syncstat {
-   	int tsy_sysid;	/* system ID */
-   	int tsy_state;	/* sync state */
-   };
-
-   /* values for tsy_state */
-#  define TET_SS_NOTSYNCED	1	/* sync request not received */
-#  define TET_SS_SYNCYES	2	/* system voted YES */
-#  define TET_SS_SYNCNO		3	/* system voted NO */
-#  define TET_SS_TIMEDOUT	4	/* system timed out */
-#  define TET_SS_DEAD		5	/* process exited */
-
-
-   /* structure of the data item that is filled in by tet_getsysbyid() */
-#  define TET_SNAMELEN	32		/* maximum system name length */
-   struct tet_sysent {
-   	int ts_sysid;			/* system ID */
-   	char ts_name[TET_SNAMELEN];	/* system name */
-   };
-
-#endif /* -END-LITE-CUT- */
 
 
 /*
@@ -337,23 +286,6 @@ TET_IMPORT_FUNC(int, tet_wait, TET_PROTOLIST((pid_t, int *)));
 #endif /* !_WIN32 */
 
 /* functions only in Distributed TETware */
-#ifndef TET_LITE /* -START-LITE-CUT- */
-   TET_IMPORT_FUNC(int, tet_getsysbyid,
-	TET_PROTOLIST((int, struct tet_sysent *)));
-   TET_IMPORT_FUNC(int, tet_msync,
-	TET_PROTOLIST((long, int *, int, struct tet_synmsg *)));
-   TET_IMPORT_FUNC(int, tet_remsync,
-	TET_PROTOLIST((long, int *, int, int, int, struct tet_synmsg *)));
-   TET_IMPORT_FUNC(int, tet_remtime, TET_PROTOLIST((int, time_t *)));
-   TET_IMPORT_FUNC(int, tet_sync, TET_PROTOLIST((long, int *, int)));
-   TET_IMPORT_FUNC(void, tet_syncreport,
-	TET_PROTOLIST((long, struct tet_syncstat *, int)));
-#  if !defined(TET_THREADS) && !defined(TET_POSIX_THREADS)
-     TET_IMPORT_FUNC(int, tet_remexec, TET_PROTOLIST((int, char *, char **)));
-     TET_IMPORT_FUNC(int, tet_remkill, TET_PROTOLIST((int)));
-     TET_IMPORT_FUNC(int, tet_remwait, TET_PROTOLIST((int, int, int *)));
-#  endif /* !THREADS */
-#endif /* -END-LITE-CUT- */
 
 
 /* functions only in the Thread-safe API */
@@ -404,10 +336,6 @@ TET_IMPORT_FUNC(int, tet_wait, TET_PROTOLIST((pid_t, int *)));
 
 TET_IMPORT_ARRAY(char *, tet_errlist, []);
 TET_IMPORT_DATA(int, tet_nerr);
-#ifndef TET_LITE /* -START-LITE-CUT- */
-  TET_IMPORT_FUNC_PTR(void, tet_syncerr,
-	TET_PROTOLIST((long, struct tet_syncstat *, int)));
-#endif /* -END-LITE-CUT- */
 
 /* the following are in the TCM */
 extern int tet_nosigreset;
diff --git a/src/tet3/apilib/dresfile.c b/src/tet3/apilib/dresfile.c
index 70aacfcc036f..33b7ceb8a3f2 100644
--- a/src/tet3/apilib/dresfile.c
+++ b/src/tet3/apilib/dresfile.c
@@ -203,10 +203,8 @@ static void tet_merr_sc3 PROTOLIST((int, char *, char *));
 TET_IMPORT int	tet_combined_ok = 0; /* true if OK to write to the xres file */
 TET_IMPORT long	tet_activity = -1;
 TET_IMPORT long	tet_context = 0;
-#ifdef TET_LITE	/* -LITE-CUT-LINE- */
 FILE *tet_resfp;
 FILE *tet_tmpresfp;
-#endif		/* -LITE-CUT-LINE- */
 #ifndef TET_THREADS
 long	tet_block = 0;
 long	tet_sequence = 0;
@@ -277,22 +275,6 @@ int nlines;
 	/* For TETware-Lite all execution results file output comes
 	   through here.  For non-Lite only infolines and TCM errors. */
 
-#ifndef TET_LITE /* -START-LITE-CUT- */
-
-	if (tet_xdxresv(tet_xrid, lineptrs, nlines) < 0) {
-		switch (tet_xderrno) {
-		case ER_INVAL:
-		case ER_ERR:
-			break;
-		default:
-			tet_combined_ok = 0;
-			break;
-		}
-		tet_errno = -tet_xderrno;
-		return -1;
-	}
-
-#else /* -END-LITE-CUT- */
 
 	size_t len;
 
@@ -343,7 +325,6 @@ int nlines;
 		tet_errno = TET_ER_ERR;
 		return -1;
 	}
-#endif /* -LITE-CUT-LINE- */
 
 	return 0;
 }
@@ -739,9 +720,7 @@ va_dcl
 TET_IMPORT void tet_result(result)
 int result;
 {
-#ifdef TET_LITE
 	char *resname;
-#endif
 	char errmsg[128];
 
 	if (tet_thistest == 0)
@@ -755,29 +734,6 @@ int result;
 
 	API_LOCK;
 
-#ifndef TET_LITE /* -START-LITE-CUT- */
-
-	/* Call generic function to tell xresd the result */
-	if (tet_xdresult(tet_xrid, result) < 0)
-	{
-		switch (tet_xderrno) {
-		case ER_INVAL:
-		case ER_SYSID:
-		case ER_DONE:
-		case ER_ERR:
-			break;
-		default:
-			tet_combined_ok = 0;
-			break;
-		}
-		sprintf(errmsg,
-			"tet_result(): can't send result %d to XRESD",
-			result);
-		tet_error(tet_xderrno, errmsg);
-		tet_exit(EXIT_FAILURE);
-	}
-
-#else /* -END-LITE-CUT- */
 
 	/*
 	 * Look up supplied code in results code file to check it's valid.
@@ -817,7 +773,6 @@ int result;
 	    fflush(tet_tmpresfp) != 0)
 		fatal(errno, "write failed on temp result file", (char *)0);
 
-#endif /* -LITE-CUT-LINE- */
 
 	API_UNLOCK;
 }
@@ -1100,21 +1055,11 @@ void tet_routput(lines, nlines)
 char **lines;
 int nlines;
 {
-#ifdef TET_LITE	/* -LITE-CUT-LINE- */
 
 #  define ERRMSG \
      "unable to write the following message to the tet_xres file"
 #  define ERRNUM	errno
 
-#else		/* -START-LITE-CUT- */
-
-	int save_xderrno = tet_xderrno;
-
-#  define ERRMSG \
-     "unable to send the following message to XRESD"
-#  define ERRNUM	tet_xderrno
-
-#endif		/* -END-LITE-CUT- */
 
 	/*
 	** send the message to the tet_xres file (in TETware-LITE)
@@ -1132,9 +1077,6 @@ int nlines;
 		tet_exit(EXIT_FAILURE);
 	}
 
-#ifndef TET_LITE /* -START-LITE-CUT- */
-	tet_xderrno = save_xderrno;
-#endif /* -END-LITE-CUT- */
 
 }
 
@@ -1186,7 +1128,6 @@ char *header, *data, *outbuf;
 	}
 }
 
-#ifdef TET_LITE	/* -START-LITE-CUT- */
 
 /*
 **	get_code() - look up result code, return name if found, otherwise NULL.
@@ -1214,5 +1155,4 @@ int *abortflag;
 	return tet_getresname(result, abortflag);
 }
 
-#endif		/* -END-LITE-CUT- */
 


More information about the xorg-devel mailing list