]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/test_add_wchstr.c
ncurses 5.7 - patch 20101113
[ncurses.git] / test / test_add_wchstr.c
index 7fa3f148fe16e1f7c437b8ac815122fb2597be63..3413a37b969782cd7ece067189ebef0620a1dc8a 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2009 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2009,2010 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: test_add_wchstr.c,v 1.7 2009/09/13 00:00:28 tom Exp $
+ * $Id: test_add_wchstr.c,v 1.9 2010/11/13 21:14:50 tom Exp $
  *
  * Demonstrate the waddwchstr() and wadd_wch functions.
  * Thomas Dickey - 2009/9/12
 #define WIDE_LINEDATA
 #include <linedata.h>
 
+#undef MvAddCh
+#undef MvAddStr
+#undef MvWAddCh
+#undef MvWAddStr
+
 /* definitions to make it simpler to compare with test_addstr.c */
 #define AddNStr    add_wchnstr
 #define AddStr     add_wchstr
-#define MvAddNStr  mvadd_wchnstr
-#define MvAddStr   mvadd_wchstr
-#define MvWAddNStr mvwadd_wchnstr
-#define MvWAddStr  mvwadd_wchstr
+#define MvAddNStr  (void) mvadd_wchnstr
+#define MvAddStr   (void) mvadd_wchstr
+#define MvWAddNStr (void) mvwadd_wchnstr
+#define MvWAddStr  (void) mvwadd_wchstr
 #define WAddNStr   wadd_wchnstr
 #define WAddStr    wadd_wchstr
 
@@ -184,7 +189,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();
@@ -296,14 +301,14 @@ test_add_wchstr(int level)
     keypad(work, TRUE);
 
     for (col = margin + 1; col < COLS; col += MY_TABSIZE)
-       mvwvline(work, row, col, '.', limit - 2);
+       MvWVLine(work, row, col, '.', limit - 2);
 
-    mvwvline(work, row, margin, ACS_VLINE, limit - 2);
-    mvwvline(work, row, margin + 1, ACS_VLINE, limit - 2);
+    MvWVLine(work, row, margin, ACS_VLINE, limit - 2);
+    MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2);
     limit /= 2;
 
-    mvwadd_wchstr(work, 1, 2, ChStr("String"));
-    mvwadd_wchstr(work, limit + 1, 2, ChStr("Chars"));
+    (void) mvwadd_wchstr(work, 1, 2, ChStr("String"));
+    (void) mvwadd_wchstr(work, limit + 1, 2, ChStr("Chars"));
     wnoutrefresh(work);
 
     buffer[length = 0] = '\0';
@@ -451,19 +456,19 @@ test_add_wchstr(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;
            }