From: Thomas E. Dickey Date: Sun, 29 Sep 2013 01:03:55 +0000 (+0000) Subject: ncurses 5.9 - patch 20130928 X-Git-Tag: v6.0~88 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=e2dee48666d83c609f7ecced6203ecfdc94e36aa ncurses 5.9 - patch 20130928 + some build-fixes for ncurses-examples with NetBSD-6.0 curses, though it lacks some common functions such as use_env() which is not yet addressed. + build-fix and some compiler warning fixes for ncurses-examples with OpenBSD 5.3 + fix a possible null-pointer reference in a trace message from newterm. + quiet a few warnings from NetBSD 6.0 namespace pollution by nonstandard popcount() function in standard strings.h header. + ignore g++ 4.2.1 warnings for "-Weffc++" in c++/cursesmain.cc + fix a few overlooked places for --enable-string-hacks option. --- diff --git a/NEWS b/NEWS index 35342b53..e114d40c 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.2104 2013/09/21 20:41:37 tom Exp $ +-- $Id: NEWS,v 1.2109 2013/09/28 22:55:29 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,18 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20130928 + + some build-fixes for ncurses-examples with NetBSD-6.0 curses, though + it lacks some common functions such as use_env() which is not yet + addressed. + + build-fix and some compiler warning fixes for ncurses-examples with + OpenBSD 5.3 + + fix a possible null-pointer reference in a trace message from newterm. + + quiet a few warnings from NetBSD 6.0 namespace pollution by + nonstandard popcount() function in standard strings.h header. + + ignore g++ 4.2.1 warnings for "-Weffc++" in c++/cursesmain.cc + + fix a few overlooked places for --enable-string-hacks option. + 20130921 + fix typo in curs_attr.3x (patch by Sven Joachim, cf: 20130831). + build-fix for --with-shared option for DragonFly and FreeBSD (report diff --git a/c++/cursesmain.cc b/c++/cursesmain.cc index 1f82d4ad..e8709950 100644 --- a/c++/cursesmain.cc +++ b/c++/cursesmain.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2013 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 * @@ -35,13 +35,15 @@ #include "cursesapp.h" #if CPP_HAS_TRY_CATCH && HAVE_IOSTREAM +#pragma GCC diagnostic ignored "-Weffc++" #include +#pragma GCC diagnostic warning "-Weffc++" #else #undef CPP_HAS_TRY_CATCH #define CPP_HAS_TRY_CATCH 0 #endif -MODULE_ID("$Id: cursesmain.cc,v 1.14 2007/04/07 17:10:11 tom Exp $") +MODULE_ID("$Id: cursesmain.cc,v 1.15 2013/09/28 20:56:47 tom Exp $") #if HAVE_LOCALE_H #include diff --git a/dist.mk b/dist.mk index 72ec539b..2cd3e99c 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.945 2013/09/21 15:25:41 tom Exp $ +# $Id: dist.mk,v 1.946 2013/09/28 17:24:42 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 NCURSES_MINOR = 9 -NCURSES_PATCH = 20130921 +NCURSES_PATCH = 20130928 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/ncurses/base/lib_newterm.c b/ncurses/base/lib_newterm.c index 93d84323..435763d0 100644 --- a/ncurses/base/lib_newterm.c +++ b/ncurses/base/lib_newterm.c @@ -48,7 +48,7 @@ #include -MODULE_ID("$Id: lib_newterm.c,v 1.89 2013/08/31 14:56:50 tom Exp $") +MODULE_ID("$Id: lib_newterm.c,v 1.90 2013/09/28 21:02:56 tom Exp $") #ifdef USE_TERM_DRIVER #define NumLabels InfoOf(SP_PARM).numlabels @@ -181,7 +181,7 @@ NCURSES_SP_NAME(newterm) (NCURSES_SP_DCLx START_TRACE(); T((T_CALLED("newterm(%p, \"%s\", %p,%p)"), (void *) SP_PARM, - name, + (name ? name : ""), (void *) ofp, (void *) ifp)); diff --git a/ncurses/tinfo/getenv_num.c b/ncurses/tinfo/getenv_num.c index 62f3d4d4..80a349a1 100644 --- a/ncurses/tinfo/getenv_num.c +++ b/ncurses/tinfo/getenv_num.c @@ -36,7 +36,7 @@ #include -MODULE_ID("$Id: getenv_num.c,v 1.4 2012/07/14 21:17:19 tom Exp $") +MODULE_ID("$Id: getenv_num.c,v 1.5 2013/09/28 20:25:08 tom Exp $") NCURSES_EXPORT(int) _nc_getenv_num(const char *name) @@ -61,11 +61,11 @@ _nc_setenv_num(const char *name, int value) if (name != 0 && value >= 0) { char buffer[128]; #if HAVE_SETENV - sprintf(buffer, "%d", value); + _nc_SPRINTF(buffer, _nc_SLIMIT(sizeof(buffer)) "%d", value); setenv(name, buffer, 1); #elif HAVE_PUTENV char *s; - sprintf(buffer, "%s=%d", name, value); + _nc_SPRINTF(buffer, _nc_SLIMIT(sizeof(buffer)) "%s=%d", name, value); if ((s = strdup(buffer)) != 0) putenv(s); #endif diff --git a/ncurses/tinfo/lib_tparm.c b/ncurses/tinfo/lib_tparm.c index 18b6de07..7e5b3f2a 100644 --- a/ncurses/tinfo/lib_tparm.c +++ b/ncurses/tinfo/lib_tparm.c @@ -42,7 +42,7 @@ #include #include -MODULE_ID("$Id: lib_tparm.c,v 1.88 2013/01/26 17:07:05 tom Exp $") +MODULE_ID("$Id: lib_tparm.c,v 1.89 2013/09/28 20:46:56 tom Exp $") /* * char * @@ -107,6 +107,7 @@ MODULE_ID("$Id: lib_tparm.c,v 1.88 2013/01/26 17:07:05 tom Exp $") NCURSES_EXPORT_VAR(int) _nc_tparm_err = 0; #define TPS(var) _nc_prescreen.tparm_state.var +#define popcount _nc_popcount /* workaround for NetBSD 6.0 defect */ #if NO_LEAKS NCURSES_EXPORT(void) diff --git a/ncurses/tinfo/make_hash.c b/ncurses/tinfo/make_hash.c index 31f21005..37ac7651 100644 --- a/ncurses/tinfo/make_hash.c +++ b/ncurses/tinfo/make_hash.c @@ -44,7 +44,7 @@ #include -MODULE_ID("$Id: make_hash.c,v 1.12 2013/02/16 21:27:50 tom Exp $") +MODULE_ID("$Id: make_hash.c,v 1.13 2013/09/28 20:55:47 tom Exp $") /* * _nc_make_hash_table() @@ -69,10 +69,11 @@ failed(const char *s) static char * strmalloc(char *s) { - char *result = malloc(strlen(s) + 1); + size_t need = strlen(s) + 1; + char *result = malloc(need); if (result == 0) - failed("strmalloc"); - strcpy(result, s); + failed("strmalloc"); + _nc_STRCPY(result, s, need); return result; } diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index f7ae96fb..931a0b6a 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -47,7 +47,7 @@ #define TRACE_OUT(p) /*nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.88 2013/07/27 15:52:18 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.89 2013/09/28 20:20:30 tom Exp $") static int total_written; @@ -273,7 +273,7 @@ _nc_write_entry(TERMTYPE *const tp) char name_list[MAX_TERMINFO_LENGTH]; char *first_name, *other_names; char *ptr; - const char *term_names = tp->term_names; + char *term_names = tp->term_names; size_t name_size = strlen(term_names); if (name_size == 0) { diff --git a/package/debian/changelog b/package/debian/changelog index 7fffcb81..558ebdda 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20130921) unstable; urgency=low +ncurses6 (5.9-20130928) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 21 Sep 2013 11:25:41 -0400 + -- Thomas E. Dickey Sat, 28 Sep 2013 13:24:42 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index a663f722..06ec8400 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Release: 5.9 -Version: 20130921 +Version: 20130928 License: X11 Group: Development/Libraries Source: ncurses-%{release}-%{version}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 6e7865f6..1c8c2c71 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Release: 5.9 -Version: 20130921 +Version: 20130928 License: X11 Group: Development/Libraries Source: ncurses-%{release}-%{version}.tgz diff --git a/progs/tput.c b/progs/tput.c index d29ed0a7..6652d345 100644 --- a/progs/tput.c +++ b/progs/tput.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2013 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 * @@ -47,7 +47,7 @@ #endif #include -MODULE_ID("$Id: tput.c,v 1.48 2012/02/18 21:51:17 tom Exp $") +MODULE_ID("$Id: tput.c,v 1.49 2013/09/28 20:57:25 tom Exp $") #define PUTS(s) fputs(s, stdout) #define PUTCHAR(c) putchar(c) @@ -303,7 +303,7 @@ tput(int argc, char *argv[]) } else if (s != ABSENT_STRING) { if (argc > 1) { int k; - int popcount; + int ignored; long numbers[1 + NUM_PARM]; char *strings[1 + NUM_PARM]; char *p_is_s[NUM_PARM]; @@ -334,7 +334,7 @@ tput(int argc, char *argv[]) break; case Numbers: default: - (void) _nc_tparm_analyze(s, p_is_s, &popcount); + (void) _nc_tparm_analyze(s, p_is_s, &ignored); #define myParam(n) (p_is_s[n - 1] != 0 ? ((TPARM_ARG) strings[n]) : numbers[n]) s = TPARM_9(s, myParam(1), diff --git a/test/cardfile.c b/test/cardfile.c index ef224c9b..b7502414 100644 --- a/test/cardfile.c +++ b/test/cardfile.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 1999-2012,2013 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 * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: cardfile.c,v 1.41 2012/11/03 19:26:50 tom Exp $ + * $Id: cardfile.c,v 1.42 2013/09/28 22:02:17 tom Exp $ * * File format: text beginning in column 1 is a title; other text is content. */ @@ -107,7 +107,7 @@ add_title(const char *title) break; } - card = typeCalloc(CARD, 1); + card = typeCalloc(CARD, (size_t) 1); card->title = strdup(title); card->content = strdup(""); @@ -335,7 +335,7 @@ form_virtualize(WINDOW *w) static FIELD ** make_fields(CARD * p, int form_high, int form_wide) { - FIELD **f = typeCalloc(FIELD *, 3); + FIELD **f = typeCalloc(FIELD *, (size_t) 3); f[0] = new_field(1, form_wide, 0, 0, 0, 0); set_field_back(f[0], A_REVERSE); diff --git a/test/demo_defkey.c b/test/demo_defkey.c index 03c4d622..045c2c7b 100644 --- a/test/demo_defkey.c +++ b/test/demo_defkey.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2008,2012 Free Software Foundation, Inc. * + * Copyright (c) 2002-2012,2013 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: demo_defkey.c,v 1.21 2012/12/29 22:55:39 tom Exp $ + * $Id: demo_defkey.c,v 1.22 2013/09/28 22:02:17 tom Exp $ * * Demonstrate the define_key() function. * Thomas Dickey - 2002/11/23 @@ -116,7 +116,7 @@ visible(const char *string) result = typeCalloc(char, need); } } else { - result = typeCalloc(char, 1); + result = typeCalloc(char, (size_t) 1); } return result; } @@ -186,9 +186,9 @@ duplicate(WINDOW *win, NCURSES_CONST char *name, int code) const char *prefix = 0; char temp[BUFSIZ]; - if (!strncmp(value, "\033[", 2)) { + if (!strncmp(value, "\033[", (size_t) 2)) { prefix = "\033O"; - } else if (!strncmp(value, "\033O", 2)) { + } else if (!strncmp(value, "\033O", (size_t) 2)) { prefix = "\033["; } if (prefix != 0) { diff --git a/test/demo_forms.c b/test/demo_forms.c index 585ddb90..1e6806d2 100644 --- a/test/demo_forms.c +++ b/test/demo_forms.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: demo_forms.c,v 1.45 2013/09/21 22:51:50 tom Exp $ + * $Id: demo_forms.c,v 1.46 2013/09/28 21:55:54 tom Exp $ * * Demonstrate a variety of functions from the form library. * Thomas Dickey - 2003/4/26 @@ -139,7 +139,7 @@ read_data(const char *filename) int more = 0; int item = 0; - my_data = typeCalloc(MY_DATA, 100); /* FIXME */ + my_data = typeCalloc(MY_DATA, (size_t) 100); /* FIXME */ while (fgets(buffer, sizeof(buffer), fp) != 0) { chomp(buffer); if (more) { diff --git a/test/demo_menus.c b/test/demo_menus.c index b225e33d..c742223f 100644 --- a/test/demo_menus.c +++ b/test/demo_menus.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: demo_menus.c,v 1.51 2013/09/07 16:20:08 tom Exp $ + * $Id: demo_menus.c,v 1.52 2013/09/28 21:55:02 tom Exp $ * * Demonstrate a variety of functions from the menu library. * Thomas Dickey - 2005/4/9 @@ -407,7 +407,7 @@ build_select_menu(MenuNo number, char *filename) MENU_DATA *ap = 0; MENU_DATA *myList = 0; int i; - unsigned count = 0; + size_t count = 0; if (filename != 0) { struct stat sb; diff --git a/test/demo_terminfo.c b/test/demo_terminfo.c index aea32898..239739a4 100644 --- a/test/demo_terminfo.c +++ b/test/demo_terminfo.c @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: demo_terminfo.c,v 1.18 2013/09/07 17:37:20 tom Exp $ + * $Id: demo_terminfo.c,v 1.19 2013/09/28 21:50:01 tom Exp $ * * A simple demo of the terminfo interface. */ @@ -37,7 +37,12 @@ #include #if NCURSES_XNAMES +#if HAVE_TERM_ENTRY_H #include +#else +#undef NCURSES_XNAMES +#define NCURSES_XNAMES 0 +#endif #endif #if HAVE_TIGETSTR diff --git a/test/dots.c b/test/dots.c index 22d81713..474d8805 100644 --- a/test/dots.c +++ b/test/dots.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1999-2011,2013 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 * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey 1999 * - * $Id: dots.c,v 1.23 2011/04/23 19:15:04 tom Exp $ + * $Id: dots.c,v 1.25 2013/09/28 22:12:09 tom Exp $ * * A simple demo of the terminfo interface. */ @@ -53,7 +53,7 @@ TPUTS_PROTO(outc, c) if (interrupted) { char tmp = (char) c; - if (write(STDOUT_FILENO, &tmp, 1) == -1) + if (write(STDOUT_FILENO, &tmp, (size_t) 1) == -1) rc = EOF; } else { rc = putc(c, stdout); @@ -62,7 +62,7 @@ TPUTS_PROTO(outc, c) } static bool -outs(char *s) +outs(const char *s) { if (valid(s)) { tputs(s, 1, outc); @@ -105,6 +105,7 @@ main(int argc GCC_UNUSED, int x, y, z, p; double r; double c; + int my_colors; CATCHALL(onsig); @@ -112,11 +113,12 @@ main(int argc GCC_UNUSED, setupterm((char *) 0, 1, (int *) 0); outs(clear_screen); outs(cursor_invisible); - if (max_colors > 1) { + my_colors = max_colors; + if (my_colors > 1) { if (!valid(set_a_foreground) || !valid(set_a_background) || (!valid(orig_colors) && !valid(orig_pair))) - max_colors = -1; + my_colors = -1; } r = (double) (lines - 4); @@ -129,8 +131,8 @@ main(int argc GCC_UNUSED, p = (ranf() > 0.9) ? '*' : ' '; tputs(tparm3(cursor_address, y, x), 1, outc); - if (max_colors > 0) { - z = (int) (ranf() * max_colors); + if (my_colors > 0) { + z = (int) (ranf() * my_colors); if (ranf() > 0.01) { tputs(tparm2(set_a_foreground, z), 1, outc); } else { diff --git a/test/dots_mvcur.c b/test/dots_mvcur.c index 75242272..90b9c4e5 100644 --- a/test/dots_mvcur.c +++ b/test/dots_mvcur.c @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey - 2007 * - * $Id: dots_mvcur.c,v 1.8 2013/05/25 22:58:22 tom Exp $ + * $Id: dots_mvcur.c,v 1.10 2013/09/28 22:44:18 tom Exp $ * * A simple demo of the terminfo interface, and mvcur. */ @@ -53,7 +53,7 @@ TPUTS_PROTO(outc, c) if (interrupted) { char tmp = (char) c; - if (write(STDOUT_FILENO, &tmp, 1) == -1) + if (write(STDOUT_FILENO, &tmp, (size_t) 1) == -1) rc = EOF; } else { if (putc(c, stdout) == EOF) @@ -63,7 +63,7 @@ TPUTS_PROTO(outc, c) } static bool -outs(char *s) +outs(const char *s) { if (valid(s)) { tputs(s, 1, outc); @@ -108,6 +108,7 @@ main(int argc GCC_UNUSED, double r; double c; SCREEN *sp; + int my_colors; CATCHALL(onsig); @@ -116,11 +117,12 @@ main(int argc GCC_UNUSED, outs(clear_screen); outs(cursor_home); outs(cursor_invisible); - if (max_colors > 1) { + my_colors = max_colors; + if (my_colors > 1) { if (!valid(set_a_foreground) || !valid(set_a_background) || (!valid(orig_colors) && !valid(orig_pair))) - max_colors = -1; + my_colors = -1; } r = (double) (lines - 4); @@ -137,8 +139,8 @@ main(int argc GCC_UNUSED, y0 = y; } - if (max_colors > 0) { - z = (int) (ranf() * max_colors); + if (my_colors > 0) { + z = (int) (ranf() * my_colors); if (ranf() > 0.01) { tputs(tparm2(set_a_foreground, z), 1, outc); } else { diff --git a/test/dots_termcap.c b/test/dots_termcap.c index c8cbf768..4c1d62d9 100644 --- a/test/dots_termcap.c +++ b/test/dots_termcap.c @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: dots_termcap.c,v 1.6 2013/09/07 23:12:30 Ray.Donnelly Exp $ + * $Id: dots_termcap.c,v 1.7 2013/09/28 21:50:35 tom Exp $ * * A simple demo of the termcap interface. */ @@ -105,7 +105,7 @@ TPUTS_PROTO(outc, c) if (interrupted) { char tmp = (char) c; - if (write(STDOUT_FILENO, &tmp, 1) == -1) + if (write(STDOUT_FILENO, &tmp, (size_t) 1) == -1) rc = EOF; } else { rc = putc(c, stdout); diff --git a/test/edit_field.c b/test/edit_field.c index 7b83bd2a..506d08ae 100644 --- a/test/edit_field.c +++ b/test/edit_field.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2003-2008,2011 Free Software Foundation, Inc. * + * Copyright (c) 2003-2011,2013 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: edit_field.c,v 1.21 2013/06/08 21:38:12 tom Exp $ + * $Id: edit_field.c,v 1.22 2013/09/28 22:02:17 tom Exp $ * * A wrapper for form_driver() which keeps track of the user's editing changes * for each field, and makes the resulting length available as a @@ -329,7 +329,7 @@ init_edit_field(FIELD * f, char *value) if (ptr == 0) { int rows, cols, frow, fcol, nrow, nbuf; - ptr = typeCalloc(FieldAttrs, 1); + ptr = typeCalloc(FieldAttrs, (size_t) 1); ptr->background = field_back(f); if (field_info(f, &rows, &cols, &frow, &fcol, &nrow, &nbuf) == E_OK) { ptr->row_count = nrow; diff --git a/test/gdc.c b/test/gdc.c index 9d88f5eb..a74cd0df 100644 --- a/test/gdc.c +++ b/test/gdc.c @@ -33,7 +33,7 @@ * modified 10-18-89 for curses (jrl) * 10-18-89 added signal handling * - * $Id: gdc.c,v 1.37 2013/04/27 19:50:17 tom Exp $ + * $Id: gdc.c,v 1.38 2013/09/28 21:58:32 tom Exp $ */ #include @@ -293,7 +293,7 @@ main(int argc, char *argv[]) } /* this depends on the detailed format of ctime(3) */ - (void) strncpy(buf, ctime(&now), 30); + (void) strncpy(buf, ctime(&now), (size_t) 30); (void) strcpy(buf + 10, buf + 19); MvAddStr(16, 30, buf); diff --git a/test/hanoi.c b/test/hanoi.c index 4e4e7051..2262a520 100644 --- a/test/hanoi.c +++ b/test/hanoi.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2013 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 * @@ -41,7 +41,7 @@ * * Date: 05.Nov.90 * - * $Id: hanoi.c,v 1.34 2012/12/08 16:41:56 tom Exp $ + * $Id: hanoi.c,v 1.35 2013/09/28 22:02:17 tom Exp $ */ #include @@ -231,7 +231,7 @@ DisplayTiles(void) erase(); MvAddStr(1, 24, "T O W E R S O F H A N O I"); MvAddStr(3, 34, "SJR 1990"); - MvPrintw(19, 5, "Moves : %d of %.0f", NMoves, pow(2.0, NTiles) - 1); + MvPrintw(19, 5, "Moves : %d of %.0f", NMoves, pow(2.0, (float) NTiles) - 1); (void) attrset(A_REVERSE); MvAddStr(BASELINE, 8, " "); diff --git a/test/ncurses.c b/test/ncurses.c index 78afb459..403cad1b 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -40,7 +40,7 @@ AUTHOR Author: Eric S. Raymond 1993 Thomas E. Dickey (beginning revision 1.27 in 1996). -$Id: ncurses.c,v 1.393 2013/09/07 19:17:48 tom Exp $ +$Id: ncurses.c,v 1.394 2013/09/28 21:58:37 tom Exp $ ***************************************************************************/ @@ -2851,7 +2851,7 @@ slk_test(void) MvAddStr(SLK_WORK, 0, "Please enter the label value: "); strcpy(buf, ""); if ((s = slk_label(c - '0')) != 0) { - strncpy(buf, s, 8); + strncpy(buf, s, (size_t) 8); } wGetstring(stdscr, buf, 8); slk_set((c - '0'), buf, fmt); @@ -4348,7 +4348,7 @@ acs_and_scroll(void) transient((FRAME *) 0, (char *) 0); switch (c) { case CTRL('C'): - if ((neww = typeCalloc(FRAME, 1)) == 0) { + if ((neww = typeCalloc(FRAME, (size_t) 1)) == 0) { failed("acs_and_scroll"); goto breakout; } @@ -4430,7 +4430,7 @@ acs_and_scroll(void) if ((fp = fopen(DUMPFILE, "r")) == (FILE *) 0) { transient(current, "Can't open screen dump file"); } else { - if ((neww = typeCalloc(FRAME, 1)) != 0) { + if ((neww = typeCalloc(FRAME, (size_t) 1)) != 0) { neww->next = current ? current->next : 0; neww->last = current; @@ -6792,7 +6792,7 @@ main_menu(bool top) command = 0; for (;;) { char ch = '\0'; - if (read(fileno(stdin), &ch, 1) <= 0) { + if (read(fileno(stdin), &ch, (size_t) 1) <= 0) { if (command == 0) command = 'q'; break; diff --git a/test/railroad.c b/test/railroad.c index dca2f914..33dc46f1 100644 --- a/test/railroad.c +++ b/test/railroad.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2000-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 2000-2011,2013 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 * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey - 2000 * - * $Id: railroad.c,v 1.20 2011/04/23 19:15:04 tom Exp $ + * $Id: railroad.c,v 1.21 2013/09/28 22:02:17 tom Exp $ * * A simple demo of the termcap interface. */ @@ -62,7 +62,7 @@ TPUTS_PROTO(outc, c) if (interrupted) { char tmp = (char) c; - if (write(STDOUT_FILENO, &tmp, 1) == -1) + if (write(STDOUT_FILENO, &tmp, (size_t) 1) == -1) rc = ERR; } else { if (putc(c, stdout) == EOF) diff --git a/test/tclock.c b/test/tclock.c index 1c047090..24f33827 100644 --- a/test/tclock.c +++ b/test/tclock.c @@ -1,4 +1,4 @@ -/* $Id: tclock.c,v 1.32 2013/09/07 23:12:30 Ray.Donnelly Exp $ */ +/* $Id: tclock.c,v 1.33 2013/09/28 21:52:34 tom Exp $ */ #include @@ -53,14 +53,14 @@ /* Plot a point */ static void -plot(int x, int y, char col) +plot(int x, int y, int col) { MvAddCh(y, x, (chtype) col); } /* Draw a diagonal(arbitrary) line using Bresenham's alogrithm. */ static void -dline(int pair, int from_x, int from_y, int x2, int y2, char ch) +dline(int pair, int from_x, int from_y, int x2, int y2, int ch) { int dx, dy; int ax, ay; diff --git a/test/test.priv.h b/test/test.priv.h index ee3aced0..9640f6cc 100644 --- a/test/test.priv.h +++ b/test/test.priv.h @@ -29,7 +29,7 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: test.priv.h,v 1.119 2013/09/07 18:49:43 tom Exp $ */ +/* $Id: test.priv.h,v 1.121 2013/09/28 22:43:22 tom Exp $ */ #ifndef __TEST_PRIV_H #define __TEST_PRIV_H 1 @@ -162,6 +162,10 @@ #define HAVE_RIPOFFLINE 0 #endif +#ifndef HAVE_SCR_DUMP +#define HAVE_SCR_DUMP 0 +#endif + #ifndef HAVE_SETUPTERM #define HAVE_SETUPTERM 0 #endif @@ -194,6 +198,10 @@ #define HAVE_TERMNAME 0 #endif +#ifndef HAVE_TERM_ENTRY_H +#define HAVE_TERM_ENTRY_H 0 +#endif + #ifndef HAVE_TGETENT #define HAVE_TGETENT 0 #endif @@ -611,7 +619,8 @@ extern char *strnames[], *strcodes[], *strfnames[]; * So far (2013 - more than ten years), only ncurses implements * use_extended_names(). */ -#if defined(NCURSES_VERSION) && defined(HAVE_TERM_ENTRY_H) && HAVE_TERM_ENTRY_H +#if defined(NCURSES_XNAMES) +#elif defined(NCURSES_VERSION) && defined(HAVE_TERM_ENTRY_H) && HAVE_TERM_ENTRY_H #define NCURSES_XNAMES 1 #else #define NCURSES_XNAMES 0 diff --git a/test/test_vid_puts.c b/test/test_vid_puts.c index 3a2bc82f..6c8bc36a 100644 --- a/test/test_vid_puts.c +++ b/test/test_vid_puts.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_vid_puts.c,v 1.4 2013/01/13 01:04:14 tom Exp $ + * $Id: test_vid_puts.c,v 1.5 2013/09/28 22:42:29 tom Exp $ * * Demonstrate the vid_puts and vid_attr functions. * Thomas Dickey - 2013/01/12 @@ -52,7 +52,7 @@ TPUTS_PROTO(outc, c) } static bool -outs(char *s) +outs(const char *s) { if (valid(s)) { tputs(s, 1, outc); diff --git a/test/test_vidputs.c b/test/test_vidputs.c index c32f50b7..2215fa91 100644 --- a/test/test_vidputs.c +++ b/test/test_vidputs.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_vidputs.c,v 1.3 2013/01/13 00:58:54 tom Exp $ + * $Id: test_vidputs.c,v 1.4 2013/09/28 22:45:21 tom Exp $ * * Demonstrate the vidputs and vidattr functions. * Thomas Dickey - 2013/01/12 @@ -52,7 +52,7 @@ TPUTS_PROTO(outc, c) } static bool -outs(char *s) +outs(const char *s) { if (valid(s)) { tputs(s, 1, outc); diff --git a/test/view.c b/test/view.c index 8dcb0380..4782d850 100644 --- a/test/view.c +++ b/test/view.c @@ -50,7 +50,7 @@ * scroll operation worked, and the refresh() code only had to do a * partial repaint. * - * $Id: view.c,v 1.93 2013/04/27 19:46:53 tom Exp $ + * $Id: view.c,v 1.94 2013/09/28 21:58:42 tom Exp $ */ #include @@ -577,7 +577,7 @@ show_all(const char *tag) printw("%.*s", COLS, temp); clrtoeol(); this_time = time((time_t *) 0); - strncpy(temp, ctime(&this_time), 30); + strncpy(temp, ctime(&this_time), (size_t) 30); if ((i = (int) strlen(temp)) != 0) { temp[--i] = 0; if (move(0, COLS - i - 2) != ERR)