X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fblue.c;h=9c4108a41a6a6d51717bc4ab8c747bfc136914b1;hp=376a764b6d10d0214789bd8767ca4f283c977a7c;hb=12b49d3c56a6130feb2d39fbe2d6c1bc0838f0fa;hpb=dc690a36a0e53e2c2ecd99c971cd749f78275fdc diff --git a/test/blue.c b/test/blue.c index 376a764b..9c4108a4 100644 --- a/test/blue.c +++ b/test/blue.c @@ -36,7 +36,7 @@ *****************************************************************************/ /* - * $Id: blue.c,v 1.48 2017/01/22 00:39:52 tom Exp $ + * $Id: blue.c,v 1.51 2017/09/30 17:43:18 tom Exp $ */ #include @@ -196,18 +196,18 @@ deal_cards(void) static void printcard(int value) { - (void) addch(' '); + AddCh(' '); if (value == NOCARD) { (void) addstr(" "); } else { int which = (value / SUIT_LENGTH); int isuit = (value % SUIT_LENGTH); - attr_t color = (attr_t) COLOR_PAIR(((which % 2) == 0) + chtype color = (chtype) 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)); + AddCh(ranks[isuit][0] | (chtype) COLOR_PAIR(BLUE_ON_WHITE)); + AddCh(ranks[isuit][1] | (chtype) COLOR_PAIR(BLUE_ON_WHITE)); #ifdef NCURSES_VERSION (attron) ((int) color); /* quieter compiler warnings */ @@ -222,7 +222,7 @@ printcard(int value) addwstr(values); } #else - addch((chtype) suits[which]); + AddCh(suits[which]); #endif #ifdef NCURSES_VERSION (attroff) ((int) color); @@ -230,7 +230,7 @@ printcard(int value) attroff(color); #endif } - (void) addch(' '); + AddCh(' '); } static void @@ -348,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') @@ -467,13 +467,11 @@ use_pc_display(void) int main(int argc, char *argv[]) { - CATCHALL(die); - setlocale(LC_ALL, ""); use_pc_display(); - initscr(); + InitAndCatch(initscr(), die); start_color(); init_pair(RED_ON_WHITE, COLOR_RED, COLOR_WHITE);