]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/test_addwstr.c
ncurses 5.9 - patch 20111224
[ncurses.git] / test / test_addwstr.c
index 42db92e89b259e1d8ac68cb3ac7036b7fb39a0d5..7f5cc275365bbc3e66a9a6ee92af58a1e4fc9880 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_addwstr.c,v 1.3 2010/05/01 19:13:46 tom Exp $
+ * $Id: test_addwstr.c,v 1.7 2011/12/10 19:55:10 tom Exp $
  *
  * Demonstrate the waddwstr() and wadd_wch functions.
  * Thomas Dickey - 2009/9/12
@@ -79,7 +79,7 @@ static int n_opt = -1;
 static void
 legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length)
 {
-    NCURSES_CONST char *showstate;
+    const char *showstate;
 
     switch (state) {
     default:
@@ -101,7 +101,7 @@ legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length)
     wprintw(win,
            "The Strings/Chars displays should match.  Enter any characters, except:\n");
     wprintw(win,
-           "down-arrow or ^N to repeat on next line, 'w' for inner window, 'q' to exit.\n");
+           "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
     wclrtoeol(win);
     wprintw(win, "Level %d,%s inserted %d characters <", level,
            showstate, length);
@@ -151,7 +151,7 @@ ConvertCh(chtype source, cchar_t *target)
 {
     wchar_t tmp_wchar[2];
 
-    tmp_wchar[0] = source;
+    tmp_wchar[0] = (wchar_t) source;
     tmp_wchar[1] = 0;
     if (setcchar(target, tmp_wchar, A_NORMAL, 0, (void *) 0) == ERR) {
        beep();
@@ -233,8 +233,9 @@ test_inserts(int level)
     WINDOW *work = 0;
     WINDOW *show = 0;
     int margin = (2 * MY_TABSIZE) - 1;
-    Options option = ((m_opt ? oMove : oDefault)
-                     | ((w_opt || (level > 0)) ? oWindow : oDefault));
+    Options option = (Options) ((int) (m_opt ? oMove : oDefault)
+                               | (int) ((w_opt || (level > 0))
+                                        ? oWindow : oDefault));
 
     if (first) {
        static char cmd[80];
@@ -420,19 +421,19 @@ test_inserts(int level)
            switch (option) {
            case oDefault:
                if (move(limit + row, col) != ERR) {
-                   AddCh(ch);
+                   AddCh((chtype) ch);
                }
                break;
            case oMove:
-               MvAddCh(limit + row, col, ch);
+               MvAddCh(limit + row, col, (chtype) ch);
                break;
            case oWindow:
                if (wmove(work, limit + row, col) != ERR) {
-                   WAddCh(work, ch);
+                   WAddCh(work, (chtype) ch);
                }
                break;
            case oMoveWindow:
-               MvWAddCh(work, limit + row, col, ch);
+               MvWAddCh(work, limit + row, col, (chtype) ch);
                break;
            }