]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/blue.c
ncurses 6.0 - patch 20170225
[ncurses.git] / test / blue.c
index 5402c4f9ef1b35c419e39fbd5e114574ffc9786e..376a764b6d10d0214789bd8767ca4f283c977a7c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2016,2017 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            *
@@ -36,7 +36,7 @@
  *****************************************************************************/
 
 /*
- * $Id: blue.c,v 1.45 2016/06/12 00:17:37 tom Exp $
+ * $Id: blue.c,v 1.48 2017/01/22 00:39:52 tom Exp $
  */
 
 #include <test.priv.h>
@@ -209,7 +209,11 @@ printcard(int value)
        addch(ranks[isuit][0] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
        addch(ranks[isuit][1] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
 
-       attron(color);
+#ifdef NCURSES_VERSION
+       (attron) ((int) color); /* quieter compiler warnings */
+#else
+       attron(color);          /* PDCurses, etc., either no macro or wrong */
+#endif
 #if USE_WIDEC_SUPPORT
        {
            wchar_t values[2];
@@ -220,7 +224,11 @@ printcard(int value)
 #else
        addch((chtype) suits[which]);
 #endif
+#ifdef NCURSES_VERSION
+       (attroff) ((int) color);
+#else
        attroff(color);
+#endif
     }
     (void) addch(' ');
 }
@@ -331,9 +339,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);