Kludge in termcap.c for OSs with NO_BAUD_CONVERSION.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sun, 21 Feb 1993 01:30:08 +0000 (01:30 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sun, 21 Feb 1993 01:30:08 +0000 (01:30 +0000)
v7/src/microcode/termcap.c

index 716fa49fe45c634fe99f8f7287383748de16687d..ac7eb965b08badd73cb01d6b186bd62573d9a7ec 100644 (file)
@@ -154,6 +154,50 @@ xrealloc (ptr, size)
   return tem;
 }
 #endif /* not emacs */
+
+#ifdef MIT_SCHEME
+# include "oscond.h"
+# ifdef _UNIX
+#  include "ux.h"
+# endif
+#endif
+
+short ospeed;
+
+#ifdef NO_BAUD_CONVERSION
+
+/* This is a kludge. */
+
+static
+short convert_ospeed (os)
+     unsigned short os;
+{
+  if (os >= 300)
+    return (0 - ((short) (os / 100)));
+  else
+    return ((short) (os));
+}
+
+#define OSPEED()       convert_ospeed ((unsigned short) ospeed)
+
+#else
+
+/* Actual baud rate if positive;
+   - baud rate / 100 if negative.  */
+
+static short speeds[] =
+  {
+#ifdef VMS
+    0, 50, 75, 110, 134, 150, -3, -6, -12, -18,
+    -20, -24, -36, -48, -72, -96, -192
+#else /* not VMS */
+    0, 50, 75, 110, 135, 150, -2, -3, -6, -12,
+    -18, -24, -48, -96, -192, -384
+#endif /* not VMS */
+  };
+
+#define OSPEED()       speeds[ospeed]
+#endif
 \f
 /* Looking up capabilities in the entry already found */
 
@@ -294,23 +338,8 @@ tgetst1 (ptr, area)
 \f
 /* Outputting a string with padding */
 
-short ospeed;
 char PC;
 
-/* Actual baud rate if positive;
-   - baud rate / 100 if negative.  */
-
-static short speeds[] =
-  {
-#ifdef VMS
-    0, 50, 75, 110, 134, 150, -3, -6, -12, -18,
-    -20, -24, -36, -48, -72, -96, -192
-#else /* not VMS */
-    0, 50, 75, 110, 135, 150, -2, -3, -6, -12,
-    -18, -24, -48, -96, -192, -384
-#endif /* not VMS */
-  };
-
 tputs (string, nlines, outfun)
      register char *string;
      int nlines;
@@ -339,10 +368,10 @@ tputs (string, nlines, outfun)
     (*outfun) (*string++);
 
   /* padcount is now in units of tenths of msec.  */
-  padcount *= speeds[ospeed];
+  padcount *= (OSPEED ());
   padcount += 500;
   padcount /= 1000;
-  if (speeds[ospeed] < 0)
+  if ((OSPEED ()) < 0)
     padcount = -padcount;
   else
     {