]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_screen.c
ncurses 6.1 - patch 20190323
[ncurses.git] / ncurses / base / lib_screen.c
index 729c11da93bb601c849a38a52acf09d38fff4711..dba29809d93be296a36413d0a558b617e3ef4732 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2018,2019 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            *
@@ -41,7 +41,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_screen.c,v 1.92 2018/01/07 02:22:55 tom Exp $")
+MODULE_ID("$Id: lib_screen.c,v 1.94 2019/03/23 23:47:16 tom Exp $")
 
 #define MAX_SIZE 0x3fff                /* 16k is big enough for a window or pad */
 
@@ -832,7 +832,7 @@ putwin(WINDOW *win, FILE *filep)
                encode_attr(buffer, TOP_SLIMIT
                            (*(const attr_t *) dp) & ~A_CHARTEXT,
                            A_NORMAL,
-                           (int) COLOR_PAIR(attr),
+                           COLOR_PAIR((int) attr),
                            0);
                break;
            case pBOOL:
@@ -847,7 +847,7 @@ putwin(WINDOW *win, FILE *filep)
                encode_attr(buffer, TOP_SLIMIT
                            * (const attr_t *) dp,
                            A_NORMAL,
-                           (int) COLOR_PAIR(attr),
+                           COLOR_PAIR((int) attr),
                            0);
                break;
            case pINT:
@@ -948,7 +948,7 @@ NCURSES_SP_NAME(scr_restore) (NCURSES_SP_DCLx const char *file)
     T((T_CALLED("scr_restore(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file)));
 
     if (_nc_access(file, R_OK) >= 0
-       && (fp = fopen(file, "rb")) != 0) {
+       && (fp = fopen(file, BIN_R)) != 0) {
        delwin(NewScreen(SP_PARM));
        NewScreen(SP_PARM) = getwin(fp);
 #if !USE_REENTRANT
@@ -979,7 +979,7 @@ scr_dump(const char *file)
     T((T_CALLED("scr_dump(%s)"), _nc_visbuf(file)));
 
     if (_nc_access(file, W_OK) < 0
-       || (fp = fopen(file, "wb")) == 0) {
+       || (fp = fopen(file, BIN_W)) == 0) {
        result = ERR;
     } else {
        (void) putwin(newscr, fp);
@@ -1006,7 +1006,7 @@ NCURSES_SP_NAME(scr_init) (NCURSES_SP_DCLx const char *file)
        FILE *fp = 0;
 
        if (_nc_access(file, R_OK) >= 0
-           && (fp = fopen(file, "rb")) != 0) {
+           && (fp = fopen(file, BIN_R)) != 0) {
            delwin(CurScreen(SP_PARM));
            CurScreen(SP_PARM) = getwin(fp);
 #if !USE_REENTRANT