X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Ftest_get_wstr.c;h=dc01b0e69c07b325a056ce81047cfc53a5abfb6e;hp=49adda5e2a08623bd557c04c82caf37ac8b8f105;hb=687aeec3e382083652c3bb2e94fb6d3bf101a1f9;hpb=772f879d17117c5b766022f28099e341ebea825b diff --git a/test/test_get_wstr.c b/test/test_get_wstr.c index 49adda5e..dc01b0e6 100644 --- a/test/test_get_wstr.c +++ b/test/test_get_wstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007 Free Software Foundation, Inc. * + * Copyright (c) 2007-2009,2011 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_get_wstr.c,v 1.3 2007/07/21 22:47:21 tom Exp $ + * $Id: test_get_wstr.c,v 1.8 2011/01/15 18:15:11 tom Exp $ * * Author: Thomas E Dickey * @@ -44,6 +44,9 @@ #include +#if HAVE_CHGAT +/* NetBSD curses wchgat */ + #if USE_WIDEC_SUPPORT #define BASE_Y 6 @@ -89,9 +92,9 @@ MovePrompt(WINDOW *txtwin, int limit, int y, int x) } static int -ShowFlavor(WINDOW *strwin, WINDOW *txtwin, Flavors flavor, int limit) +ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit) { - char *name = "?"; + const char *name = "?"; bool limited = FALSE; bool wins = (txtwin != stdscr); int result; @@ -269,7 +272,7 @@ test_get_wstr(int level, char **argv, WINDOW *strwin) *buffer = '\0'; rc = ERR; echo(); - wattrset(txtwin, A_REVERSE); + (void) wattrset(txtwin, A_REVERSE); switch (flavor) { case eGetStr: if (txtwin != stdscr) { @@ -307,9 +310,9 @@ test_get_wstr(int level, char **argv, WINDOW *strwin) break; } noecho(); - wattrset(txtwin, A_NORMAL); + (void) wattrset(txtwin, A_NORMAL); wprintw(strwin, "%d", rc); - waddwstr(strwin, (wchar_t *) buffer); + (void) waddwstr(strwin, (wchar_t *) buffer); wnoutrefresh(strwin); break; default: @@ -359,3 +362,11 @@ main(void) ExitProgram(EXIT_FAILURE); } #endif +#else +int +main(void) +{ + printf("This program requires the curses chgat function\n"); + ExitProgram(EXIT_FAILURE); +} +#endif