X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fsavescreen.c;h=111882d0b55888fb9f5fe6a1dee604f16fce6ea0;hp=b413f0dd71fc3fb23099f8c1961fe3911770d239;hb=952539d2f6aa5a3a29adc54488b0d3b66121c888;hpb=92e187a3459ab7ce1613a3684ca6642447c73620 diff --git a/test/savescreen.c b/test/savescreen.c index b413f0dd..111882d0 100644 --- a/test/savescreen.c +++ b/test/savescreen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2007-2010,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: savescreen.c,v 1.12 2010/05/01 22:04:08 tom Exp $ + * $Id: savescreen.c,v 1.15 2011/01/15 18:15:11 tom Exp $ * * Demonstrate save/restore functions from the curses library. * Thomas Dickey - 2007/7/14 @@ -34,6 +34,8 @@ #include +#if HAVE_SCR_DUMP + #include #include @@ -189,8 +191,8 @@ main(int argc, char *argv[]) if (has_colors()) { start_color(); for (ch = 0; ch < COLOR_PAIRS; ++ch) { - short pair = ch % COLOR_PAIRS; - init_pair(pair, COLOR_WHITE, ch % COLORS); + short pair = (short) (ch % COLOR_PAIRS); + init_pair(pair, COLOR_WHITE, (short) (ch % COLORS)); } } @@ -289,8 +291,8 @@ main(int argc, char *argv[]) } ++which; if (has_colors()) { - short pair = which % COLOR_PAIRS; - bkgd(COLOR_PAIR(pair)); + short pair = (short) (which % COLOR_PAIRS); + bkgd((chtype) COLOR_PAIR(pair)); } } else { beep(); @@ -330,3 +332,11 @@ main(int argc, char *argv[]) } ExitProgram(EXIT_SUCCESS); } +#else +int +main(int argc, char *argv[]) +{ + printf("This program requires the screen-dump functions\n"); + ExitProgram(EXIT_FAILURE); +} +#endif