X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fblue.c;h=cb088ee830d65e08caccc37f68174e1b764cf37f;hp=41b6f357d82820d3278ecb7ff5fc01596a848f34;hb=5d8dbcdd9423bf9821db414fd9ec792ccf1f1027;hpb=e2e9c09c48b19b24979cafb2d4864f538b5ddd1c diff --git a/test/blue.c b/test/blue.c index 41b6f357..cb088ee8 100644 --- a/test/blue.c +++ b/test/blue.c @@ -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.46 2016/09/05 00:24:27 tom Exp $ + * $Id: blue.c,v 1.49 2017/04/15 13:36:36 tom Exp $ */ #include @@ -196,7 +196,7 @@ deal_cards(void) static void printcard(int value) { - (void) addch(' '); + AddCh(' '); if (value == NOCARD) { (void) addstr(" "); } else { @@ -206,10 +206,14 @@ printcard(int value) ? 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)); + 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]; @@ -218,11 +222,15 @@ printcard(int value) addwstr(values); } #else - addch((chtype) suits[which]); + AddCh(suits[which]); #endif +#ifdef NCURSES_VERSION + (attroff) ((int) color); +#else attroff(color); +#endif } - (void) addch(' '); + AddCh(' '); } static void @@ -340,7 +348,7 @@ play_game(void) (void) addstr(buf); move(PROMPTROW, (int) strlen(buf)); clrtoeol(); - (void) addch(' '); + AddCh(' '); } while (((c = (char) getch()) < 'a' || c > 'd') && (c != 'r')