Index: ram/stmproc.c
===================================================================
--- ram/stmproc.c	(revision 05806159f2593192d6ed2fca28358480a2383c67)
+++ ram/stmproc.c	(revision 7258c6ac4de2518c5430095742a27be7af0c89d7)
@@ -24,15 +24,15 @@
 #include "ptdisp.h"
 
-extern	short	ptegood, ptedfok, ptestok, ptedsok, ptedtok;
-
-extern	short	ptedef, ptestm, ptespec, ptesuba, ptedat1;
-
-extern	short	pteset;
-
-extern	short	ptecpos, ptepred, ptesucc;
+extern	int16_t	ptegood, ptedfok, ptestok, ptedsok, ptedtok;
+
+extern	int16_t	ptedef, ptestm, ptespec, ptesuba, ptedat1;
+
+extern	int16_t	pteset;
+
+extern	int16_t	ptecpos, ptepred, ptesucc;
 
 extern	struct patch	ptebuf;
 
-extern	char	ptdebuf[];
+extern	int8_t	ptdebuf[];
 
 #if	DEBUGDP
@@ -62,15 +62,15 @@
 #endif
 
-unsigned short	dtfree;			/* defent free list index */
-unsigned short	ptfree;			/* patch free list index */
-
-unsigned short	dpepred;		/* defent predecessor index */
-unsigned short	dpecpos;		/* current defent index */
-unsigned short	dpesucc;		/* defent successor index */
-
-char	ptdsbuf[50];			/* patch display build buffer */
-
-char	defptr[NDEFSTMS];		/* definition index table */
-char	stmptr[NDEFSTMS];		/* stimulus index table */
+uint16_t	dtfree;			/* defent free list index */
+uint16_t	ptfree;			/* patch free list index */
+
+uint16_t	dpepred;		/* defent predecessor index */
+uint16_t	dpecpos;		/* current defent index */
+uint16_t	dpesucc;		/* defent successor index */
+
+int8_t	ptdsbuf[50];			/* patch display build buffer */
+
+int8_t	defptr[NDEFSTMS];		/* definition index table */
+int8_t	stmptr[NDEFSTMS];		/* stimulus index table */
 
 struct	defent	defents[RAWDEFS];	/* definition control table */
@@ -80,7 +80,7 @@
 struct	wordq	ptefifo;		/* patch trigger fifo header */
 
-unsigned short	ptewrds[NPTEQELS];	/* patch trigger fifo entries */
-
-char	dmatch[] = {			/* addat1 match tags */
+uint16_t	ptewrds[NPTEQELS];	/* patch trigger fifo entries */
+
+int8_t	dmatch[] = {			/* addat1 match tags */
 
 	0, 0, 0, 0, 0, 0, 0, 0,		/*  0 ..  7 */
@@ -102,5 +102,5 @@
 void initpt(void)
 {
-	register unsigned short i;
+	register uint16_t i;
 
 	/* initialize the trigger fifo */
@@ -142,7 +142,7 @@
 */
 
-unsigned short pt_alc(void)
-{
-	register unsigned short pe;
+uint16_t pt_alc(void)
+{
+	register uint16_t pe;
 
 	if (0 NE (pe = ptfree))
@@ -158,5 +158,5 @@
 */
 
-void pt_del(unsigned short pe)
+void pt_del(uint16_t pe)
 {
 	patches[pe].nextstm = ptfree;
@@ -174,7 +174,7 @@
 */
 
-unsigned short dt_alc(void)
-{
-	register unsigned short de;
+uint16_t dt_alc(void)
+{
+	register uint16_t de;
 
 	if (0 NE (de = dtfree))
@@ -190,5 +190,5 @@
 */
 
-void dt_del(unsigned short de)
+void dt_del(uint16_t de)
 {
 	defents[de].nextdef = dtfree;
@@ -211,7 +211,7 @@
 */
 
-short cprdpe(unsigned short np)
-{
-	register unsigned short ca, cb, ct;
+int16_t cprdpe(uint16_t np)
+{
+	register uint16_t ca, cb, ct;
 	register struct defent *pp;
 
@@ -274,7 +274,7 @@
 */
 
-short finddpe(void)
-{
-	register unsigned short c, idef;
+int16_t finddpe(void)
+{
+	register uint16_t c, idef;
 
 	dpepred = 0;		/* initialize dpepred = 0  (no predecessor) */
@@ -370,7 +370,7 @@
 */
 
-short cprpte(unsigned short np)
-{
-	register unsigned short ca, cb, ct;
+int16_t cprpte(uint16_t np)
+{
+	register uint16_t ca, cb, ct;
 	register struct patch *pb, *pp;
 
@@ -440,7 +440,7 @@
 */
 
-short findpte(void)
-{
-	register unsigned short c, istim;
+int16_t findpte(void)
+{
+	register uint16_t c, istim;
 
 	ptepred = 0;		/* initialize ptepred = 0  (no predecessor) */
@@ -533,6 +533,6 @@
 void entrpte(void)
 {
-	register short c;
-	register unsigned short np, stim;
+	register int16_t c;
+	register uint16_t np, stim;
 
 	ptegood = ptedfok AND ptestok AND ptedsok AND ptedtok;
@@ -711,7 +711,7 @@
 */
 
-short find1st(void)
-{
-	register short cp, pp;
+int16_t find1st(void)
+{
+	register int16_t cp, pp;
 
 	for (cp = 0; cp < NDEFSTMS; cp++)
@@ -728,7 +728,7 @@
 */
 
-short findnxt(short cp)
-{
-	register short np, stim;
+int16_t findnxt(int16_t cp)
+{
+	register int16_t np, stim;
 
 	if (0 NE (np = patches[cp].nextstm))
@@ -754,7 +754,7 @@
 */
 
-short findprv(short cp)
-{
-	register short np, pp, stim;
+int16_t findprv(int16_t cp)
+{
+	register int16_t np, pp, stim;
 
 	if (0 NE (np = patches[cp].prevstm))	/* return prevstm if set */
@@ -789,7 +789,7 @@
 */
 
-void dpte(short pe, short row, short atr)
-{
-	register short i;
+void dpte(int16_t pe, int16_t row, int16_t atr)
+{
+	register int16_t i;
 
 	memset(ptdsbuf, ' ', 50);
@@ -824,5 +824,5 @@
 void dptw(void)
 {
-	register short cp, r, row, pp;
+	register int16_t cp, r, row, pp;
 
 #if	DEBUGDP
@@ -979,5 +979,5 @@
 void srdspte(void)
 {
-	short	oldcpos, oldpred, oldsucc;
+	int16_t	oldcpos, oldpred, oldsucc;
 #if	DEBUGSR
 	register short i;
@@ -1064,10 +1064,10 @@
 */
 
-void stmproc(unsigned short trg)
+void stmproc(uint16_t trg)
 {
 	register struct defent	*nextdef;
 	register struct patch	*nextpch;
-	register unsigned short adspec, adsuba, np, stim;
-	unsigned short addat1, adrtag;
+	register uint16_t adspec, adsuba, np, stim;
+	uint16_t addat1, adrtag;
 
 	/* ***** DEFINER PROCESSING PHASE ***** */
