]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/savescreen.c
ncurses 5.7 - patch 20101113
[ncurses.git] / test / savescreen.c
index fe8d4e32cbb3e7ef8170c3070c53e2971042defa..3d6f248cd42d6e7285c5a9209d69fb6f66b8d313 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007,2009 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2007-2009,2010 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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: savescreen.c,v 1.11 2009/10/10 19:38:21 tom Exp $
+ * $Id: savescreen.c,v 1.13 2010/11/13 21:18:00 tom Exp $
  *
  * Demonstrate save/restore functions from the curses library.
  * Thomas Dickey - 2007/7/14
@@ -189,8 +189,8 @@ main(int argc, char *argv[])
     if (has_colors()) {
        start_color();
        for (ch = 0; ch < COLOR_PAIRS; ++ch) {
-           short pair = ch % COLOR_PAIRS;
-           init_pair(pair, COLOR_WHITE, ch % COLORS);
+           short pair = (short) (ch % COLOR_PAIRS);
+           init_pair(pair, COLOR_WHITE, (short) (ch % COLORS));
        }
     }
 
@@ -267,7 +267,7 @@ main(int argc, char *argv[])
        getyx(stdscr, y, x);
 
        while (!done) {
-           switch (ch = get_command(which, last)) {
+           switch (get_command(which, last)) {
            case 'n':
                setup_next();
                done = TRUE;
@@ -289,8 +289,8 @@ main(int argc, char *argv[])
                    }
                    ++which;
                    if (has_colors()) {
-                       short pair = which % COLOR_PAIRS;
-                       bkgd(COLOR_PAIR(pair));
+                       short pair = (short) (which % COLOR_PAIRS);
+                       bkgd((chtype) COLOR_PAIR(pair));
                    }
                } else {
                    beep();