]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - include/capdefaults.c
ncurses 6.4 - patch 20240420
[ncurses.git] / include / capdefaults.c
index 071f9e17cdbb427da028f3724274285eea1d8706..0bdda14dee2d2932e86307952ce1ca8e13237cf8 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 1998-2000 Free Software Foundation, Inc.                   *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
+ * Copyright 1998-2000,2008 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
-/* $Id: capdefaults.c,v 1.12 2000/01/02 02:34:56 tom Exp $ */
+/* $Id: capdefaults.c,v 1.16 2021/09/04 10:52:55 tom Exp $ */
 
     /*
      * Compute obsolete capabilities.  The reason this is an include file is
-     * that the two places where it's needed want the macros to generate
+     * that the two places where it is needed require the macros to generate
      * offsets to different structures.  See the file Caps for explanations of
      * these conversions.
      *
      * postprocess_termcap().
      */
 {
-    char *sp;
-    int capval;
+    char *strp;
+    short capval;
 
-#define EXTRACT_DELAY(str)     (sp = strchr(str, '*'), sp ? atoi(sp+1) : 0)
+#define EXTRACT_DELAY(str) \
+       (short) (strp = strchr(str, '*'), strp ? atoi(strp+1) : 0)
 
     /* current (4.4BSD) capabilities marked obsolete */
     if (VALID_STRING(carriage_return)
@@ -73,8 +76,8 @@
        magic_cookie_glitch_ul = magic_cookie_glitch;
 
     /* totally obsolete capabilities */
-    linefeed_is_newline = VALID_STRING(newline)
-       && (strcmp("\n", newline) == 0);
+    linefeed_is_newline = (char) (VALID_STRING(newline)
+                                 && (strcmp("\n", newline) == 0));
     if (VALID_STRING(cursor_left)
        && (capval = EXTRACT_DELAY(cursor_left)))
        backspace_delay = capval;