]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/picsmap.c
ncurses 6.0 - patch 20170930
[ncurses.git] / test / picsmap.c
index 196cf44692156c7ddf44637e137bb9021bb78b2b..47a9388bdada24eccf1fc31894522267afb446e6 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: picsmap.c,v 1.100 2017/08/19 23:42:27 tom Exp $
+ * $Id: picsmap.c,v 1.103 2017/09/06 09:21:38 tom Exp $
  *
  * Author: Thomas E. Dickey
  *
@@ -49,7 +49,6 @@
  */
 #include <test.priv.h>
 
-#include <stdarg.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -659,12 +658,16 @@ init_palette(const char *palette_file)
        all_colors = typeMalloc(RGB_DATA, (unsigned) COLORS);
        how_much.data += (sizeof(RGB_DATA) * (unsigned) COLORS);
 
+#if HAVE_COLOR_CONTENT
        for (cp = 0; cp < COLORS; ++cp) {
            color_content((short) cp,
                          &all_colors[cp].red,
                          &all_colors[cp].green,
                          &all_colors[cp].blue);
        }
+#else
+       memset(all_colors, 0, sizeof(RGB_DATA) * (size_t) COLORS);
+#endif
        if (data != 0) {
            int n;
            int red, green, blue;
@@ -1470,7 +1473,7 @@ show_picture(PICS_HEAD * pics)
     debugmsg("called show_picture");
 #if USE_EXTENDED_COLORS
     reset_color_pairs();
-#else
+#elif HAVE_CURSCR
     wclear(curscr);
     clear();
 #endif
@@ -1528,7 +1531,8 @@ show_picture(PICS_HEAD * pics)
 #endif
        }
     } else {
-       mvgetch(0, 0);
+       wmove(stdscr, 0, 0);
+       getch();
     }
     if (!quiet)
        endwin();
@@ -1698,7 +1702,7 @@ main(int argc, char *argv[])
                init_palette(palette_path);
            }
            scrollok(stdscr, FALSE);
-           endwin();
+           exit_curses();
        }
        if (optind >= argc)
            giveup("expected at least one image filename");