]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/blue.c
ncurses 6.0 - patch 20160910
[ncurses.git] / test / blue.c
index 45fce074d3c2fe68e42113141d156937a7ea7e7c..41b6f357d82820d3278ecb7ff5fc01596a848f34 100644 (file)
@@ -36,7 +36,7 @@
  *****************************************************************************/
 
 /*
- * $Id: blue.c,v 1.42 2016/04/09 23:55:52 tom Exp $
+ * $Id: blue.c,v 1.46 2016/09/05 00:24:27 tom Exp $
  */
 
 #include <test.priv.h>
@@ -105,7 +105,7 @@ static int letters[4] =
     'c',                       /* clubs */
 };
 
-#ifdef HAVE_LANGINFO_CODESET
+#if HAVE_LANGINFO_CODESET
 
 #if HAVE_TIGETSTR
 static int glyphs[] =
@@ -202,14 +202,14 @@ printcard(int value)
     } else {
        int which = (value / SUIT_LENGTH);
        int isuit = (value % SUIT_LENGTH);
-       attr_t color = COLOR_PAIR(((which % 2) == 0)
-                                 ? RED_ON_WHITE
-                                 : BLACK_ON_WHITE);
+       attr_t color = (attr_t) COLOR_PAIR(((which % 2) == 0)
+                                          ? RED_ON_WHITE
+                                          : BLACK_ON_WHITE);
 
        addch(ranks[isuit][0] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
        addch(ranks[isuit][1] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
 
-       attr_on(color, NULL);
+       attron(color);
 #if USE_WIDEC_SUPPORT
        {
            wchar_t values[2];
@@ -220,7 +220,7 @@ printcard(int value)
 #else
        addch((chtype) suits[which]);
 #endif
-       attr_off(color, NULL);
+       attroff(color);
     }
     (void) addch(' ');
 }
@@ -331,9 +331,9 @@ play_game(void)
            } else {
                char buf[BUFSIZ];
 
-               (void) sprintf(buf,
-                              "Type [%s] to move, r to redraw, q or INTR to quit: ",
-                              live);
+               _nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
+                           "Type [%s] to move, r to redraw, q or INTR to quit: ",
+                           live);
 
                do {
                    move(PROMPTROW, 0);