]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/tic.c
ncurses 5.9 - patch 20140329
[ncurses.git] / progs / tic.c
index e1eb7e095567f624dd311b7f8be734d7d6962dfe..eeb209a7f4bd0476f352848c4f45c73bb5e003dd 100644 (file)
@@ -46,7 +46,7 @@
 #include <hashed_db.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.187 2013/08/17 21:15:15 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.190 2014/03/29 19:45:18 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -380,11 +380,11 @@ open_tempfile(char *filename)
     _nc_STRCPY(filename, "/tmp/XXXXXX", PATH_MAX);
 #if HAVE_MKSTEMP
     {
-       int oldmask = umask(077);
+       int oldmask = (int) umask(077);
        int fd = mkstemp(filename);
        if (fd >= 0)
            result = fdopen(fd, "w");
-       umask(oldmask);
+       umask((mode_t) oldmask);
     }
 #else
     if (tmpnam(filename) != 0)
@@ -1114,6 +1114,17 @@ check_colors(TERMTYPE *tp)
        if (!VALID_STRING(orig_pair) && !VALID_STRING(orig_colors))
            _nc_warning("expected either op/oc string for resetting colors");
     }
+    if (can_change) {
+       if (!VALID_STRING(initialize_pair) &&
+           !VALID_STRING(initialize_color)) {
+           _nc_warning("expected initc or initp because ccc is given");
+       }
+    } else {
+       if (VALID_STRING(initialize_pair) ||
+           VALID_STRING(initialize_color)) {
+           _nc_warning("expected ccc because initc is given");
+       }
+    }
 }
 
 static char
@@ -1140,7 +1151,7 @@ keypad_index(const char *string)
     long result = -1;
 
     if ((ch = keypad_final(string)) != '\0') {
-       test = strchr(list, ch);
+       test = (strchr) (list, ch);
        if (test != 0)
            result = (long) (test - list);
     }