Hi tech@,

Remove unnecessary #ifdefs in telnet. No binary change.

Comments? OK?

Index: usr.bin/telnet/externs.h
===================================================================
RCS file: /cvs/src/usr.bin/telnet/externs.h,v
retrieving revision 1.30
diff -u -p -r1.30 externs.h
--- usr.bin/telnet/externs.h    24 Nov 2015 05:06:24 -0000      1.30
+++ usr.bin/telnet/externs.h    5 Jul 2017 09:18:09 -0000
@@ -277,55 +277,15 @@ extern struct     termios new_tc;
 # define termKillChar          new_tc.c_cc[VKILL]
 # define termQuitChar          new_tc.c_cc[VQUIT]
 # define termSuspChar          new_tc.c_cc[VSUSP]
-
-# if   defined(VFLUSHO) && !defined(VDISCARD)
-#  define VDISCARD VFLUSHO
-# endif
-# ifndef       VDISCARD
-extern cc_t termFlushChar;
-# else
-#  define termFlushChar                new_tc.c_cc[VDISCARD]
-# endif
-# ifndef VWERASE
-extern cc_t termWerasChar;
-# else
-#  define termWerasChar                new_tc.c_cc[VWERASE]
-# endif
-# ifndef       VREPRINT
-extern cc_t termRprntChar;
-# else
-#  define termRprntChar                new_tc.c_cc[VREPRINT]
-# endif
-# ifndef       VLNEXT
-extern cc_t termLiteralNextChar;
-# else
-#  define termLiteralNextChar  new_tc.c_cc[VLNEXT]
-# endif
-# ifndef       VSTART
-extern cc_t termStartChar;
-# else
-#  define termStartChar                new_tc.c_cc[VSTART]
-# endif
-# ifndef       VSTOP
-extern cc_t termStopChar;
-# else
-#  define termStopChar         new_tc.c_cc[VSTOP]
-# endif
-# ifndef       VEOL
-extern cc_t termForw1Char;
-# else
-#  define termForw1Char                new_tc.c_cc[VEOL]
-# endif
-# ifndef       VEOL2
-extern cc_t termForw2Char;
-# else
-#  define termForw2Char                new_tc.c_cc[VEOL]
-# endif
-# ifndef       VSTATUS
-extern cc_t termAytChar;
-#else
-#  define termAytChar          new_tc.c_cc[VSTATUS]
-#endif
+# define termFlushChar         new_tc.c_cc[VDISCARD]
+# define termWerasChar         new_tc.c_cc[VWERASE]
+# define termRprntChar         new_tc.c_cc[VREPRINT]
+# define termLiteralNextChar   new_tc.c_cc[VLNEXT]
+# define termStartChar         new_tc.c_cc[VSTART]
+# define termStopChar          new_tc.c_cc[VSTOP]
+# define termForw1Char         new_tc.c_cc[VEOL]
+# define termForw2Char         new_tc.c_cc[VEOL]
+# define termAytChar           new_tc.c_cc[VSTATUS]
 
 /* Ring buffer structures which are shared */
 
Index: usr.bin/telnet/sys_bsd.c
===================================================================
RCS file: /cvs/src/usr.bin/telnet/sys_bsd.c,v
retrieving revision 1.32
diff -u -p -r1.32 sys_bsd.c
--- usr.bin/telnet/sys_bsd.c    16 Mar 2016 15:41:11 -0000      1.32
+++ usr.bin/telnet/sys_bsd.c    5 Jul 2017 09:18:09 -0000
@@ -123,28 +123,6 @@ TerminalSaveState(void)
     tcgetattr(0, &old_tc);
 
     new_tc = old_tc;
-
-#ifndef        VDISCARD
-    termFlushChar = CONTROL('O');
-#endif
-#ifndef        VWERASE
-    termWerasChar = CONTROL('W');
-#endif
-#ifndef        VREPRINT
-    termRprntChar = CONTROL('R');
-#endif
-#ifndef        VLNEXT
-    termLiteralNextChar = CONTROL('V');
-#endif
-#ifndef        VSTART
-    termStartChar = CONTROL('Q');
-#endif
-#ifndef        VSTOP
-    termStopChar = CONTROL('S');
-#endif
-#ifndef        VSTATUS
-    termAytChar = CONTROL('T');
-#endif
 }
 
 cc_t *
@@ -161,22 +139,11 @@ tcval(int func)
     case SLC_FORW1:    return(&termForw1Char);
     case SLC_FORW2:    return(&termForw2Char);
     case SLC_SUSP:     return(&termSuspChar);
-# ifdef        VDISCARD
     case SLC_AO:       return(&termFlushChar);
-# endif
-# ifdef        VWERASE
     case SLC_EW:       return(&termWerasChar);
-# endif
-# ifdef        VREPRINT
     case SLC_RP:       return(&termRprntChar);
-# endif
-# ifdef        VLNEXT
     case SLC_LNEXT:    return(&termLiteralNextChar);
-# endif
-# ifdef        VSTATUS
     case SLC_AYT:      return(&termAytChar);
-# endif
-
     case SLC_SYNCH:
     case SLC_BRK:
     case SLC_EOR:
@@ -189,27 +156,6 @@ void
 TerminalDefaultChars(void)
 {
     memcpy(new_tc.c_cc, old_tc.c_cc, sizeof(old_tc.c_cc));
-# ifndef       VDISCARD
-    termFlushChar = CONTROL('O');
-# endif
-# ifndef       VWERASE
-    termWerasChar = CONTROL('W');
-# endif
-# ifndef       VREPRINT
-    termRprntChar = CONTROL('R');
-# endif
-# ifndef       VLNEXT
-    termLiteralNextChar = CONTROL('V');
-# endif
-# ifndef       VSTART
-    termStartChar = CONTROL('Q');
-# endif
-# ifndef       VSTOP
-    termStopChar = CONTROL('S');
-# endif
-# ifndef       VSTATUS
-    termAytChar = CONTROL('T');
-# endif
 }
 
 /*
Index: usr.bin/telnet/terminal.c
===================================================================
RCS file: /cvs/src/usr.bin/telnet/terminal.c,v
retrieving revision 1.13
diff -u -p -r1.13 terminal.c
--- usr.bin/telnet/terminal.c   22 Jul 2014 07:30:24 -0000      1.13
+++ usr.bin/telnet/terminal.c   5 Jul 2017 09:18:09 -0000
@@ -41,34 +41,6 @@ unsigned char        ttyobuf[2*BUFSIZ], ttyibuf
 
 int termdata;                  /* Debugging flag */
 
-# ifndef VDISCARD
-cc_t termFlushChar;
-# endif
-# ifndef VLNEXT
-cc_t termLiteralNextChar;
-# endif
-# ifndef VWERASE
-cc_t termWerasChar;
-# endif
-# ifndef VREPRINT
-cc_t termRprntChar;
-# endif
-# ifndef VSTART
-cc_t termStartChar;
-# endif
-# ifndef VSTOP
-cc_t termStopChar;
-# endif
-# ifndef VEOL
-cc_t termForw1Char;
-# endif
-# ifndef VEOL2
-cc_t termForw2Char;
-# endif
-# ifndef VSTATUS
-cc_t termAytChar;
-# endif
-
 /*
  * initialize the terminal data structures.
  */

Reply via email to