From b96bf998f0577cbb5d561da5fa28cffbea1f6dd8 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Fri, 15 Jun 2001 03:37:17 +0000
Subject: [PATCH] Using macros for ctrl key constants.

---
 src/sbbs3/con_hi.cpp   | 2 +-
 src/sbbs3/execfunc.cpp | 4 ++--
 src/sbbs3/fido.cpp     | 4 ++--
 src/sbbs3/qwktomsg.cpp | 2 +-
 src/sbbs3/str.cpp      | 4 ++--
 src/sbbs3/writemsg.cpp | 2 +-
 src/sbbs3/xtrn.cpp     | 2 +-
 7 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/sbbs3/con_hi.cpp b/src/sbbs3/con_hi.cpp
index 12f0d79b7a..67a6a08682 100644
--- a/src/sbbs3/con_hi.cpp
+++ b/src/sbbs3/con_hi.cpp
@@ -82,7 +82,7 @@ int sbbs_t::stripattr(char *strin)
 
 	e=strlen(strin);
 	for(a=c=d=0;c<e && d<sizeof(str)-1;c++) {
-		if(strin[c]==1) {
+		if(strin[c]==CTRL_A) {
 			a++;
 			if(!validattr(strin[c+1])) {
 				c++;
diff --git a/src/sbbs3/execfunc.cpp b/src/sbbs3/execfunc.cpp
index fba7ecbeba..abea6e4d1f 100644
--- a/src/sbbs3/execfunc.cpp
+++ b/src/sbbs3/execfunc.cpp
@@ -371,7 +371,7 @@ int sbbs_t::exec_function(csi_t *csi)
 					}
 					continue;
 				}
-				if(ch==16) {	/* Ctrl-P Private node-node comm */
+				if(ch==CTRL_P) {		/* Private node-node comm */
 					lncntr=0;						/* defeat pause */
 					spy_socket[i-1]=INVALID_SOCKET;	/* disable spy output */
 					nodesync(); 					/* read waiting messages */
@@ -379,7 +379,7 @@ int sbbs_t::exec_function(csi_t *csi)
 					spy_socket[i-1]=client_socket;	/* enable spy output */
 					continue; 
 				}
-				if(ch==21) {	/* Ctrl-U Users online */
+				if(ch==CTRL_U) {		/* Users online */
 					lncntr=0;			/* defeat pause */
 					whos_online(true); 	/* list users */
 					continue;
diff --git a/src/sbbs3/fido.cpp b/src/sbbs3/fido.cpp
index f58ff59ca8..11a9608f05 100644
--- a/src/sbbs3/fido.cpp
+++ b/src/sbbs3/fido.cpp
@@ -321,7 +321,7 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
 
 		l=0L;
 		while(l<length) {
-			if(buf[l]==1)	/* Ctrl-A, so skip it and the next char */
+			if(buf[l]==CTRL_A)	/* Ctrl-A, so skip it and the next char */
 				l++;
 			else if(buf[l]!=LF) {
 				if((uchar)buf[l]==0x8d)   /* r0dent i converted to normal i */
@@ -836,7 +836,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
 		l++; }
 
 	while(l<n*128L) {
-		if(qwkbuf[l]==1)   /* Ctrl-A, so skip it and the next char */
+		if(qwkbuf[l]==CTRL_A)   /* Ctrl-A, so skip it and the next char */
 			l++;
 		else if(qwkbuf[l]!=LF) {
 			if((uchar)qwkbuf[l]==0xe3) /* QWK cr/lf char converted to hard CR */
diff --git a/src/sbbs3/qwktomsg.cpp b/src/sbbs3/qwktomsg.cpp
index 2039237bbf..458efde994 100644
--- a/src/sbbs3/qwktomsg.cpp
+++ b/src/sbbs3/qwktomsg.cpp
@@ -240,7 +240,7 @@ bool sbbs_t::qwktomsg(FILE *qwk_fp, char *hdrblk, char fromhub, uint subnum
 				continue;
 			if(qwkbuf[k]!=1 && lastch!=1)
 				col++;
-			if(lastch==1 && !validattr(qwkbuf[k])) {
+			if(lastch==CTRL_A && !validattr(qwkbuf[k])) {
 				if(taillen) taillen--;
 				else		bodylen--;
 				lastch=0;
diff --git a/src/sbbs3/str.cpp b/src/sbbs3/str.cpp
index 1a5da5f7fd..625db95fb5 100644
--- a/src/sbbs3/str.cpp
+++ b/src/sbbs3/str.cpp
@@ -51,7 +51,7 @@ char* DLLCALL remove_ctrl_a(char *instr, char *outstr)
 
 	j=strlen(instr);
 	for(k=i=0;i<j;i++) {
-		if(instr[i]==1)
+		if(instr[i]==CTRL_A)
 			i++;
 		else str[k++]=instr[i]; }
 	str[k]=0;
@@ -490,7 +490,7 @@ uint sbbs_t::gettmplt(char *strout,char *templt, long mode)
 				outchar(BS);
 			bputs(" \b");
 			continue; }
-		if(ch==24) {	/* Ctrl-X */
+		if(ch==CTRL_X) {
 			for(;c;c--) {
 				outchar(BS);
 				if(tmplt[c-1]=='N' || tmplt[c-1]=='A' || tmplt[c-1]=='!')
diff --git a/src/sbbs3/writemsg.cpp b/src/sbbs3/writemsg.cpp
index 8b73f8a35f..5ac1e633c3 100644
--- a/src/sbbs3/writemsg.cpp
+++ b/src/sbbs3/writemsg.cpp
@@ -264,7 +264,7 @@ bool sbbs_t::writemsg(char *fname, char *top, char *title, long mode, int subnum
 			if(sys_status&SS_ABORT) {  /* Ctrl-C */
 				LFREE(buf);
 				return(false); }
-			if((c==ESC || c==1) && useron.rest&FLAG('A')) /* ANSI restriction */
+			if((c==ESC || c==CTRL_A) && useron.rest&FLAG('A')) /* ANSI restriction */
 				continue;
 			if(c==BEL && useron.rest&FLAG('B'))   /* Beep restriction */
 				continue;
diff --git a/src/sbbs3/xtrn.cpp b/src/sbbs3/xtrn.cpp
index b1b9989a29..05ad2710a6 100644
--- a/src/sbbs3/xtrn.cpp
+++ b/src/sbbs3/xtrn.cpp
@@ -53,7 +53,7 @@ BYTE* wwiv_expand(BYTE* buf, ulong buflen, BYTE* outbuf, ulong& newlen
 	ulong 	i,j,k;
 
     for(i=j=0;i<buflen;i++) {
-        if(buf[i]==3) {	/* ctrl-c, WWIV color escape char */
+        if(buf[i]==CTRL_C) {	/* WWIV color escape char */
             ctrl_c=true;
             continue;
         }
-- 
GitLab