]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/newdemo.c
ncurses 6.0 - patch 20151205
[ncurses.git] / test / newdemo.c
index 566fc47c6a6c756a1feec8c2a6b9cf1119bdc0f3..f9b6f82f6038099c042f88b03055bc4e8bb45bdc 100644 (file)
@@ -2,7 +2,7 @@
  *  newdemo.c  -       A demo program using PDCurses. The program illustrate
  *                     the use of colours for text output.
  *
- * $Id: newdemo.c,v 1.37 2012/11/17 23:27:50 tom Exp $
+ * $Id: newdemo.c,v 1.41 2014/08/02 23:10:56 tom Exp $
  */
 
 #include <test.priv.h>
@@ -47,7 +47,7 @@ static const char *messages[] =
 /*
  *  Trap interrupt
  */
-static RETSIGTYPE
+static void
 trap(int sig GCC_UNUSED)
 {
     endwin();
@@ -84,7 +84,7 @@ set_colors(WINDOW *win, int pair, int foreground, int background)
        if (pair > COLOR_PAIRS)
            pair = COLOR_PAIRS;
        init_pair((short) pair, (short) foreground, (short) background);
-       (void) wattrset(win, (int) COLOR_PAIR(pair));
+       (void) wattrset(win, AttrArg(COLOR_PAIR(pair), 0));
     }
 }
 
@@ -96,7 +96,7 @@ use_colors(WINDOW *win, int pair, chtype attrs)
            pair = COLOR_PAIRS;
        attrs |= (chtype) COLOR_PAIR(pair);
     }
-    (void) wattrset(win, (int) attrs);
+    (void) wattrset(win, AttrArg(attrs, 0));
     return attrs;
 }
 
@@ -222,7 +222,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 {
     WINDOW *win;
     int w, x, y, i, j, k;
-    char buffer[200];
+    char buffer[SIZEOF(messages) * 80];
     const char *message;
     int width, height;
     chtype save[80];