]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/xmas.c
ncurses 5.5
[ncurses.git] / test / xmas.c
index d99b8219c3062bb37f2039cc3ad90e8242b81e6b..2ea08aef0307581faa49a2831b89064752561f00 100644 (file)
 /******************************************************************************/
 
 /*
- * $Id: xmas.c,v 1.15 2000/09/02 18:45:53 tom Exp $
+ * $Id: xmas.c,v 1.20 2005/04/16 16:34:38 tom Exp $
  */
 #include <test.priv.h>
 
-#include <signal.h>
-
 #define FROMWHO "Mark Hessling - (M.Hessling@gu.edu.au)"
 
 static int my_bg = COLOR_BLACK;
@@ -149,17 +147,16 @@ static int strng5(void);
 static int reindeer(void);
 static int blinkit(void);
 
-static RETSIGTYPE
-done(int sig) GCC_NORETURN;
+static RETSIGTYPE done(int sig) GCC_NORETURN;
 
-     static void
-       set_color(WINDOW *win, chtype color)
+static void
+set_color(WINDOW *win, chtype color)
 {
     if (has_colors()) {
        static bool *pairs;
        int n = (color + 1);
        if (pairs == 0)
-           pairs = (bool *) calloc(COLORS + 1, sizeof(bool));
+           pairs = (bool *) calloc((unsigned) (COLORS + 1), sizeof(bool));
        if (!pairs[n]) {
            init_pair(n, color, my_bg);
            pairs[n] = TRUE;
@@ -191,6 +188,8 @@ main(int argc GCC_UNUSED, char **argv GCC_UNUSED)
 {
     int loopy;
 
+    setlocale(LC_ALL, "");
+
     initscr();
     noecho();
     nonl();
@@ -1156,5 +1155,5 @@ done(int sig GCC_UNUSED)
     refresh();
     endwin();
     curs_set(1);
-    exit(EXIT_SUCCESS);
+    ExitProgram(EXIT_SUCCESS);
 }