]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - include/capdefaults.c
ncurses 6.1 - patch 20200104
[ncurses.git] / include / capdefaults.c
index 071f9e17cdbb427da028f3724274285eea1d8706..da76cc1d7a57d8d7fad3679cd70c21e31888f710 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 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.14 2008/11/16 00:19:59 juergen Exp $ */
 
     /*
      * Compute obsolete capabilities.  The reason this is an include file is
      * 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 +75,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;