]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/chgat.c
ncurses 6.0 - patch 20150808
[ncurses.git] / test / chgat.c
index bd30535c1b54bda4f10c4c7d9429c895c52f1408..919b5c9e3b98a2fcf6b0b9eff7b6bcdf1d95d6ab 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006-2008,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 2006-2010,2012 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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: chgat.c,v 1.9 2009/07/15 23:21:04 tom Exp $
+ * $Id: chgat.c,v 1.12 2012/11/18 01:55:35 tom Exp $
  *
  * test-driver for chgat/wchgat/mvchgat/mvwchgat
  */
@@ -47,7 +47,7 @@
 typedef struct {
     unsigned c;
     unsigned v;
-    int pair;
+    short pair;
     unsigned attr;
     int count;
     int ch;
@@ -60,12 +60,12 @@ typedef struct {
 } STATUS;
 
 static const char *
-color_params(unsigned state, int *pair)
+color_params(unsigned state, short *pair)
 {
     /* *INDENT-OFF* */
     static struct {
-       int pair;
-       int fg, bg;
+       short pair;
+       short fg, bg;
        const char *msg;
     } table[] = {
        { 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" },
@@ -176,6 +176,8 @@ do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *))
        delwin(win1);
        touchwin(win);
     } else {
+       if (win1 != 0)
+           delwin(win1);
        beep();
     }
 }
@@ -221,7 +223,7 @@ show_help(WINDOW *win)
 
     getmaxyx(win, y_max, x_max);
     for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) {
-       mvwprintw(win, row, 0, "%.*s", x_max, table[row]);
+       MvWPrintw(win, row, 0, "%.*s", x_max, table[row]);
     }
     while (wgetch(win) != 'q')
        beep();