From 03f728e5bb3630a54fffc4a2ff2f8dbfcce9088e Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 23 Oct 2011 01:04:18 +0000 Subject: [PATCH] ncurses 5.9 - patch 20111022 + correct logic for discarding mouse events, retaining the partial events used to build up click, double-click, etc, until needed (cf: 20110917). + fix configure script to avoid creating unused Ada95 makefile when gnat does not work. + cleanup width-related gcc 3.4.3 warnings for 64-bit platform, for the internal functions of libncurses. The external interface of courses uses bool, which still produces these warnings. --- Ada95/aclocal.m4 | 5 +- Ada95/configure | 108 +++++++++++----------- Ada95/configure.in | 6 +- NEWS | 14 ++- aclocal.m4 | 9 +- configure | 151 ++++++++++++++++--------------- configure.in | 8 +- dist.mk | 4 +- include/nc_alloc.h | 13 ++- ncurses/base/keybound.c | 9 +- ncurses/base/keyok.c | 10 +- ncurses/base/lib_addch.c | 7 +- ncurses/base/lib_color.c | 16 ++-- ncurses/base/lib_freeall.c | 6 +- ncurses/base/lib_getch.c | 6 +- ncurses/base/lib_getstr.c | 6 +- ncurses/base/lib_instr.c | 6 +- ncurses/base/lib_mouse.c | 73 ++++++++++----- ncurses/base/lib_scanw.c | 6 +- ncurses/base/lib_screen.c | 8 +- ncurses/base/lib_scroll.c | 8 +- ncurses/base/lib_set_term.c | 6 +- ncurses/base/lib_slkset.c | 14 +-- ncurses/curses.priv.h | 79 ++++++++-------- ncurses/tinfo/MKcaptab.sh | 10 +- ncurses/tinfo/alloc_entry.c | 6 +- ncurses/tinfo/captoinfo.c | 8 +- ncurses/tinfo/comp_error.c | 6 +- ncurses/tinfo/comp_parse.c | 6 +- ncurses/tinfo/comp_scan.c | 10 +- ncurses/tinfo/entries.c | 6 +- ncurses/tinfo/lib_options.c | 6 +- ncurses/tinfo/lib_print.c | 6 +- ncurses/tinfo/lib_setup.c | 14 +-- ncurses/tinfo/lib_termcap.c | 7 +- ncurses/tinfo/lib_tparm.c | 10 +- ncurses/tinfo/lib_tputs.c | 6 +- ncurses/tinfo/make_keys.c | 6 +- ncurses/tinfo/read_entry.c | 10 +- ncurses/tinfo/setbuf.c | 10 +- ncurses/tinfo/tinfo_driver.c | 38 ++++---- ncurses/tinfo/write_entry.c | 20 ++-- ncurses/trace/lib_trace.c | 10 +- ncurses/trace/lib_traceatr.c | 8 +- ncurses/trace/trace_buf.c | 4 +- ncurses/trace/visbuf.c | 6 +- ncurses/tty/hashmap.c | 6 +- ncurses/tty/lib_mvcur.c | 6 +- ncurses/tty/lib_tstp.c | 4 +- ncurses/tty/lib_twait.c | 8 +- ncurses/tty/tty_update.c | 6 +- ncurses/widechar/lib_cchar.c | 6 +- ncurses/widechar/lib_get_wstr.c | 8 +- ncurses/widechar/lib_ins_wch.c | 6 +- ncurses/widechar/lib_slk_wset.c | 4 +- ncurses/widechar/lib_unget_wch.c | 6 +- 56 files changed, 451 insertions(+), 400 deletions(-) diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index 573c3b6d..355d4371 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: aclocal.m4,v 1.37 2011/09/10 21:36:41 tom Exp $ +dnl $Id: aclocal.m4,v 1.38 2011/10/22 19:04:02 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -2819,7 +2819,7 @@ AC_SUBST(PROG_EXT) test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_GNAT version: 1 updated: 2010/06/19 15:22:18 +dnl CF_PROG_GNAT version: 2 updated: 2011/10/22 14:01:47 dnl ------------ dnl Check for gnatmake, ensure that it is complete. AC_DEFUN([CF_PROG_GNAT],[ @@ -2827,6 +2827,7 @@ cf_ada_make=gnatmake AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= + cf_cv_prog_gnat_correct=no else CF_GNAT_VERSION AC_CHECK_PROG(M4_exists, m4, yes, no) diff --git a/Ada95/configure b/Ada95/configure index bb3104de..f745a42b 100644 --- a/Ada95/configure +++ b/Ada95/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.35 . +# From configure.in Revision: 1.36 . # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20101002. # @@ -10950,12 +10950,13 @@ if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'` fi +cf_with_ada=yes if test "$cf_with_ada" != "no" ; then cf_ada_make=gnatmake # Extract the first word of "$cf_ada_make", so it can be a program name with args. set dummy $cf_ada_make; ac_word=$2 -echo "$as_me:10958: checking for $ac_word" >&5 +echo "$as_me:10959: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_gnat_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10970,7 +10971,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_gnat_exists="yes" -echo "$as_me:10973: found $ac_dir/$ac_word" >&5 +echo "$as_me:10974: found $ac_dir/$ac_word" >&5 break done @@ -10979,23 +10980,24 @@ fi fi gnat_exists=$ac_cv_prog_gnat_exists if test -n "$gnat_exists"; then - echo "$as_me:10982: result: $gnat_exists" >&5 + echo "$as_me:10983: result: $gnat_exists" >&5 echo "${ECHO_T}$gnat_exists" >&6 else - echo "$as_me:10985: result: no" >&5 + echo "$as_me:10986: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= + cf_cv_prog_gnat_correct=no else -echo "$as_me:10993: checking for gnat version" >&5 +echo "$as_me:10995: checking for gnat version" >&5 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ grep '[0-9].[0-9][0-9]*' |\ sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` -echo "$as_me:10998: result: $cf_gnat_version" >&5 +echo "$as_me:11000: result: $cf_gnat_version" >&5 echo "${ECHO_T}$cf_gnat_version" >&6 case $cf_gnat_version in #(vi @@ -11003,7 +11005,7 @@ case $cf_gnat_version in #(vi cf_cv_prog_gnat_correct=yes ;; *) - { echo "$as_me:11006: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5 + { echo "$as_me:11008: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;} cf_cv_prog_gnat_correct=no ;; @@ -11011,7 +11013,7 @@ esac # Extract the first word of "m4", so it can be a program name with args. set dummy m4; ac_word=$2 -echo "$as_me:11014: checking for $ac_word" >&5 +echo "$as_me:11016: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_M4_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11026,7 +11028,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_M4_exists="yes" -echo "$as_me:11029: found $ac_dir/$ac_word" >&5 +echo "$as_me:11031: found $ac_dir/$ac_word" >&5 break done @@ -11035,10 +11037,10 @@ fi fi M4_exists=$ac_cv_prog_M4_exists if test -n "$M4_exists"; then - echo "$as_me:11038: result: $M4_exists" >&5 + echo "$as_me:11040: result: $M4_exists" >&5 echo "${ECHO_T}$M4_exists" >&6 else - echo "$as_me:11041: result: no" >&5 + echo "$as_me:11043: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -11047,7 +11049,7 @@ fi echo Ada95 binding required program m4 not found. Ada95 binding disabled. fi if test "$cf_cv_prog_gnat_correct" = yes; then - echo "$as_me:11050: checking if GNAT works" >&5 + echo "$as_me:11052: checking if GNAT works" >&5 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6 rm -rf conftest* *~conftest* @@ -11075,7 +11077,7 @@ else fi rm -rf conftest* *~conftest* - echo "$as_me:11078: result: $cf_cv_prog_gnat_correct" >&5 + echo "$as_me:11080: result: $cf_cv_prog_gnat_correct" >&5 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6 fi fi @@ -11098,7 +11100,7 @@ fi ;; esac -echo "$as_me:11101: checking if GNAT supports generics" >&5 +echo "$as_me:11103: checking if GNAT supports generics" >&5 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6 case $cf_gnat_version in #(vi 3.[1-9]*|[4-9].*) #(vi @@ -11108,7 +11110,7 @@ case $cf_gnat_version in #(vi cf_gnat_generics=no ;; esac -echo "$as_me:11111: result: $cf_gnat_generics" >&5 +echo "$as_me:11113: result: $cf_gnat_generics" >&5 echo "${ECHO_T}$cf_gnat_generics" >&6 if test "$cf_gnat_generics" = yes @@ -11120,7 +11122,7 @@ else cf_generic_objects= fi -echo "$as_me:11123: checking if GNAT supports SIGINT" >&5 +echo "$as_me:11125: checking if GNAT supports SIGINT" >&5 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6 if test "${cf_cv_gnat_sigint+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11168,7 +11170,7 @@ fi rm -rf conftest* *~conftest* fi -echo "$as_me:11171: result: $cf_cv_gnat_sigint" >&5 +echo "$as_me:11173: result: $cf_cv_gnat_sigint" >&5 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6 if test $cf_cv_gnat_sigint = yes ; then @@ -11177,7 +11179,7 @@ else USE_GNAT_SIGINT="#" fi -echo "$as_me:11180: checking if GNAT pragma Unreferenced works" >&5 +echo "$as_me:11182: checking if GNAT pragma Unreferenced works" >&5 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6 if test "${cf_cv_pragma_unreferenced+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11208,7 +11210,7 @@ fi rm -rf conftest* *~conftest* fi -echo "$as_me:11211: result: $cf_cv_pragma_unreferenced" >&5 +echo "$as_me:11213: result: $cf_cv_pragma_unreferenced" >&5 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6 # if the pragma is supported, use it (needed in the Trace code). @@ -11221,7 +11223,7 @@ fi cf_gnat_libraries=no cf_gnat_projects=no -echo "$as_me:11224: checking if GNAT supports project files" >&5 +echo "$as_me:11226: checking if GNAT supports project files" >&5 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6 case $cf_gnat_version in #(vi 3.[0-9]*) #(vi @@ -11289,14 +11291,14 @@ CF_EOF esac ;; esac -echo "$as_me:11292: result: $cf_gnat_projects" >&5 +echo "$as_me:11294: result: $cf_gnat_projects" >&5 echo "${ECHO_T}$cf_gnat_projects" >&6 if test $cf_gnat_projects = yes then - echo "$as_me:11297: checking if GNAT supports libraries" >&5 + echo "$as_me:11299: checking if GNAT supports libraries" >&5 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6 - echo "$as_me:11299: result: $cf_gnat_libraries" >&5 + echo "$as_me:11301: result: $cf_gnat_libraries" >&5 echo "${ECHO_T}$cf_gnat_libraries" >&6 fi @@ -11316,7 +11318,7 @@ else USE_GNAT_LIBRARIES="#" fi -echo "$as_me:11319: checking for ada-compiler" >&5 +echo "$as_me:11321: checking for ada-compiler" >&5 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6 # Check whether --with-ada-compiler or --without-ada-compiler was given. @@ -11327,12 +11329,12 @@ else cf_ada_compiler=gnatmake fi; -echo "$as_me:11330: result: $cf_ada_compiler" >&5 +echo "$as_me:11332: result: $cf_ada_compiler" >&5 echo "${ECHO_T}$cf_ada_compiler" >&6 cf_ada_package=terminal_interface -echo "$as_me:11335: checking for ada-include" >&5 +echo "$as_me:11337: checking for ada-include" >&5 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6 # Check whether --with-ada-include or --without-ada-include was given. @@ -11368,7 +11370,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:11371: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:11373: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -11377,10 +11379,10 @@ esac fi ADA_INCLUDE="$withval" -echo "$as_me:11380: result: $ADA_INCLUDE" >&5 +echo "$as_me:11382: result: $ADA_INCLUDE" >&5 echo "${ECHO_T}$ADA_INCLUDE" >&6 -echo "$as_me:11383: checking for ada-objects" >&5 +echo "$as_me:11385: checking for ada-objects" >&5 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6 # Check whether --with-ada-objects or --without-ada-objects was given. @@ -11416,7 +11418,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:11419: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:11421: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -11425,10 +11427,10 @@ esac fi ADA_OBJECTS="$withval" -echo "$as_me:11428: result: $ADA_OBJECTS" >&5 +echo "$as_me:11430: result: $ADA_OBJECTS" >&5 echo "${ECHO_T}$ADA_OBJECTS" >&6 -echo "$as_me:11431: checking if an Ada95 shared-library should be built" >&5 +echo "$as_me:11433: checking if an Ada95 shared-library should be built" >&5 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given. @@ -11438,7 +11440,7 @@ if test "${with_ada_sharedlib+set}" = set; then else with_ada_sharedlib=no fi; -echo "$as_me:11441: result: $with_ada_sharedlib" >&5 +echo "$as_me:11443: result: $with_ada_sharedlib" >&5 echo "${ECHO_T}$with_ada_sharedlib" >&6 ADA_SHAREDLIB='lib$(LIB_NAME).so.1' @@ -11454,12 +11456,12 @@ then fi else - { { echo "$as_me:11457: error: No usable Ada compiler found" >&5 + { { echo "$as_me:11459: error: No usable Ada compiler found" >&5 echo "$as_me: error: No usable Ada compiler found" >&2;} { (exit 1); exit 1; }; } fi else - { { echo "$as_me:11462: error: The Ada compiler is needed for this package" >&5 + { { echo "$as_me:11464: error: The Ada compiler is needed for this package" >&5 echo "$as_me: error: The Ada compiler is needed for this package" >&2;} { (exit 1); exit 1; }; } fi @@ -11506,7 +11508,7 @@ elif test "$includedir" != "/usr/include"; then fi ### Build up pieces for makefile rules -echo "$as_me:11509: checking default library suffix" >&5 +echo "$as_me:11511: checking default library suffix" >&5 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -11517,10 +11519,10 @@ echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 shared) DFT_ARG_SUFFIX='' ;; esac test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}" -echo "$as_me:11520: result: $DFT_ARG_SUFFIX" >&5 +echo "$as_me:11522: result: $DFT_ARG_SUFFIX" >&5 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6 -echo "$as_me:11523: checking default library-dependency suffix" >&5 +echo "$as_me:11525: checking default library-dependency suffix" >&5 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 case $DFT_LWR_MODEL in #(vi @@ -11573,10 +11575,10 @@ echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 esac test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}" test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}" -echo "$as_me:11576: result: $DFT_DEP_SUFFIX" >&5 +echo "$as_me:11578: result: $DFT_DEP_SUFFIX" >&5 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6 -echo "$as_me:11579: checking default object directory" >&5 +echo "$as_me:11581: checking default object directory" >&5 echo $ECHO_N "checking default object directory... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -11592,7 +11594,7 @@ echo $ECHO_N "checking default object directory... $ECHO_C" >&6 DFT_OBJ_SUBDIR='obj_s' ;; esac esac -echo "$as_me:11595: result: $DFT_OBJ_SUBDIR" >&5 +echo "$as_me:11597: result: $DFT_OBJ_SUBDIR" >&5 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6 ### Set up low-level terminfo dependencies for makefiles. @@ -11808,7 +11810,7 @@ DEFS=-DHAVE_CONFIG_H : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:11811: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:11813: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -11984,7 +11986,7 @@ cat >>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:11987: error: ambiguous option: $1 + { { echo "$as_me:11989: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} @@ -12003,7 +12005,7 @@ Try \`$0 --help' for more information." >&2;} ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:12006: error: unrecognized option: $1 + -*) { { echo "$as_me:12008: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} @@ -12074,7 +12076,7 @@ do "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; - *) { { echo "$as_me:12077: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:12079: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -12391,7 +12393,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:12394: creating $ac_file" >&5 + { echo "$as_me:12396: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -12409,7 +12411,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:12412: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:12414: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -12422,7 +12424,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:12425: error: cannot find input file: $f" >&5 + { { echo "$as_me:12427: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -12488,7 +12490,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue * ) ac_file_in=$ac_file.in ;; esac - test x"$ac_file" != x- && { echo "$as_me:12491: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:12493: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -12499,7 +12501,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:12502: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:12504: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -12512,7 +12514,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:12515: error: cannot find input file: $f" >&5 + { { echo "$as_me:12517: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -12570,7 +12572,7 @@ cat >>$CONFIG_STATUS <<\EOF rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:12573: $ac_file is unchanged" >&5 + { echo "$as_me:12575: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ diff --git a/Ada95/configure.in b/Ada95/configure.in index 6c5480f3..a1efc783 100644 --- a/Ada95/configure.in +++ b/Ada95/configure.in @@ -28,14 +28,14 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: configure.in,v 1.35 2011/09/24 15:32:32 tom Exp $ +dnl $Id: configure.in,v 1.36 2011/10/22 19:02:53 tom Exp $ dnl Process this file with autoconf to produce a configure script. dnl dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- AC_PREREQ(2.13.20020210) -AC_REVISION($Revision: 1.35 $) +AC_REVISION($Revision: 1.36 $) AC_INIT(gen/gen.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -492,7 +492,7 @@ if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then fi CF_HELP_MESSAGE(Ada95 Binding Options:) - +cf_with_ada=yes dnl Check for availability of GNU Ada Translator (GNAT). dnl At the moment we support no other Ada95 compiler. if test "$cf_with_ada" != "no" ; then diff --git a/NEWS b/NEWS index b4087abb..4b27cf61 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.1800 2011/10/15 23:34:06 tom Exp $ +-- $Id: NEWS,v 1.1804 2011/10/22 23:06:29 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,16 @@ 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. +20111022 + + correct logic for discarding mouse events, retaining the partial + events used to build up click, double-click, etc, until needed + (cf: 20110917). + + fix configure script to avoid creating unused Ada95 makefile when + gnat does not work. + + cleanup width-related gcc 3.4.3 warnings for 64-bit platform, for the + internal functions of libncurses. The external interface of courses + uses bool, which still produces these warnings. + 20111015 + improve description of --disable-tic-depends option to make it clear that it may be useful whether or not the --with-termlib @@ -85,7 +95,7 @@ it is not possible to add this information. TINFO_ARGS into pieces corresponding to LDFLAGS and LIBS variables, to help separate searches for tic- and tinfo-libraries (patch by Nick Alcock aka "Nix"). - + build-fix for lib_mouse.c changes (ch: 20110917). + + build-fix for lib_mouse.c changes (cf: 20110917). 20110917 + fix compiler warning for clang 2.9 diff --git a/aclocal.m4 b/aclocal.m4 index 457b5244..46ba5e7b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.575 2011/09/24 16:55:29 tom Exp $ +dnl $Id: aclocal.m4,v 1.577 2011/10/22 18:58:44 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -4794,7 +4794,7 @@ AC_SUBST(PROG_EXT) test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_GNAT version: 1 updated: 2010/06/19 15:22:18 +dnl CF_PROG_GNAT version: 2 updated: 2011/10/22 14:01:47 dnl ------------ dnl Check for gnatmake, ensure that it is complete. AC_DEFUN([CF_PROG_GNAT],[ @@ -4802,6 +4802,7 @@ cf_ada_make=gnatmake AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= + cf_cv_prog_gnat_correct=no else CF_GNAT_VERSION AC_CHECK_PROG(M4_exists, m4, yes, no) @@ -5625,7 +5626,7 @@ if test "$cf_cv_sizechange" != no ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SRC_MODULES version: 21 updated: 2010/09/04 17:37:40 +dnl CF_SRC_MODULES version: 22 updated: 2011/10/22 14:58:07 dnl -------------- dnl For each parameter, test if the source-directory exists, and if it contains dnl a 'modules' file. If so, add to the list $cf_cv_src_modules which we'll @@ -5716,7 +5717,7 @@ test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= -if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then +if test "x$cf_with_ada" = "xyes" && test "x$cf_cv_prog_gnat_correct" = xyes && test -f $srcdir/Ada95/Makefile.in; then SRC_SUBDIRS="$SRC_SUBDIRS Ada95" ADA_SUBDIRS="gen src" if test "x$cf_with_tests" != "xno" ; then diff --git a/configure b/configure index b617edc8..34025444 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.526 . +# From configure.in Revision: 1.527 . # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20101002. # @@ -18402,14 +18402,15 @@ fi if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= + cf_cv_prog_gnat_correct=no else -echo "$as_me:18407: checking for gnat version" >&5 +echo "$as_me:18408: checking for gnat version" >&5 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ grep '[0-9].[0-9][0-9]*' |\ sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` -echo "$as_me:18412: result: $cf_gnat_version" >&5 +echo "$as_me:18413: result: $cf_gnat_version" >&5 echo "${ECHO_T}$cf_gnat_version" >&6 case $cf_gnat_version in #(vi @@ -18417,7 +18418,7 @@ case $cf_gnat_version in #(vi cf_cv_prog_gnat_correct=yes ;; *) - { echo "$as_me:18420: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5 + { echo "$as_me:18421: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;} cf_cv_prog_gnat_correct=no ;; @@ -18425,7 +18426,7 @@ esac # Extract the first word of "m4", so it can be a program name with args. set dummy m4; ac_word=$2 -echo "$as_me:18428: checking for $ac_word" >&5 +echo "$as_me:18429: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_M4_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -18440,7 +18441,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_M4_exists="yes" -echo "$as_me:18443: found $ac_dir/$ac_word" >&5 +echo "$as_me:18444: found $ac_dir/$ac_word" >&5 break done @@ -18449,10 +18450,10 @@ fi fi M4_exists=$ac_cv_prog_M4_exists if test -n "$M4_exists"; then - echo "$as_me:18452: result: $M4_exists" >&5 + echo "$as_me:18453: result: $M4_exists" >&5 echo "${ECHO_T}$M4_exists" >&6 else - echo "$as_me:18455: result: no" >&5 + echo "$as_me:18456: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -18461,7 +18462,7 @@ fi echo Ada95 binding required program m4 not found. Ada95 binding disabled. fi if test "$cf_cv_prog_gnat_correct" = yes; then - echo "$as_me:18464: checking if GNAT works" >&5 + echo "$as_me:18465: checking if GNAT works" >&5 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6 rm -rf conftest* *~conftest* @@ -18489,7 +18490,7 @@ else fi rm -rf conftest* *~conftest* - echo "$as_me:18492: result: $cf_cv_prog_gnat_correct" >&5 + echo "$as_me:18493: result: $cf_cv_prog_gnat_correct" >&5 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6 fi fi @@ -18514,7 +18515,7 @@ fi ;; esac -echo "$as_me:18517: checking if GNAT supports generics" >&5 +echo "$as_me:18518: checking if GNAT supports generics" >&5 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6 case $cf_gnat_version in #(vi 3.[1-9]*|[4-9].*) #(vi @@ -18524,7 +18525,7 @@ case $cf_gnat_version in #(vi cf_gnat_generics=no ;; esac -echo "$as_me:18527: result: $cf_gnat_generics" >&5 +echo "$as_me:18528: result: $cf_gnat_generics" >&5 echo "${ECHO_T}$cf_gnat_generics" >&6 if test "$cf_gnat_generics" = yes @@ -18536,7 +18537,7 @@ else cf_generic_objects= fi -echo "$as_me:18539: checking if GNAT supports SIGINT" >&5 +echo "$as_me:18540: checking if GNAT supports SIGINT" >&5 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6 if test "${cf_cv_gnat_sigint+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -18584,7 +18585,7 @@ fi rm -rf conftest* *~conftest* fi -echo "$as_me:18587: result: $cf_cv_gnat_sigint" >&5 +echo "$as_me:18588: result: $cf_cv_gnat_sigint" >&5 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6 if test $cf_cv_gnat_sigint = yes ; then @@ -18593,7 +18594,7 @@ else USE_GNAT_SIGINT="#" fi -echo "$as_me:18596: checking if GNAT pragma Unreferenced works" >&5 +echo "$as_me:18597: checking if GNAT pragma Unreferenced works" >&5 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6 if test "${cf_cv_pragma_unreferenced+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -18624,7 +18625,7 @@ fi rm -rf conftest* *~conftest* fi -echo "$as_me:18627: result: $cf_cv_pragma_unreferenced" >&5 +echo "$as_me:18628: result: $cf_cv_pragma_unreferenced" >&5 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6 # if the pragma is supported, use it (needed in the Trace code). @@ -18637,7 +18638,7 @@ fi cf_gnat_libraries=no cf_gnat_projects=no -echo "$as_me:18640: checking if GNAT supports project files" >&5 +echo "$as_me:18641: checking if GNAT supports project files" >&5 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6 case $cf_gnat_version in #(vi 3.[0-9]*) #(vi @@ -18705,14 +18706,14 @@ CF_EOF esac ;; esac -echo "$as_me:18708: result: $cf_gnat_projects" >&5 +echo "$as_me:18709: result: $cf_gnat_projects" >&5 echo "${ECHO_T}$cf_gnat_projects" >&6 if test $cf_gnat_projects = yes then - echo "$as_me:18713: checking if GNAT supports libraries" >&5 + echo "$as_me:18714: checking if GNAT supports libraries" >&5 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6 - echo "$as_me:18715: result: $cf_gnat_libraries" >&5 + echo "$as_me:18716: result: $cf_gnat_libraries" >&5 echo "${ECHO_T}$cf_gnat_libraries" >&6 fi @@ -18732,7 +18733,7 @@ else USE_GNAT_LIBRARIES="#" fi -echo "$as_me:18735: checking for ada-compiler" >&5 +echo "$as_me:18736: checking for ada-compiler" >&5 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6 # Check whether --with-ada-compiler or --without-ada-compiler was given. @@ -18743,12 +18744,12 @@ else cf_ada_compiler=gnatmake fi; -echo "$as_me:18746: result: $cf_ada_compiler" >&5 +echo "$as_me:18747: result: $cf_ada_compiler" >&5 echo "${ECHO_T}$cf_ada_compiler" >&6 cf_ada_package=terminal_interface -echo "$as_me:18751: checking for ada-include" >&5 +echo "$as_me:18752: checking for ada-include" >&5 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6 # Check whether --with-ada-include or --without-ada-include was given. @@ -18784,7 +18785,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:18787: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:18788: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -18793,10 +18794,10 @@ esac fi ADA_INCLUDE="$withval" -echo "$as_me:18796: result: $ADA_INCLUDE" >&5 +echo "$as_me:18797: result: $ADA_INCLUDE" >&5 echo "${ECHO_T}$ADA_INCLUDE" >&6 -echo "$as_me:18799: checking for ada-objects" >&5 +echo "$as_me:18800: checking for ada-objects" >&5 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6 # Check whether --with-ada-objects or --without-ada-objects was given. @@ -18832,7 +18833,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:18835: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:18836: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -18841,10 +18842,10 @@ esac fi ADA_OBJECTS="$withval" -echo "$as_me:18844: result: $ADA_OBJECTS" >&5 +echo "$as_me:18845: result: $ADA_OBJECTS" >&5 echo "${ECHO_T}$ADA_OBJECTS" >&6 -echo "$as_me:18847: checking if an Ada95 shared-library should be built" >&5 +echo "$as_me:18848: checking if an Ada95 shared-library should be built" >&5 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given. @@ -18854,7 +18855,7 @@ if test "${with_ada_sharedlib+set}" = set; then else with_ada_sharedlib=no fi; -echo "$as_me:18857: result: $with_ada_sharedlib" >&5 +echo "$as_me:18858: result: $with_ada_sharedlib" >&5 echo "${ECHO_T}$with_ada_sharedlib" >&6 ADA_SHAREDLIB='lib$(LIB_NAME).so.1' @@ -18885,7 +18886,7 @@ fi ### chooses to split module lists into libraries. ### ### (see CF_LIB_RULES). -echo "$as_me:18888: checking for library subsets" >&5 +echo "$as_me:18889: checking for library subsets" >&5 echo $ECHO_N "checking for library subsets... $ECHO_C" >&6 LIB_SUBSETS= @@ -18926,7 +18927,7 @@ fi test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" -echo "$as_me:18929: result: $LIB_SUBSETS" >&5 +echo "$as_me:18930: result: $LIB_SUBSETS" >&5 echo "${ECHO_T}$LIB_SUBSETS" >&6 ### Construct the list of include-directories to be generated @@ -18964,7 +18965,7 @@ elif test "$includedir" != "/usr/include"; then fi ### Build up pieces for makefile rules -echo "$as_me:18967: checking default library suffix" >&5 +echo "$as_me:18968: checking default library suffix" >&5 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -18975,10 +18976,10 @@ echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 shared) DFT_ARG_SUFFIX='' ;; esac test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}" -echo "$as_me:18978: result: $DFT_ARG_SUFFIX" >&5 +echo "$as_me:18979: result: $DFT_ARG_SUFFIX" >&5 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6 -echo "$as_me:18981: checking default library-dependency suffix" >&5 +echo "$as_me:18982: checking default library-dependency suffix" >&5 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 case $DFT_LWR_MODEL in #(vi @@ -19031,10 +19032,10 @@ echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 esac test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}" test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}" -echo "$as_me:19034: result: $DFT_DEP_SUFFIX" >&5 +echo "$as_me:19035: result: $DFT_DEP_SUFFIX" >&5 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6 -echo "$as_me:19037: checking default object directory" >&5 +echo "$as_me:19038: checking default object directory" >&5 echo $ECHO_N "checking default object directory... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -19050,12 +19051,12 @@ echo $ECHO_N "checking default object directory... $ECHO_C" >&6 DFT_OBJ_SUBDIR='obj_s' ;; esac esac -echo "$as_me:19053: result: $DFT_OBJ_SUBDIR" >&5 +echo "$as_me:19054: result: $DFT_OBJ_SUBDIR" >&5 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6 # libtool thinks it can make c++ shared libraries (perhaps only g++) if test "$cf_with_cxx" = yes ; then -echo "$as_me:19058: checking c++ library-dependency suffix" >&5 +echo "$as_me:19059: checking c++ library-dependency suffix" >&5 echo $ECHO_N "checking c++ library-dependency suffix... $ECHO_C" >&6 if test "$with_libtool" != "no"; then CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX @@ -19112,7 +19113,7 @@ else test -n "$LIB_SUFFIX" && CXX_LIB_SUFFIX="${LIB_SUFFIX}${CXX_LIB_SUFFIX}" test -n "$LIB_SUFFIX" && CXX_DEP_SUFFIX="${LIB_SUFFIX}${CXX_DEP_SUFFIX}" fi -echo "$as_me:19115: result: $CXX_LIB_SUFFIX" >&5 +echo "$as_me:19116: result: $CXX_LIB_SUFFIX" >&5 echo "${ECHO_T}$CXX_LIB_SUFFIX" >&6 fi @@ -19271,19 +19272,19 @@ fi if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED" then - echo "$as_me:19274: checking if linker supports switching between static/dynamic" >&5 + echo "$as_me:19275: checking if linker supports switching between static/dynamic" >&5 echo $ECHO_N "checking if linker supports switching between static/dynamic... $ECHO_C" >&6 rm -f libconftest.a cat >conftest.$ac_ext < int cf_ldflags_static(FILE *fp) { return fflush(fp); } EOF - if { (eval echo "$as_me:19283: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:19284: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:19286: \$? = $ac_status" >&5 + echo "$as_me:19287: \$? = $ac_status" >&5 (exit $ac_status); } ; then ( $AR $ARFLAGS libconftest.a conftest.o ) 2>&5 1>/dev/null ( eval $RANLIB libconftest.a ) 2>&5 >/dev/null @@ -19294,10 +19295,10 @@ EOF LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 19297 "configure" +#line 19298 "configure" #include "confdefs.h" -#line 19300 "configure" +#line 19301 "configure" #include int cf_ldflags_static(FILE *fp); @@ -19312,16 +19313,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:19315: \"$ac_link\"") >&5 +if { (eval echo "$as_me:19316: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:19318: \$? = $ac_status" >&5 + echo "$as_me:19319: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:19321: \"$ac_try\"") >&5 + { (eval echo "$as_me:19322: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:19324: \$? = $ac_status" >&5 + echo "$as_me:19325: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # some linkers simply ignore the -dynamic @@ -19344,7 +19345,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext rm -f libconftest.* LIBS="$cf_save_LIBS" - echo "$as_me:19347: result: $cf_ldflags_static" >&5 + echo "$as_me:19348: result: $cf_ldflags_static" >&5 echo "${ECHO_T}$cf_ldflags_static" >&6 if test $cf_ldflags_static != yes @@ -19360,12 +19361,12 @@ fi ;; esac -echo "$as_me:19363: checking where we will install curses.h" >&5 +echo "$as_me:19364: checking where we will install curses.h" >&5 echo $ECHO_N "checking where we will install curses.h... $ECHO_C" >&6 test "$with_overwrite" = no && \ test "x$includedir" = 'x${prefix}/include' && \ includedir='${prefix}/include/ncurses'${LIB_SUFFIX} -echo "$as_me:19368: result: $includedir" >&5 +echo "$as_me:19369: result: $includedir" >&5 echo "${ECHO_T}$includedir" >&6 ### Resolve a conflict between normal and wide-curses by forcing applications @@ -19373,7 +19374,7 @@ echo "${ECHO_T}$includedir" >&6 if test "$with_overwrite" != no ; then if test "$NCURSES_LIBUTF8" = 1 ; then NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)' - { echo "$as_me:19376: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 + { echo "$as_me:19377: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 echo "$as_me: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&2;} fi fi @@ -19390,7 +19391,7 @@ EOF ### Construct the list of subdirectories for which we'll customize makefiles ### with the appropriate compile-rules. -echo "$as_me:19393: checking for src modules" >&5 +echo "$as_me:19394: checking for src modules" >&5 echo $ECHO_N "checking for src modules... $ECHO_C" >&6 # dependencies and linker-arguments for test-programs @@ -19453,7 +19454,7 @@ EOF fi fi done -echo "$as_me:19456: result: $cf_cv_src_modules" >&5 +echo "$as_me:19457: result: $cf_cv_src_modules" >&5 echo "${ECHO_T}$cf_cv_src_modules" >&6 TEST_ARGS="-L${LIB_DIR} $TEST_ARGS" @@ -19475,7 +19476,7 @@ test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= -if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then +if test "x$cf_with_ada" = "xyes" && test "x$cf_cv_prog_gnat_correct" = xyes && test -f $srcdir/Ada95/Makefile.in; then SRC_SUBDIRS="$SRC_SUBDIRS Ada95" ADA_SUBDIRS="gen src" if test "x$cf_with_tests" != "xno" ; then @@ -19497,7 +19498,7 @@ if test -n "$ADA_SUBDIRS"; then fi -if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then +if test "x$cf_with_ada" = "xyes" && test "x$cf_cv_prog_gnat_correct" = "xyes"; then SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${DFT_ARG_SUFFIX}-config:Ada95/gen/adacurses-config.in" SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${DFT_ARG_SUFFIX}-config.1:man/MKada_config.in" fi @@ -19659,7 +19660,7 @@ fi # Extract the first word of "tic", so it can be a program name with args. set dummy tic; ac_word=$2 -echo "$as_me:19662: checking for $ac_word" >&5 +echo "$as_me:19663: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_TIC_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -19676,7 +19677,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_TIC_PATH="$ac_dir/$ac_word" - echo "$as_me:19679: found $ac_dir/$ac_word" >&5 + echo "$as_me:19680: found $ac_dir/$ac_word" >&5 break fi done @@ -19688,10 +19689,10 @@ fi TIC_PATH=$ac_cv_path_TIC_PATH if test -n "$TIC_PATH"; then - echo "$as_me:19691: result: $TIC_PATH" >&5 + echo "$as_me:19692: result: $TIC_PATH" >&5 echo "${ECHO_T}$TIC_PATH" >&6 else - echo "$as_me:19694: result: no" >&5 + echo "$as_me:19695: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -19699,7 +19700,7 @@ if test -n "$FALLBACK_LIST" then if test "$TIC_PATH" = unknown then - { echo "$as_me:19702: WARNING: no tic program found for fallbacks" >&5 + { echo "$as_me:19703: WARNING: no tic program found for fallbacks" >&5 echo "$as_me: WARNING: no tic program found for fallbacks" >&2;} fi fi @@ -19800,7 +19801,7 @@ DEFS=-DHAVE_CONFIG_H : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:19803: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:19804: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -19976,7 +19977,7 @@ cat >>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:19979: error: ambiguous option: $1 + { { echo "$as_me:19980: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} @@ -19995,7 +19996,7 @@ Try \`$0 --help' for more information." >&2;} ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:19998: error: unrecognized option: $1 + -*) { { echo "$as_me:19999: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} @@ -20101,7 +20102,7 @@ do "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; - *) { { echo "$as_me:20104: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:20105: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -20514,7 +20515,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:20517: creating $ac_file" >&5 + { echo "$as_me:20518: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -20532,7 +20533,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:20535: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:20536: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -20545,7 +20546,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:20548: error: cannot find input file: $f" >&5 + { { echo "$as_me:20549: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -20611,7 +20612,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue * ) ac_file_in=$ac_file.in ;; esac - test x"$ac_file" != x- && { echo "$as_me:20614: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:20615: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -20622,7 +20623,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:20625: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:20626: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -20635,7 +20636,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:20638: error: cannot find input file: $f" >&5 + { { echo "$as_me:20639: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -20693,7 +20694,7 @@ cat >>$CONFIG_STATUS <<\EOF rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:20696: $ac_file is unchanged" >&5 + { echo "$as_me:20697: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ @@ -21336,7 +21337,7 @@ CF_EOF fi done -if test "x$cf_with_ada" != xno ; then +if test "x$cf_with_ada" = "xyes" && test "x$cf_cv_prog_gnat_correct" = "xyes"; then if test -z "$USE_OLD_MAKERULES" ; then $AWK -f $srcdir/Ada95/mk-1st.awk <$srcdir/Ada95/src/modules >>Ada95/src/Makefile fi diff --git a/configure.in b/configure.in index 412ae0f1..c5328db7 100644 --- a/configure.in +++ b/configure.in @@ -28,14 +28,14 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: configure.in,v 1.526 2011/09/24 14:40:59 nix Exp $ +dnl $Id: configure.in,v 1.527 2011/10/22 18:56:06 tom Exp $ dnl Process this file with autoconf to produce a configure script. dnl dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- AC_PREREQ(2.13.20020210) -AC_REVISION($Revision: 1.526 $) +AC_REVISION($Revision: 1.527 $) AC_INIT(ncurses/base/lib_initscr.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -1848,7 +1848,7 @@ AC_DEFINE(HAVE_SLK_COLOR) CF_SRC_MODULES($modules_to_build) -if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then +if test "x$cf_with_ada" = "xyes" && test "x$cf_cv_prog_gnat_correct" = "xyes"; then SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${DFT_ARG_SUFFIX}-config:Ada95/gen/adacurses-config.in" SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${DFT_ARG_SUFFIX}-config.1:man/MKada_config.in" fi @@ -1929,7 +1929,7 @@ if test "x$cf_with_tests" != xno ; then fi CF_LIB_RULES($SRC_SUBDIRS) -if test "x$cf_with_ada" != xno ; then +if test "x$cf_with_ada" = "xyes" && test "x$cf_cv_prog_gnat_correct" = "xyes"; then if test -z "$USE_OLD_MAKERULES" ; then $AWK -f $srcdir/Ada95/mk-1st.awk <$srcdir/Ada95/src/modules >>Ada95/src/Makefile fi diff --git a/dist.mk b/dist.mk index 3b505c3b..98edc09a 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.839 2011/10/15 20:34:38 tom Exp $ +# $Id: dist.mk,v 1.840 2011/10/22 14:23:04 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 = 20111015 +NCURSES_PATCH = 20111022 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/nc_alloc.h b/include/nc_alloc.h index da70906f..d893288b 100644 --- a/include/nc_alloc.h +++ b/include/nc_alloc.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -29,10 +29,11 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: nc_alloc.h,v 1.18 2010/11/20 22:59:49 tom Exp $ */ +/* $Id: nc_alloc.h,v 1.19 2011/10/22 16:54:57 tom Exp $ */ #ifndef NC_ALLOC_included #define NC_ALLOC_included 1 +/* *INDENT-OFF* */ #ifdef __cplusplus extern "C" { @@ -101,12 +102,14 @@ extern NCURSES_EXPORT(char *) _nc_strdup(const char *); /* entries.c */ extern NCURSES_EXPORT(void) _nc_leaks_tinfo(void); -#define typeMalloc(type,elts) (type *)malloc((elts)*sizeof(type)) -#define typeCalloc(type,elts) (type *)calloc((elts),sizeof(type)) -#define typeRealloc(type,elts,ptr) (type *)_nc_doalloc(ptr, (elts)*sizeof(type)) +#define typeMalloc(type,elts) (type *)malloc((size_t)(elts)*sizeof(type)) +#define typeCalloc(type,elts) (type *)calloc((size_t)(elts),sizeof(type)) +#define typeRealloc(type,elts,ptr) (type *)_nc_doalloc(ptr, (size_t)(elts)*sizeof(type)) #ifdef __cplusplus } #endif +/* *INDENT-ON* */ + #endif /* NC_ALLOC_included */ diff --git a/ncurses/base/keybound.c b/ncurses/base/keybound.c index 65e6bfc6..72790e84 100644 --- a/ncurses/base/keybound.c +++ b/ncurses/base/keybound.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2006,2009 Free Software Foundation, Inc. * + * Copyright (c) 1999-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 * @@ -33,7 +33,7 @@ #include -MODULE_ID("$Id: keybound.c,v 1.10 2009/10/24 22:15:47 tom Exp $") +MODULE_ID("$Id: keybound.c,v 1.11 2011/10/22 16:47:05 tom Exp $") /* * Returns the count'th string definition which is associated with the @@ -46,7 +46,10 @@ NCURSES_SP_NAME(keybound) (NCURSES_SP_DCLx int code, int count) T((T_CALLED("keybound(%p, %d,%d)"), (void *) SP_PARM, code, count)); if (SP_PARM != 0 && code >= 0) { - result = _nc_expand_try(SP_PARM->_keytry, (unsigned) code, &count, 0); + result = _nc_expand_try(SP_PARM->_keytry, + (unsigned) code, + &count, + (size_t) 0); } returnPtr(result); } diff --git a/ncurses/base/keyok.c b/ncurses/base/keyok.c index d700be49..6127fd27 100644 --- a/ncurses/base/keyok.c +++ b/ncurses/base/keyok.c @@ -33,7 +33,7 @@ #include -MODULE_ID("$Id: keyok.c,v 1.11 2011/06/04 19:24:16 tom Exp $") +MODULE_ID("$Id: keyok.c,v 1.12 2011/10/22 17:03:22 tom Exp $") /* * Enable (or disable) ncurses' interpretation of a keycode by adding (or @@ -62,8 +62,8 @@ NCURSES_SP_NAME(keyok) (NCURSES_SP_DCLx int c, bool flag) unsigned ch = (unsigned) c; if (flag) { - while ((s = _nc_expand_try(SP_PARM->_key_ok, ch, &count, 0)) - != 0 + while ((s = _nc_expand_try(SP_PARM->_key_ok, + ch, &count, (size_t) 0)) != 0 && _nc_remove_key(&(SP_PARM->_key_ok), ch)) { code = _nc_add_to_try(&(SP_PARM->_keytry), s, ch); free(s); @@ -72,8 +72,8 @@ NCURSES_SP_NAME(keyok) (NCURSES_SP_DCLx int c, bool flag) break; } } else { - while ((s = _nc_expand_try(SP_PARM->_keytry, ch, &count, 0)) - != 0 + while ((s = _nc_expand_try(SP_PARM->_keytry, + ch, &count, (size_t) 0)) != 0 && _nc_remove_key(&(SP_PARM->_keytry), ch)) { code = _nc_add_to_try(&(SP_PARM->_key_ok), s, ch); free(s); diff --git a/ncurses/base/lib_addch.c b/ncurses/base/lib_addch.c index 515ebaf0..dd6f800e 100644 --- a/ncurses/base/lib_addch.c +++ b/ncurses/base/lib_addch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -36,7 +36,7 @@ #include #include -MODULE_ID("$Id: lib_addch.c,v 1.124 2010/04/24 22:41:05 tom Exp $") +MODULE_ID("$Id: lib_addch.c,v 1.125 2011/10/22 16:51:31 tom Exp $") static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT); @@ -209,7 +209,8 @@ _nc_build_wch(WINDOW *win, ARG_CH_T ch) buffer[WINDOW_EXT(win, addch_used)] = '\0'; if ((len = (int) mbrtowc(&result, buffer, - WINDOW_EXT(win, addch_used), &state)) > 0) { + (size_t) WINDOW_EXT(win, addch_used), + &state)) > 0) { attr_t attrs = AttrOf(CHDEREF(ch)); if_EXT_COLORS(int pair = GetPair(CHDEREF(ch))); SetChar(CHDEREF(ch), result, attrs); diff --git a/ncurses/base/lib_color.c b/ncurses/base/lib_color.c index f0d2006b..5495c600 100644 --- a/ncurses/base/lib_color.c +++ b/ncurses/base/lib_color.c @@ -45,7 +45,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_color.c,v 1.103 2011/07/23 22:00:34 tom Exp $") +MODULE_ID("$Id: lib_color.c,v 1.104 2011/10/22 15:53:42 tom Exp $") #ifdef USE_TERM_DRIVER #define CanChange InfoOf(SP_PARM).canchange @@ -390,10 +390,10 @@ start_color(void) /* This function was originally written by Daniel Weaver */ static void -rgb2hls(short r, short g, short b, short *h, short *l, short *s) +rgb2hls(int r, int g, int b, short *h, short *l, short *s) /* convert RGB to HLS system */ { - short min, max, t; + int min, max, t; if ((min = g < r ? g : r) > b) min = b; @@ -423,7 +423,7 @@ rgb2hls(short r, short g, short b, short *h, short *l, short *s) else t = (short) (360 + ((r - g) * 60) / (max - min)); - *h = t % 360; + *h = (short) (t % 360); } /* @@ -782,9 +782,9 @@ pair_content(short pair, short *f, short *b) NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_DCLx - short old_pair, - short pair, - bool reverse, + int old_pair, + int pair, + int reverse, NCURSES_SP_OUTC outc) { #ifdef USE_TERM_DRIVER @@ -864,7 +864,7 @@ NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_DCLx #if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_do_color(short old_pair, short pair, bool reverse, NCURSES_OUTC outc) +_nc_do_color(int old_pair, int pair, int reverse, NCURSES_OUTC outc) { SetSafeOutcWrapper(outc); NCURSES_SP_NAME(_nc_do_color) (CURRENT_SCREEN, diff --git a/ncurses/base/lib_freeall.c b/ncurses/base/lib_freeall.c index 5bcc974b..69387787 100644 --- a/ncurses/base/lib_freeall.c +++ b/ncurses/base/lib_freeall.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -39,7 +39,7 @@ extern int malloc_errfd; /* FIXME */ #endif -MODULE_ID("$Id: lib_freeall.c,v 1.59 2010/01/23 17:57:43 tom Exp $") +MODULE_ID("$Id: lib_freeall.c,v 1.60 2011/10/22 16:34:50 tom Exp $") /* * Free all ncurses data. This is used for testing only (there's no practical @@ -100,7 +100,7 @@ NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_DCL0) (void) _nc_printf_string(0, empty_va); #ifdef TRACE - (void) _nc_trace_buf(-1, 0); + (void) _nc_trace_buf(-1, (size_t) 0); #endif #if USE_WIDEC_SUPPORT FreeIfNeeded(_nc_wacs); diff --git a/ncurses/base/lib_getch.c b/ncurses/base/lib_getch.c index 130c5024..7ee9e794 100644 --- a/ncurses/base/lib_getch.c +++ b/ncurses/base/lib_getch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_getch.c,v 1.121 2010/12/25 23:24:04 tom Exp $") +MODULE_ID("$Id: lib_getch.c,v 1.122 2011/10/22 16:34:50 tom Exp $") #include @@ -270,7 +270,7 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl)) # endif _nc_globals.read_thread = pthread_self(); # endif - n = (int) read(sp->_ifd, &c2, 1); + n = (int) read(sp->_ifd, &c2, (size_t) 1); #if USE_PTHREADS_EINTR _nc_globals.read_thread = 0; #endif diff --git a/ncurses/base/lib_getstr.c b/ncurses/base/lib_getstr.c index 21d8baa0..0e446349 100644 --- a/ncurses/base/lib_getstr.c +++ b/ncurses/base/lib_getstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -40,14 +40,14 @@ #include -MODULE_ID("$Id: lib_getstr.c,v 1.29 2009/10/24 21:59:02 tom Exp $") +MODULE_ID("$Id: lib_getstr.c,v 1.30 2011/10/22 16:31:35 tom Exp $") /* * This wipes out the last character, no matter whether it was a tab, control * or other character, and handles reverse wraparound. */ static char * -WipeOut(WINDOW *win, int y, int x, char *first, char *last, bool echoed) +WipeOut(WINDOW *win, int y, int x, char *first, char *last, int echoed) { if (last > first) { *--last = '\0'; diff --git a/ncurses/base/lib_instr.c b/ncurses/base/lib_instr.c index e6d1a739..aadf8b43 100644 --- a/ncurses/base/lib_instr.c +++ b/ncurses/base/lib_instr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: lib_instr.c,v 1.17 2009/10/24 22:55:45 tom Exp $") +MODULE_ID("$Id: lib_instr.c,v 1.18 2011/10/22 16:31:35 tom Exp $") NCURSES_EXPORT(int) winnstr(WINDOW *win, char *str, int n) @@ -78,7 +78,7 @@ winnstr(WINDOW *win, char *str, int n) if (getcchar(cell, wch, &attrs, &pair, 0) == OK) { init_mb(state); - n3 = wcstombs(0, wch, 0); + n3 = wcstombs(0, wch, (size_t) 0); if (!isEILSEQ(n3) && (n3 != 0)) { if (((int) n3 + i) > n) { done = TRUE; diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c index 8b807cce..783ed0c2 100644 --- a/ncurses/base/lib_mouse.c +++ b/ncurses/base/lib_mouse.c @@ -84,7 +84,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mouse.c,v 1.130 2011/09/24 00:42:25 tom Exp $") +MODULE_ID("$Id: lib_mouse.c,v 1.133 2011/10/22 23:01:26 tom Exp $") #include @@ -148,6 +148,9 @@ make an error #define INVALID_EVENT -1 #define NORMAL_EVENT 0 +#define ValidEvent(ep) ((ep)->id != INVALID_EVENT) +#define Invalidate(ep) (ep)->id = INVALID_EVENT + #if USE_GPM_SUPPORT #ifndef LIBGPM_SONAME @@ -673,7 +676,7 @@ _nc_mouse_init(SCREEN *sp) sp->_mouse_eventp = FirstEV(sp); for (i = 0; i < EV_MAX; i++) - sp->_mouse_events[i].id = INVALID_EVENT; + Invalidate(sp->_mouse_events + i); initialize_mousetype(sp); @@ -1002,7 +1005,7 @@ _nc_mouse_inline(SCREEN *sp) } static void -mouse_activate(SCREEN *sp, bool on) +mouse_activate(SCREEN *sp, int on) { if (!on && !sp->_mouse_initialized) return; @@ -1133,7 +1136,7 @@ _nc_mouse_parse(SCREEN *sp, int runcount) */ ep = eventp; for (n = runcount; n < EV_MAX; n++) { - ep->id = INVALID_EVENT; + Invalidate(ep); ep = NEXT(ep); } @@ -1159,7 +1162,7 @@ _nc_mouse_parse(SCREEN *sp, int runcount) #define MASK_CHANGED(x) (!(ep->bstate & MASK_PRESS(x)) \ == !(next->bstate & MASK_RELEASE(x))) - if (ep->id != INVALID_EVENT && next->id != INVALID_EVENT + if (ValidEvent(ep) && ValidEvent(next) && ep->x == next->x && ep->y == next->y && (ep->bstate & BUTTON_PRESSED) && (!(next->bstate & BUTTON_PRESSED))) { @@ -1182,14 +1185,15 @@ _nc_mouse_parse(SCREEN *sp, int runcount) merge = TRUE; } } - if (merge) - ep->id = INVALID_EVENT; + if (merge) { + Invalidate(ep); + } } } } /* Compact valid events */ - if (ep->id == INVALID_EVENT) { + if (!ValidEvent(ep)) { if ((first_valid != NULL) && (first_invalid == NULL)) { first_invalid = ep; } @@ -1198,7 +1202,7 @@ _nc_mouse_parse(SCREEN *sp, int runcount) first_valid = ep; } else if (first_invalid != NULL) { *first_invalid = *ep; - ep->id = INVALID_EVENT; + Invalidate(ep); first_invalid = NEXT(first_invalid); } } @@ -1247,6 +1251,8 @@ _nc_mouse_parse(SCREEN *sp, int runcount) if (next == eventp) { /* Will end the loop, but check event type and compact before */ endLoop = TRUE; + } else if (!ValidEvent(next)) { + continue; } else { /* merge click events forward */ if ((ep->bstate & BUTTON_CLICKED) @@ -1261,8 +1267,9 @@ _nc_mouse_parse(SCREEN *sp, int runcount) merge = TRUE; } } - if (merge) - ep->id = INVALID_EVENT; + if (merge) { + Invalidate(ep); + } } /* merge double-click events forward */ @@ -1278,18 +1285,19 @@ _nc_mouse_parse(SCREEN *sp, int runcount) merge = TRUE; } } - if (merge) - ep->id = INVALID_EVENT; + if (merge) { + Invalidate(ep); + } } } /* Discard event if it does not match event mask */ - if (!(ep->bstate & sp->_mouse_mask)) { - ep->id = INVALID_EVENT; + if (!(ep->bstate & sp->_mouse_mask2)) { + Invalidate(ep); } /* Compact valid events */ - if (ep->id == INVALID_EVENT) { + if (!ValidEvent(ep)) { if (ep == first_valid) { first_valid = next; } else if (first_invalid == NULL) { @@ -1297,7 +1305,7 @@ _nc_mouse_parse(SCREEN *sp, int runcount) } } else if (first_invalid != NULL) { *first_invalid = *ep; - ep->id = INVALID_EVENT; + Invalidate(ep); first_invalid = NEXT(first_invalid); } @@ -1319,7 +1327,7 @@ _nc_mouse_parse(SCREEN *sp, int runcount) _nc_unlock_global(tracef); } for (ep = first_valid; ep != first_invalid; ep = NEXT(ep)) { - if (ep->id != INVALID_EVENT) + if (ValidEvent(ep)) TR(MY_TRACE, ("_nc_mouse_parse: returning composite mouse event %s at slot %ld", _nc_tracemouse(sp, ep), @@ -1329,7 +1337,7 @@ _nc_mouse_parse(SCREEN *sp, int runcount) #endif /* TRACE */ /* after all this, do we have a valid event? */ - return (PREV(first_invalid)->id != INVALID_EVENT); + return ValidEvent(PREV(first_invalid)); } static void @@ -1426,11 +1434,11 @@ NCURSES_SP_NAME(getmouse) (NCURSES_SP_DCLx MEVENT * aevent) * _nc_mouse_parse was not called, e.g., when _nc_mouse_inline returns * false). */ - while ((prev->id != INVALID_EVENT) && (!(prev->bstate & SP_PARM->_mouse_mask))) { - prev->id = INVALID_EVENT; + while (ValidEvent(prev) && (!(prev->bstate & SP_PARM->_mouse_mask2))) { + Invalidate(prev); prev = PREV(prev); } - if (prev->id != INVALID_EVENT) { + if (ValidEvent(prev)) { /* copy the event we find there */ *aevent = *prev; @@ -1438,13 +1446,13 @@ NCURSES_SP_NAME(getmouse) (NCURSES_SP_DCLx MEVENT * aevent) _nc_tracemouse(SP_PARM, prev), (long) IndexEV(SP_PARM, prev))); - prev->id = INVALID_EVENT; /* so the queue slot becomes free */ + Invalidate(prev); /* so the queue slot becomes free */ SP_PARM->_mouse_eventp = prev; result = OK; } else { /* Reset the provided event */ aevent->bstate = 0; - aevent->id = INVALID_EVENT; + Invalidate(aevent); aevent->x = 0; aevent->y = 0; aevent->z = 0; @@ -1498,6 +1506,7 @@ NCURSES_SP_NAME(mousemask) (NCURSES_SP_DCLx mmask_t newmask, mmask_t * oldmask) /* set the mouse event mask */ { mmask_t result = 0; + int b; T((T_CALLED("mousemask(%p,%#lx,%p)"), (void *) SP_PARM, @@ -1525,6 +1534,22 @@ NCURSES_SP_NAME(mousemask) (NCURSES_SP_DCLx mmask_t newmask, mmask_t * oldmask) mouse_activate(SP_PARM, (bool) (result != 0)); SP_PARM->_mouse_mask = result; + SP_PARM->_mouse_mask2 = result; + + /* + * Make a mask corresponding to the states we will need to + * retain (temporarily) while building up the state that the + * user asked for. + */ + for (b = 1; b <= MAX_BUTTONS; ++b) { + if (SP_PARM->_mouse_mask2 & MASK_TRIPLE_CLICK(b)) + SP_PARM->_mouse_mask2 |= MASK_DOUBLE_CLICK(b); + if (SP_PARM->_mouse_mask2 & MASK_DOUBLE_CLICK(b)) + SP_PARM->_mouse_mask2 |= MASK_CLICK(b); + if (SP_PARM->_mouse_mask2 & MASK_CLICK(b)) + SP_PARM->_mouse_mask2 |= (MASK_PRESS(b) | + MASK_RELEASE(b)); + } } } } diff --git a/ncurses/base/lib_scanw.c b/ncurses/base/lib_scanw.c index a8621e63..637aa46e 100644 --- a/ncurses/base/lib_scanw.c +++ b/ncurses/base/lib_scanw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -40,14 +40,14 @@ #include -MODULE_ID("$Id: lib_scanw.c,v 1.12 2009/10/24 22:35:14 tom Exp $") +MODULE_ID("$Id: lib_scanw.c,v 1.13 2011/10/22 16:31:35 tom Exp $") NCURSES_EXPORT(int) vwscanw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp) { char buf[BUFSIZ]; - if (wgetnstr(win, buf, sizeof(buf) - 1) == ERR) + if (wgetnstr(win, buf, (int) sizeof(buf) - 1) == ERR) return (ERR); return (vsscanf(buf, fmt, argp)); diff --git a/ncurses/base/lib_screen.c b/ncurses/base/lib_screen.c index 7404caac..695ed30e 100644 --- a/ncurses/base/lib_screen.c +++ b/ncurses/base/lib_screen.c @@ -39,7 +39,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_screen.c,v 1.40 2011/05/28 23:03:44 tom Exp $") +MODULE_ID("$Id: lib_screen.c,v 1.41 2011/10/22 15:03:11 tom Exp $") #define MAX_SIZE 0x3fff /* 16k is big enough for a window or pad */ @@ -55,7 +55,7 @@ NCURSES_SP_NAME(getwin) (NCURSES_SP_DCLx FILE *filep) returnWin(0); } clearerr(filep); - if (fread(&tmp, 1, sizeof(WINDOW), filep) < sizeof(WINDOW) + if (fread(&tmp, (size_t) 1, sizeof(WINDOW), filep) < sizeof(WINDOW) || ferror(filep) || tmp._maxy == 0 || tmp._maxy > MAX_SIZE @@ -113,7 +113,7 @@ NCURSES_SP_NAME(getwin) (NCURSES_SP_DCLx FILE *filep) for (n = 0; n <= nwin->_maxy; n++) { clearerr(filep); - if (fread(nwin->_line[n].text, 1, linesize, filep) < linesize + if (fread(nwin->_line[n].text, (size_t) 1, linesize, filep) < linesize || ferror(filep)) { delwin(nwin); returnWin(0); @@ -144,7 +144,7 @@ putwin(WINDOW *win, FILE *filep) size_t len = (size_t) (win->_maxx + 1); clearerr(filep); - if (fwrite(win, sizeof(WINDOW), 1, filep) != 1 + if (fwrite(win, sizeof(WINDOW), (size_t) 1, filep) != 1 || ferror(filep)) returnCode(code); diff --git a/ncurses/base/lib_scroll.c b/ncurses/base/lib_scroll.c index fe4e8080..8684e251 100644 --- a/ncurses/base/lib_scroll.c +++ b/ncurses/base/lib_scroll.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -43,13 +43,13 @@ #include -MODULE_ID("$Id: lib_scroll.c,v 1.28 2010/12/19 01:48:09 tom Exp $") +MODULE_ID("$Id: lib_scroll.c,v 1.29 2011/10/22 16:34:50 tom Exp $") NCURSES_EXPORT(void) _nc_scroll_window(WINDOW *win, int const n, - NCURSES_SIZE_T const top, - NCURSES_SIZE_T const bottom, + int const top, + int const bottom, NCURSES_CH_T blank) { int limit; diff --git a/ncurses/base/lib_set_term.c b/ncurses/base/lib_set_term.c index c67cf8c1..b60242de 100644 --- a/ncurses/base/lib_set_term.c +++ b/ncurses/base/lib_set_term.c @@ -47,7 +47,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_set_term.c,v 1.139 2011/06/14 22:50:58 tom Exp $") +MODULE_ID("$Id: lib_set_term.c,v 1.140 2011/10/22 16:10:43 tom Exp $") #ifdef USE_TERM_DRIVER #define MaxColors InfoOf(sp).maxcolors @@ -284,7 +284,7 @@ NCURSES_SP_NAME(_nc_setupscreen) ( int slines, int scolumns, FILE *output, - bool filtered, + int filtered, int slk_format) { char *env; @@ -695,7 +695,7 @@ NCURSES_EXPORT(int) _nc_setupscreen(int slines GCC_UNUSED, int scolumns GCC_UNUSED, FILE *output, - bool filtered, + int filtered, int slk_format) { SCREEN *sp = 0; diff --git a/ncurses/base/lib_slkset.c b/ncurses/base/lib_slkset.c index 91483f10..ca662668 100644 --- a/ncurses/base/lib_slkset.c +++ b/ncurses/base/lib_slkset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -44,7 +44,7 @@ #endif #endif -MODULE_ID("$Id: lib_slkset.c,v 1.21 2010/12/25 23:43:58 tom Exp $") +MODULE_ID("$Id: lib_slkset.c,v 1.22 2011/10/22 16:58:26 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_set) (NCURSES_SP_DCLx int i, const char *astr, int format) @@ -111,8 +111,8 @@ NCURSES_SP_NAME(slk_set) (NCURSES_SP_DCLx int i, const char *astr, int format) slk->ent[i].ent_text[numchrs] = '\0'; if ((slk->ent[i].form_text = (char *) _nc_doalloc(slk->ent[i].form_text, - (unsigned) (limit + - numchrs + 1)) + (size_t) (limit + + numchrs + 1)) ) == 0) returnCode(ERR); @@ -131,16 +131,16 @@ NCURSES_SP_NAME(slk_set) (NCURSES_SP_DCLx int i, const char *astr, int format) if (offset <= 0) offset = 0; else - memset(slk->ent[i].form_text, ' ', (unsigned) offset); + memset(slk->ent[i].form_text, ' ', (size_t) offset); memcpy(slk->ent[i].form_text + offset, slk->ent[i].ent_text, - (unsigned) numchrs); + (size_t) numchrs); if (offset < limit) { memset(slk->ent[i].form_text + offset + numchrs, ' ', - (unsigned) (limit - (offset + numcols))); + (size_t) (limit - (offset + numcols))); } slk->ent[i].form_text[numchrs - numcols + limit] = 0; diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 0d41aaac..b6ffea4d 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.485 2011/10/08 21:00:56 tom Exp $ + * $Id: curses.priv.h,v 1.488 2011/10/22 22:41:12 tom Exp $ * * curses.priv.h * @@ -1085,7 +1085,8 @@ struct screen { void (*_mouse_wrap) (SCREEN *); int _mouse_fd; /* file-descriptor, if any */ bool _mouse_active; /* true if initialized */ - mmask_t _mouse_mask; + mmask_t _mouse_mask; /* set via mousemask() */ + mmask_t _mouse_mask2; /* OR's in press/release bits */ mmask_t _mouse_bstate; NCURSES_CONST char *_mouse_xtermcap; /* string to enable/disable mouse */ MEVENT _mouse_events[EV_MAX]; /* hold the last mouse event seen */ @@ -1370,7 +1371,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; putc(PUTC_ch,b); \ break; \ } \ - IGNORE_RC(fwrite(PUTC_buf, (unsigned) PUTC_n, 1, b)); \ + IGNORE_RC(fwrite(PUTC_buf, (size_t) PUTC_n, (size_t) 1, b)); \ } \ COUNT_OUTCHARS(PUTC_i); \ } } } while (0) @@ -1559,7 +1560,7 @@ extern NCURSES_EXPORT(void) _nc_locked_tracef (const char *, ...) GCC_PRINTFLIKE #define returnVoidPtr(code) TRACE_RETURN(code,void_ptr) #define returnWin(code) TRACE_RETURN(code,win) -extern NCURSES_EXPORT(NCURSES_BOOL) _nc_retrace_bool (NCURSES_BOOL); +extern NCURSES_EXPORT(NCURSES_BOOL) _nc_retrace_bool (int); extern NCURSES_EXPORT(NCURSES_CONST void *) _nc_retrace_cvoid_ptr (NCURSES_CONST void *); extern NCURSES_EXPORT(SCREEN *) _nc_retrace_sp (SCREEN *); extern NCURSES_EXPORT(WINDOW *) _nc_retrace_win (WINDOW *); @@ -1570,7 +1571,7 @@ extern NCURSES_EXPORT(char *) _nc_varargs (const char *, va_list); extern NCURSES_EXPORT(chtype) _nc_retrace_chtype (chtype); extern NCURSES_EXPORT(const char *) _nc_altcharset_name(attr_t, chtype); extern NCURSES_EXPORT(const char *) _nc_retrace_cptr (const char *); -extern NCURSES_EXPORT(char) _nc_retrace_char (char); +extern NCURSES_EXPORT(char) _nc_retrace_char (int); extern NCURSES_EXPORT(int) _nc_retrace_int (int); extern NCURSES_EXPORT(int) _nc_retrace_int_attr_t (attr_t); extern NCURSES_EXPORT(mmask_t) _nc_retrace_mmask_t (SCREEN *, mmask_t); @@ -1847,8 +1848,8 @@ extern NCURSES_EXPORT(bool) _nc_has_mouse (SCREEN *); extern NCURSES_EXPORT(char *) _nc_get_locale(void); extern NCURSES_EXPORT(int) _nc_unicode_locale(void); extern NCURSES_EXPORT(int) _nc_locale_breaks_acs(TERMINAL *); -extern NCURSES_EXPORT(int) _nc_setupterm(NCURSES_CONST char *, int, int *, bool); -extern NCURSES_EXPORT(void) _nc_tinfo_cmdch(TERMINAL *, char); +extern NCURSES_EXPORT(int) _nc_setupterm(NCURSES_CONST char *, int, int *, int); +extern NCURSES_EXPORT(void) _nc_tinfo_cmdch(TERMINAL *, int); /* lib_set_term.c */ extern NCURSES_EXPORT(int) _nc_ripoffline(int, int(*)(WINDOW*, int)); @@ -1925,16 +1926,16 @@ extern NCURSES_EXPORT(int) _nc_access (const char *, int); extern NCURSES_EXPORT(int) _nc_baudrate (int); extern NCURSES_EXPORT(int) _nc_freewin (WINDOW *); extern NCURSES_EXPORT(int) _nc_getenv_num (const char *); -extern NCURSES_EXPORT(int) _nc_keypad (SCREEN *, bool); +extern NCURSES_EXPORT(int) _nc_keypad (SCREEN *, int); extern NCURSES_EXPORT(int) _nc_ospeed (int); extern NCURSES_EXPORT(int) _nc_outch (int); extern NCURSES_EXPORT(int) _nc_putp(const char *, const char *); extern NCURSES_EXPORT(int) _nc_putp_flush(const char *, const char *); extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE *const); -extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, bool, int); +extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, int, int); extern NCURSES_EXPORT(int) _nc_setup_tinfo(const char *, TERMTYPE *); extern NCURSES_EXPORT(int) _nc_timed_wait (SCREEN *, int, int, int * EVENTLIST_2nd(_nc_eventlist *)); -extern NCURSES_EXPORT(void) _nc_do_color (short, short, bool, NCURSES_OUTC); +extern NCURSES_EXPORT(void) _nc_do_color (int, int, int, NCURSES_OUTC); extern NCURSES_EXPORT(void) _nc_flush (void); extern NCURSES_EXPORT(void) _nc_free_and_exit (int) GCC_NORETURN; extern NCURSES_EXPORT(void) _nc_free_entry (ENTRY *, TERMTYPE *); @@ -1945,8 +1946,8 @@ extern NCURSES_EXPORT(void) _nc_keep_tic_dir (const char *); extern NCURSES_EXPORT(void) _nc_make_oldhash (int i); extern NCURSES_EXPORT(void) _nc_scroll_oldhash (int n, int top, int bot); extern NCURSES_EXPORT(void) _nc_scroll_optimize (void); -extern NCURSES_EXPORT(void) _nc_set_buffer (FILE *, bool); -extern NCURSES_EXPORT(void) _nc_signal_handler (bool); +extern NCURSES_EXPORT(void) _nc_set_buffer (FILE *, int); +extern NCURSES_EXPORT(void) _nc_signal_handler (int); extern NCURSES_EXPORT(void) _nc_synchook (WINDOW *); extern NCURSES_EXPORT(void) _nc_trace_tries (TRIES *); @@ -1965,7 +1966,7 @@ extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void); #if !(defined(USE_TERMLIB) || defined(USE_BUILD_CC)) extern NCURSES_EXPORT(NCURSES_CH_T) _nc_render (WINDOW *, NCURSES_CH_T); extern NCURSES_EXPORT(int) _nc_waddch_nosync (WINDOW *, const NCURSES_CH_T); -extern NCURSES_EXPORT(void) _nc_scroll_window (WINDOW *, int const, NCURSES_SIZE_T const, NCURSES_SIZE_T const, NCURSES_CH_T); +extern NCURSES_EXPORT(void) _nc_scroll_window (WINDOW *, int const, int const, int const, NCURSES_CH_T); #endif #if USE_WIDEC_SUPPORT @@ -1998,7 +1999,7 @@ extern NCURSES_EXPORT(int) _nc_eventlist_timeout(_nc_eventlist *); */ #if USE_WIDEC_SUPPORT #if HAVE_MBTOWC && HAVE_MBLEN -#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0)) +#define reset_mbytes(state) IGNORE_RC(mblen(NULL, (size_t) 0)), IGNORE_RC(mbtowc(NULL, NULL, (size_t) 0)) #define count_mbytes(buffer,length,state) mblen(buffer,length) #define check_mbytes(wch,buffer,length,state) \ (int) mbtowc(&wch, buffer, length) @@ -2135,39 +2136,39 @@ typedef struct _termInfo typedef struct term_driver { bool isTerminfo; - bool (*CanHandle)(struct DriverTCB*,const char*,int*); + bool (*CanHandle)(struct DriverTCB*, const char*, int*); void (*init)(struct DriverTCB*); void (*release)(struct DriverTCB*); int (*size)(struct DriverTCB*, int* Line, int *Cols); - int (*sgmode)(struct DriverTCB*, bool setFlag, TTY*); + int (*sgmode)(struct DriverTCB*, int setFlag, TTY*); chtype (*conattr)(struct DriverTCB*); int (*hwcur)(struct DriverTCB*, int yold, int xold, int y, int x); - int (*mode)(struct DriverTCB*, bool progFlag, bool defFlag); + int (*mode)(struct DriverTCB*, int progFlag, int defFlag); bool (*rescol)(struct DriverTCB*); bool (*rescolors)(struct DriverTCB*); - void (*color)(struct DriverTCB*,bool fore, int color, int(*)(SCREEN*,int)); - int (*doBeepOrFlash)(struct DriverTCB*, bool); - void (*initpair)(struct DriverTCB*,short,short,short); - void (*initcolor)(struct DriverTCB*,short,short,short,short); - void (*docolor)(struct DriverTCB*,short,short,bool,int(*)(SCREEN*,int)); + void (*color)(struct DriverTCB*, int fore, int color, int(*)(SCREEN*, int)); + int (*doBeepOrFlash)(struct DriverTCB*, int); + void (*initpair)(struct DriverTCB*, int, int, int); + void (*initcolor)(struct DriverTCB*, int, int, int, int); + void (*docolor)(struct DriverTCB*, int, int, int, int(*)(SCREEN*, int)); void (*initmouse)(struct DriverTCB*); - int (*testmouse)(struct DriverTCB*,int); + int (*testmouse)(struct DriverTCB*, int); void (*setfilter)(struct DriverTCB*); - void (*hwlabel)(struct DriverTCB*,int,char*); - void (*hwlabelOnOff)(struct DriverTCB*,bool); + void (*hwlabel)(struct DriverTCB*, int, char*); + void (*hwlabelOnOff)(struct DriverTCB*, int); int (*update)(struct DriverTCB*); - int (*defaultcolors)(struct DriverTCB*,int,int); - int (*print)(struct DriverTCB*,char*,int); - int (*getsize)(struct DriverTCB*,int*,int*); - int (*setsize)(struct DriverTCB*,int,int); - void (*initacs)(struct DriverTCB*,chtype*,chtype*); + int (*defaultcolors)(struct DriverTCB*, int, int); + int (*print)(struct DriverTCB*, char*, int); + int (*getsize)(struct DriverTCB*, int*, int*); + int (*setsize)(struct DriverTCB*, int, int); + void (*initacs)(struct DriverTCB*, chtype*, chtype*); void (*scinit)(SCREEN *); void (*scexit)(SCREEN *); - int (*twait)(struct DriverTCB*,int,int,int* EVENTLIST_2nd(_nc_eventlist*)); - int (*read)(struct DriverTCB*,int*); - int (*nap)(struct DriverTCB*,int); - int (*kpad)(struct DriverTCB*, bool); - int (*kyOk)(struct DriverTCB*, int, bool); + int (*twait)(struct DriverTCB*, int, int, int* EVENTLIST_2nd(_nc_eventlist*)); + int (*read)(struct DriverTCB*, int*); + int (*nap)(struct DriverTCB*, int); + int (*kpad)(struct DriverTCB*, int); + int (*kyOk)(struct DriverTCB*, int, int); bool (*kyExist)(struct DriverTCB*, int); } TERM_DRIVER; @@ -2225,7 +2226,7 @@ extern NCURSES_EXPORT(int) TINFO_MVCUR(SCREEN*, int, int, int, int); */ #ifdef USE_TERM_DRIVER extern NCURSES_EXPORT(void) _nc_get_screensize(SCREEN *, TERMINAL *, int *, int *); -extern NCURSES_EXPORT(int) _nc_setupterm_ex(TERMINAL **, NCURSES_CONST char *, int , int *, bool); +extern NCURSES_EXPORT(int) _nc_setupterm_ex(TERMINAL **, NCURSES_CONST char *, int , int *, int); #define TINFO_GET_SIZE(sp, tp, lp, cp) \ _nc_get_screensize(sp, tp, lp, cp) #define TINFO_SET_CURTERM(sp, tp) \ @@ -2301,12 +2302,12 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_scr_init)(SCREEN*,const char extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_scr_restore)(SCREEN*, const char*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_scrolln)(SCREEN*, int, int, int, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_set_tty_mode)(SCREEN*, TTY*); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_setupscreen)(SCREEN**, int, int, FILE *, bool, int); +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_setupscreen)(SCREEN**, int, int, FILE *, int, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_tgetent)(SCREEN*,char*,const char *); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_tigetnum)(SCREEN*,NCURSES_CONST char*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_vid_attr)(SCREEN *, attr_t, short, void *); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_vidputs)(SCREEN*,chtype,int(*) (SCREEN*, int)); -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_do_color)(SCREEN*, short, short, bool, NCURSES_SP_OUTC); +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_do_color)(SCREEN*, int, int, int, NCURSES_SP_OUTC); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_do_xmc_glitch)(SCREEN*, attr_t); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_flush)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_free_and_exit)(SCREEN*, int) GCC_NORETURN; @@ -2322,7 +2323,7 @@ extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_screen_resume)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_screen_wrap)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_scroll_oldhash)(SCREEN*, int n, int top, int bot); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_scroll_optimize)(SCREEN*); -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_set_buffer)(SCREEN*, FILE *, bool); +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_set_buffer)(SCREEN*, FILE *, int); extern NCURSES_EXPORT(void) _nc_cookie_init(SCREEN *sp); diff --git a/ncurses/tinfo/MKcaptab.sh b/ncurses/tinfo/MKcaptab.sh index 4d1b53a5..20c94a63 100755 --- a/ncurses/tinfo/MKcaptab.sh +++ b/ncurses/tinfo/MKcaptab.sh @@ -1,6 +1,6 @@ #!/bin/sh ############################################################################## -# 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 "Software"), # @@ -26,7 +26,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: MKcaptab.sh,v 1.13 2010/12/25 23:43:58 tom Exp $ +# $Id: MKcaptab.sh,v 1.14 2011/10/22 16:34:50 tom Exp $ AWK=${1-awk} OPT1=${2-0} OPT2=${3-tinfo/MKcaptab.awk} @@ -99,12 +99,12 @@ static const struct alias * _nc_build_alias(struct alias **actual, const alias_table_data *source, const char *strings, - unsigned tablesize) + size_t tablesize) { if (*actual == 0) { *actual = typeCalloc(struct alias, tablesize + 1); if (*actual != 0) { - unsigned n; + size_t n; for (n = 0; n < tablesize; ++n) { add_alias(from); add_alias(to); @@ -178,7 +178,7 @@ tcap_hash(const char *string) static int compare_tcap_names(const char *a, const char *b) { - return !strncmp(a, b, TCAP_LEN); + return !strncmp(a, b, (size_t) TCAP_LEN); } static int diff --git a/ncurses/tinfo/alloc_entry.c b/ncurses/tinfo/alloc_entry.c index 506fb386..9d70634e 100644 --- a/ncurses/tinfo/alloc_entry.c +++ b/ncurses/tinfo/alloc_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -47,7 +47,7 @@ #include -MODULE_ID("$Id: alloc_entry.c,v 1.51 2010/12/25 23:06:01 tom Exp $") +MODULE_ID("$Id: alloc_entry.c,v 1.52 2011/10/22 16:34:50 tom Exp $") #define ABSENT_OFFSET -1 #define CANCELLED_OFFSET -2 @@ -73,7 +73,7 @@ _nc_init_entry(TERMTYPE *const tp) #endif if (stringbuf == 0) - stringbuf = (char *) malloc(MAX_STRTAB); + stringbuf = (char *) malloc((size_t) MAX_STRTAB); #if NCURSES_XNAMES tp->num_Booleans = BOOLCOUNT; diff --git a/ncurses/tinfo/captoinfo.c b/ncurses/tinfo/captoinfo.c index f2575f8a..cc57db31 100644 --- a/ncurses/tinfo/captoinfo.c +++ b/ncurses/tinfo/captoinfo.c @@ -93,7 +93,7 @@ #include #include -MODULE_ID("$Id: captoinfo.c,v 1.69 2011/07/30 21:33:42 tom Exp $") +MODULE_ID("$Id: captoinfo.c,v 1.70 2011/10/22 14:59:34 tom Exp $") #define MAX_PUSHED 16 /* max # args we can push onto the stack */ @@ -743,15 +743,15 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz bufptr = save_tc_char(bufptr, c1); } /* FIXME: this "works" for 'delta' */ - else if (strncmp(str, "%{2}%*%-", 8) == 0) { + else if (strncmp(str, "%{2}%*%-", (size_t) 8) == 0) { str += 7; bufptr = save_string(bufptr, "%D"); - } else if (strncmp(str, "%{96}%^", 7) == 0) { + } else if (strncmp(str, "%{96}%^", (size_t) 7) == 0) { str += 6; if (saw_m++ == 0) { bufptr = save_string(bufptr, "%n"); } - } else if (strncmp(str, "%{127}%^", 8) == 0) { + } else if (strncmp(str, "%{127}%^", (size_t) 8) == 0) { str += 7; if (saw_n++ == 0) { bufptr = save_string(bufptr, "%m"); diff --git a/ncurses/tinfo/comp_error.c b/ncurses/tinfo/comp_error.c index 24b85675..b6a2c4e5 100644 --- a/ncurses/tinfo/comp_error.c +++ b/ncurses/tinfo/comp_error.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: comp_error.c,v 1.32 2011/07/29 00:40:41 tom Exp $") +MODULE_ID("$Id: comp_error.c,v 1.33 2011/10/22 16:34:50 tom Exp $") NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings = FALSE; NCURSES_EXPORT_VAR(int) _nc_curr_line = 0; /* current line # in input */ @@ -71,7 +71,7 @@ _nc_set_type(const char *const name) if (TermType != 0) { TermType[0] = '\0'; if (name) - strncat(TermType, name, MAX_NAME_SIZE); + strncat(TermType, name, (size_t) MAX_NAME_SIZE); } } diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c index a1f9f4a8..ed2cfbd4 100644 --- a/ncurses/tinfo/comp_parse.c +++ b/ncurses/tinfo/comp_parse.c @@ -47,7 +47,7 @@ #include -MODULE_ID("$Id: comp_parse.c,v 1.77 2011/10/01 22:43:51 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.78 2011/10/22 16:19:19 tom Exp $") static void sanity_check2(TERMTYPE *, bool); NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2; @@ -56,7 +56,7 @@ NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanit static void sanity_check(TERMTYPE *); NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype) (TERMTYPE *) = sanity_check; -static void fixup_acsc(TERMTYPE *, bool); +static void fixup_acsc(TERMTYPE *, int); static void enqueue(ENTRY * ep) @@ -495,7 +495,7 @@ _nc_resolve_uses(bool fullresolve) #define CUR tp-> static void -fixup_acsc(TERMTYPE *tp, bool literal) +fixup_acsc(TERMTYPE *tp, int literal) { if (!literal) { if (acs_chars == 0 diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c index ef604026..17c42df5 100644 --- a/ncurses/tinfo/comp_scan.c +++ b/ncurses/tinfo/comp_scan.c @@ -50,7 +50,7 @@ #include #include -MODULE_ID("$Id: comp_scan.c,v 1.93 2011/08/20 21:19:40 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.94 2011/10/22 15:46:43 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -257,12 +257,12 @@ next_char(void) } static void -push_back(char c) +push_back(int c) /* push a character back onto the input stream */ { if (bufptr == bufstart) _nc_syserr_abort("Can't backspace off beginning of line"); - *--bufptr = c; + *--bufptr = (char) c; _nc_curr_col--; } @@ -782,7 +782,7 @@ _nc_trans_string(char *ptr, char *last) /* allow the digit; it'll do less harm */ } } else { - push_back((char) c); + push_back(c); break; } } @@ -878,7 +878,7 @@ _nc_trans_string(char *ptr, char *last) if (!ignored) { if (_nc_curr_col <= 1) { - push_back((char) c); + push_back(c); c = '\n'; break; } diff --git a/ncurses/tinfo/entries.c b/ncurses/tinfo/entries.c index 036a61b2..30981e5c 100644 --- a/ncurses/tinfo/entries.c +++ b/ncurses/tinfo/entries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2006-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 * @@ -37,7 +37,7 @@ #include -MODULE_ID("$Id: entries.c,v 1.18 2011/10/08 20:32:26 tom Exp $") +MODULE_ID("$Id: entries.c,v 1.19 2011/10/22 16:34:50 tom Exp $") /**************************************************************************** * @@ -141,7 +141,7 @@ _nc_leaks_tinfo(void) #ifdef TRACE trace(0); - _nc_trace_buf(-1, 0); + _nc_trace_buf(-1, (size_t) 0); #endif #endif /* NO_LEAKS */ diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c index 654bf940..e64b2758 100644 --- a/ncurses/tinfo/lib_options.c +++ b/ncurses/tinfo/lib_options.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -46,7 +46,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_options.c,v 1.71 2009/10/24 21:56:15 tom Exp $") +MODULE_ID("$Id: lib_options.c,v 1.72 2011/10/22 16:31:35 tom Exp $") NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) @@ -324,7 +324,7 @@ _nc_putp_flush(const char *name, const char *value) * the terminal state _before_ switching modes. */ NCURSES_EXPORT(int) -_nc_keypad(SCREEN *sp, bool flag) +_nc_keypad(SCREEN *sp, int flag) { int rc = ERR; diff --git a/ncurses/tinfo/lib_print.c b/ncurses/tinfo/lib_print.c index c7bd3a62..e30ceae8 100644 --- a/ncurses/tinfo/lib_print.c +++ b/ncurses/tinfo/lib_print.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -39,7 +39,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_print.c,v 1.20 2010/06/05 22:18:35 tom Exp $") +MODULE_ID("$Id: lib_print.c,v 1.21 2011/10/22 16:34:50 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len) @@ -77,7 +77,7 @@ NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len) } (void) strcpy(mybuf, switchon); - memcpy(mybuf + onsize, data, (unsigned) len); + memcpy(mybuf + onsize, data, (size_t) len); if (offsize) (void) strcpy(mybuf + onsize + len, prtr_off); diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 9bfe17a8..de4cb459 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -47,7 +47,7 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.141 2011/08/13 16:07:22 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.142 2011/10/22 16:13:06 tom Exp $") /**************************************************************************** * @@ -449,7 +449,7 @@ _nc_setup_tinfo(const char *const tn, TERMTYPE *const tp) ** and substitute it in for the prototype given in 'command_character'. */ void -_nc_tinfo_cmdch(TERMINAL * termp, char proto) +_nc_tinfo_cmdch(TERMINAL * termp, int proto) { unsigned i; char CC; @@ -464,7 +464,7 @@ _nc_tinfo_cmdch(TERMINAL * termp, char proto) CC = *tmp; for_each_string(i, &(termp->type)) { for (tmp = termp->type.Strings[i]; tmp && *tmp; tmp++) { - if (*tmp == proto) + if (UChar(*tmp) == proto) *tmp = CC; } } @@ -560,7 +560,7 @@ TINFO_SETUP_TERM(TERMINAL ** tp, NCURSES_CONST char *tname, int Filedes, int *errret, - bool reuse) + int reuse) { #ifdef USE_TERM_DRIVER TERMINAL_CONTROL_BLOCK *TCB = 0; @@ -680,7 +680,7 @@ TINFO_SETUP_TERM(TERMINAL ** tp, } } #if !USE_REENTRANT - strncpy(ttytype, termp->type.term_names, NAMESIZE - 1); + strncpy(ttytype, termp->type.term_names, (size_t) (NAMESIZE - 1)); ttytype[NAMESIZE - 1] = '\0'; #endif @@ -690,7 +690,7 @@ TINFO_SETUP_TERM(TERMINAL ** tp, set_curterm(termp); if (command_character) - _nc_tinfo_cmdch(termp, *command_character); + _nc_tinfo_cmdch(termp, UChar(*command_character)); /* * If an application calls setupterm() rather than initscr() or @@ -789,7 +789,7 @@ NCURSES_EXPORT(int) _nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, - bool reuse) + int reuse) { int res; TERMINAL *termp; diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c index 0349c940..4d423075 100644 --- a/ncurses/tinfo/lib_termcap.c +++ b/ncurses/tinfo/lib_termcap.c @@ -48,7 +48,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_termcap.c,v 1.75 2011/09/26 22:44:30 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.76 2011/10/22 17:12:41 tom Exp $") NCURSES_EXPORT_VAR(char *) UP = 0; NCURSES_EXPORT_VAR(char *) BC = 0; @@ -203,10 +203,11 @@ static bool same_tcname(const char *a, const char *b) { fprintf(stderr, "compare(%s,%s)\n", a, b); - return !strncmp(a, b, 2); + return !strncmp(a, b, (size_t) 2); } + #else -#define same_tcname(a,b) !strncmp(a,b,2) +#define same_tcname(a,b) !strncmp(a, b, (size_t) 2) #endif /*************************************************************************** diff --git a/ncurses/tinfo/lib_tparm.c b/ncurses/tinfo/lib_tparm.c index b1d79248..53205d17 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.83 2011/05/21 18:11:56 tom Exp $") +MODULE_ID("$Id: lib_tparm.c,v 1.84 2011/10/22 15:48:47 tom Exp $") /* * char * @@ -153,7 +153,7 @@ save_number(const char *fmt, int number, int len) if (len < 30) len = 30; /* actually log10(MAX_INT)+1 */ - get_space((unsigned) len + 1); + get_space((size_t) len + 1); (void) sprintf(TPS(out_buff) + TPS(out_used), fmt, number); TPS(out_used) += strlen(TPS(out_buff) + TPS(out_used)); @@ -164,7 +164,7 @@ save_char(int c) { if (c == 0) c = 0200; - get_space(1); + get_space((size_t) 1); TPS(out_buff)[TPS(out_used)++] = (char) c; } @@ -450,7 +450,7 @@ _nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) } static NCURSES_INLINE char * -tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) +tparam_internal(int use_TPARM_ARG, const char *string, va_list ap) { char *p_is_s[NUM_PARM]; TPARM_ARG param[NUM_PARM]; @@ -757,7 +757,7 @@ tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) cp++; } /* endwhile (*cp) */ - get_space(1); + get_space((size_t) 1); TPS(out_buff)[TPS(out_used)] = '\0'; T((T_RETURN("%s"), _nc_visbuf(TPS(out_buff)))); diff --git a/ncurses/tinfo/lib_tputs.c b/ncurses/tinfo/lib_tputs.c index dc70f3e0..e37e7a13 100644 --- a/ncurses/tinfo/lib_tputs.c +++ b/ncurses/tinfo/lib_tputs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -51,7 +51,7 @@ #include /* ospeed */ #include -MODULE_ID("$Id: lib_tputs.c,v 1.81 2010/12/20 00:42:50 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.82 2011/10/22 16:34:50 tom Exp $") NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ @@ -145,7 +145,7 @@ NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_DCLx int ch) * POSIX says write() is safe in a signal handler, but the * buffered I/O is not. */ - if (write(fileno(NC_OUTPUT(SP_PARM)), &tmp, 1) == -1) + if (write(fileno(NC_OUTPUT(SP_PARM)), &tmp, (size_t) 1) == -1) rc = ERR; } else { if (putc(ch, NC_OUTPUT(SP_PARM)) == EOF) diff --git a/ncurses/tinfo/make_keys.c b/ncurses/tinfo/make_keys.c index a7854e3f..f44f7c77 100644 --- a/ncurses/tinfo/make_keys.c +++ b/ncurses/tinfo/make_keys.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -39,7 +39,7 @@ #define USE_TERMLIB 1 #include -MODULE_ID("$Id: make_keys.c,v 1.19 2010/06/05 22:08:00 tom Exp $") +MODULE_ID("$Id: make_keys.c,v 1.20 2011/10/22 16:34:50 tom Exp $") #include @@ -76,7 +76,7 @@ make_keys(FILE *ifp, FILE *ofp) unsigned maxlen = 16; int scanned; - while (fgets(buffer, sizeof(buffer), ifp) != 0) { + while (fgets(buffer, (int) sizeof(buffer), ifp) != 0) { if (*buffer == '#') continue; diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c index a237d60d..44a42d6f 100644 --- a/ncurses/tinfo/read_entry.c +++ b/ncurses/tinfo/read_entry.c @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: read_entry.c,v 1.116 2011/09/27 00:35:20 tom Exp $") +MODULE_ID("$Id: read_entry.c,v 1.117 2011/10/22 15:30:24 tom Exp $") #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) @@ -99,7 +99,7 @@ fake_read(char *src, int *offset, int limit, char *dst, unsigned want) if (have > 0) { if ((int) want > have) want = (unsigned) have; - memcpy(dst, src + *offset, want); + memcpy(dst, src + *offset, (size_t) want); *offset += (int) want; } else { want = 0; @@ -107,10 +107,10 @@ fake_read(char *src, int *offset, int limit, char *dst, unsigned want) return (int) want; } -#define Read(buf, count) fake_read(buffer, &offset, limit, buf, count) +#define Read(buf, count) fake_read(buffer, &offset, limit, buf, (unsigned) count) #define read_shorts(buf, count) \ - (Read(buf, (unsigned) (count)*2) == (int) (count)*2) + (Read(buf, (count)*2) == (int) (count)*2) #define even_boundary(value) \ if ((value) % 2 != 0) Read(buf, 1) @@ -175,7 +175,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) ptr->str_table = string_table; ptr->term_names = string_table; if ((have = (unsigned) Read(ptr->term_names, want)) != want) { - memset(ptr->term_names + have, 0, want - have); + memset(ptr->term_names + have, 0, (size_t) (want - have)); } ptr->term_names[want] = '\0'; string_table += (want + 1); diff --git a/ncurses/tinfo/setbuf.c b/ncurses/tinfo/setbuf.c index a2e2660c..75b952fb 100644 --- a/ncurses/tinfo/setbuf.c +++ b/ncurses/tinfo/setbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: setbuf.c,v 1.16 2010/08/28 21:08:31 tom Exp $") +MODULE_ID("$Id: setbuf.c,v 1.17 2011/10/22 16:34:50 tom Exp $") /* * If the output file descriptor is connected to a tty (the typical case) it @@ -100,7 +100,7 @@ MODULE_ID("$Id: setbuf.c,v 1.16 2010/08/28 21:08:31 tom Exp $") * buffer. So we disable this by default (there may yet be a workaround). */ NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered) +NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, int buffered) { int Cols; int Lines; @@ -149,7 +149,7 @@ NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered) #ifdef SETVBUF_REVERSED /* pre-svr3? */ (void) setvbuf(ofp, buf_ptr, buf_len, buf_len ? _IOFBF : _IOLBF); #else - (void) setvbuf(ofp, buf_ptr, buf_len ? _IOFBF : _IOLBF, buf_len); + (void) setvbuf(ofp, buf_ptr, buf_len ? _IOFBF : _IOLBF, (size_t) buf_len); #endif #elif HAVE_SETBUFFER (void) setbuffer(ofp, buf_ptr, (int) buf_len); @@ -162,7 +162,7 @@ NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered) #if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_set_buffer(FILE *ofp, bool buffered) +_nc_set_buffer(FILE *ofp, int buffered) { NCURSES_SP_NAME(_nc_set_buffer) (CURRENT_SCREEN, ofp, buffered); } diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c index 589df2e0..e97eff6f 100644 --- a/ncurses/tinfo/tinfo_driver.c +++ b/ncurses/tinfo/tinfo_driver.c @@ -50,7 +50,7 @@ # endif #endif -MODULE_ID("$Id: tinfo_driver.c,v 1.15 2011/08/13 16:11:15 tom Exp $") +MODULE_ID("$Id: tinfo_driver.c,v 1.16 2011/10/22 17:50:33 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -145,7 +145,7 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret) } result = TRUE; #if !USE_REENTRANT - strncpy(ttytype, termp->type.term_names, NAMESIZE - 1); + strncpy(ttytype, termp->type.term_names, (size_t) NAMESIZE - 1); ttytype[NAMESIZE - 1] = '\0'; #endif @@ -173,7 +173,7 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret) } static int -drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, bool beepFlag) +drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, int beepFlag) { SCREEN *sp; int res = ERR; @@ -271,7 +271,7 @@ drv_defaultcolors(TERMINAL_CONTROL_BLOCK * TCB, int fg, int bg) static void drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB, - bool fore, + int fore, int color, NCURSES_SP_OUTC outc) { @@ -457,7 +457,7 @@ drv_setsize(TERMINAL_CONTROL_BLOCK * TCB, int l, int c) } static int -drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf) +drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, int setFlag, TTY * buf) { SCREEN *sp = TCB->csp; TERMINAL *_term = (TERMINAL *) TCB; @@ -491,7 +491,7 @@ drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf) } static int -drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag) +drv_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag) { SCREEN *sp; TERMINAL *_term = (TERMINAL *) TCB; @@ -622,7 +622,7 @@ drv_init(TERMINAL_CONTROL_BLOCK * TCB) trm = (TERMINAL *) TCB; sp = TCB->csp; - TCB->info.initcolor = initialize_color; + TCB->info.initcolor = VALID_STRING(initialize_color); TCB->info.canchange = can_change; TCB->info.hascolor = ((VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs) && (((set_foreground != NULL) @@ -659,7 +659,7 @@ drv_init(TERMINAL_CONTROL_BLOCK * TCB) #define InPalette(n) ((n) >= 0 && (n) < MAX_PALETTE) static void -drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, short pair, short f, short b) +drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, int pair, int f, int b) { SCREEN *sp; @@ -706,7 +706,7 @@ default_bg(SCREEN *sp) static void drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB, - short color, short r, short g, short b) + int color, int r, int g, int b) { SCREEN *sp = TCB->csp; @@ -720,9 +720,9 @@ drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB, static void drv_do_color(TERMINAL_CONTROL_BLOCK * TCB, - short old_pair, - short pair, - bool reverse, + int old_pair, + int pair, + int reverse, NCURSES_SP_OUTC outc) { SCREEN *sp = TCB->csp; @@ -893,7 +893,7 @@ drv_hwlabel(TERMINAL_CONTROL_BLOCK * TCB, int labnum, char *text) } static void -drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, bool OnFlag) +drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, int OnFlag) { SCREEN *sp = TCB->csp; @@ -1170,7 +1170,7 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) if ((pthread_self) && (pthread_kill) && (pthread_equal)) _nc_globals.read_thread = pthread_self(); # endif - n = read(sp->_ifd, &c2, 1); + n = read(sp->_ifd, &c2, (size_t) 1); #if USE_PTHREADS_EINTR _nc_globals.read_thread = 0; #endif @@ -1219,7 +1219,7 @@ __nc_putp_flush(SCREEN *sp, const char *name, const char *value) } static int -drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag) +drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, int flag) { int ret = ERR; SCREEN *sp; @@ -1245,7 +1245,7 @@ drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag) } static int -drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int c, bool flag) +drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int c, int flag) { SCREEN *sp; int code = ERR; @@ -1258,7 +1258,8 @@ drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int c, bool flag) if (c >= 0) { unsigned ch = (unsigned) c; if (flag) { - while ((s = _nc_expand_try(sp->_key_ok, ch, &count, 0)) != 0 + while ((s = _nc_expand_try(sp->_key_ok, + ch, &count, (size_t) 0)) != 0 && _nc_remove_key(&(sp->_key_ok), ch)) { code = _nc_add_to_try(&(sp->_keytry), s, ch); free(s); @@ -1267,7 +1268,8 @@ drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int c, bool flag) break; } } else { - while ((s = _nc_expand_try(sp->_keytry, ch, &count, 0)) != 0 + while ((s = _nc_expand_try(sp->_keytry, + ch, &count, (size_t) 0)) != 0 && _nc_remove_key(&(sp->_keytry), ch)) { code = _nc_add_to_try(&(sp->_key_ok), s, ch); free(s); diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index a14feedf..3f6eebfc 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.80 2011/08/13 20:52:40 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.81 2011/10/22 15:33:37 tom Exp $") static int total_written; @@ -70,7 +70,7 @@ write_file(char *filename, TERMTYPE *tp) DEBUG(1, ("Created %s", filename)); if (write_object(tp, buffer, &offset, limit) == ERR - || fwrite(buffer, sizeof(char), offset, fp) != offset) { + || fwrite(buffer, sizeof(char), (size_t) offset, fp) != offset) { _nc_syserr_abort("error writing %s/%s", _nc_tic_dir(0), filename); } @@ -109,7 +109,7 @@ check_writeable(int code) #endif /* !USE_HASHED_DB */ static int -make_db_path(char *dst, const char *src, unsigned limit) +make_db_path(char *dst, const char *src, size_t limit) { int rc = -1; const char *top = _nc_tic_dir(0); @@ -131,9 +131,9 @@ make_db_path(char *dst, const char *src, unsigned limit) rc = -1; } else { static const char suffix[] = DBM_SUFFIX; - unsigned have = strlen(dst); - unsigned need = strlen(suffix); - if (have > need && strcmp(dst + have - need, suffix)) { + size_t have = strlen(dst); + size_t need = strlen(suffix); + if (have > need && strcmp(dst + (int) (have - need), suffix)) { if (have + need <= limit) strcat(dst, suffix); else @@ -484,7 +484,7 @@ fake_write(char *dst, return (want / size); } -#define Write(buf, size, count) fake_write(buffer, offset, limit, (char *) buf, count, size) +#define Write(buf, size, count) fake_write(buffer, offset, (size_t) limit, (char *) buf, (size_t) count, (size_t) size) #undef LITTLE_ENDIAN /* BSD/OS defines this as a feature macro */ #define HI(x) ((x) / 256) @@ -699,7 +699,7 @@ write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) return (ERR); nextfree = compute_offsets(tp->Strings + STRCOUNT, - tp->ext_Strings, + (size_t) tp->ext_Strings, offsets); TRACE_OUT(("after extended string capabilities, nextfree=%d", nextfree)); @@ -707,7 +707,7 @@ write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) return (ERR); nextfree += compute_offsets(tp->ext_Names, - extcnt, + (size_t) extcnt, offsets + tp->ext_Strings); TRACE_OUT(("after extended capnames, nextfree=%d", nextfree)); strmax = tp->ext_Strings + extcnt; @@ -735,7 +735,7 @@ write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) TRACE_OUT(("WRITE %d numbers @%d", tp->ext_Numbers, *offset)); if (tp->ext_Numbers) { - convert_shorts(buf, tp->Numbers + NUMCOUNT, tp->ext_Numbers); + convert_shorts(buf, tp->Numbers + NUMCOUNT, (size_t) tp->ext_Numbers); if (Write(buf, 2, tp->ext_Numbers) != tp->ext_Numbers) return (ERR); } diff --git a/ncurses/trace/lib_trace.c b/ncurses/trace/lib_trace.c index a726901d..7a8e6a9e 100644 --- a/ncurses/trace/lib_trace.c +++ b/ncurses/trace/lib_trace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -47,7 +47,7 @@ #include -MODULE_ID("$Id: lib_trace.c,v 1.76 2010/12/19 01:21:19 tom Exp $") +MODULE_ID("$Id: lib_trace.c,v 1.77 2011/10/22 16:34:50 tom Exp $") NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ @@ -121,7 +121,7 @@ trace(const unsigned int tracelevel) * end of each line. This is useful in case the program dies. */ #if HAVE_SETVBUF /* ANSI */ - (void) setvbuf(TraceFP, (char *) 0, _IOLBF, 0); + (void) setvbuf(TraceFP, (char *) 0, _IOLBF, (size_t) 0); #elif HAVE_SETBUF /* POSIX */ (void) setbuffer(TraceFP, (char *) 0); #endif @@ -218,7 +218,7 @@ _tracef(const char *fmt,...) /* Trace 'bool' return-values */ NCURSES_EXPORT(NCURSES_BOOL) -_nc_retrace_bool(NCURSES_BOOL code) +_nc_retrace_bool(int code) { T((T_RETURN("%s"), code ? "TRUE" : "FALSE")); return code; @@ -226,7 +226,7 @@ _nc_retrace_bool(NCURSES_BOOL code) /* Trace 'char' return-values */ NCURSES_EXPORT(char) -_nc_retrace_char(char code) +_nc_retrace_char(int code) { T((T_RETURN("%c"), code)); return code; diff --git a/ncurses/trace/lib_traceatr.c b/ncurses/trace/lib_traceatr.c index 6bbcc623..8abc1c6a 100644 --- a/ncurses/trace/lib_traceatr.c +++ b/ncurses/trace/lib_traceatr.c @@ -43,7 +43,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_traceatr.c,v 1.75 2011/05/28 22:56:56 tom Exp $") +MODULE_ID("$Id: lib_traceatr.c,v 1.76 2011/10/22 15:39:21 tom Exp $") #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name)) @@ -120,7 +120,7 @@ _traceattr2(int bufnum, chtype newmode) ; size_t n; char temp[80]; - char *result = _nc_trace_buf(bufnum, BUFSIZ); + char *result = _nc_trace_buf(bufnum, (size_t) BUFSIZ); if (result != 0) { unsigned save_nc_tracing = _nc_tracing; @@ -271,7 +271,7 @@ NCURSES_EXPORT(char *) _tracechtype2(int bufnum, chtype ch) { const char *found; - char *result = _nc_trace_buf(bufnum, BUFSIZ); + char *result = _nc_trace_buf(bufnum, (size_t) BUFSIZ); if (result != 0) { strcpy(result, l_brace); @@ -311,7 +311,7 @@ _nc_retrace_chtype(chtype code) NCURSES_EXPORT(char *) _tracecchar_t2(int bufnum, const cchar_t *ch) { - char *result = _nc_trace_buf(bufnum, BUFSIZ); + char *result = _nc_trace_buf(bufnum, (size_t) BUFSIZ); attr_t attr; const char *found; diff --git a/ncurses/trace/trace_buf.c b/ncurses/trace/trace_buf.c index 46baba47..3768d098 100644 --- a/ncurses/trace/trace_buf.c +++ b/ncurses/trace/trace_buf.c @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: trace_buf.c,v 1.17 2011/01/22 19:48:16 tom Exp $") +MODULE_ID("$Id: trace_buf.c,v 1.18 2011/10/22 15:46:06 tom Exp $") #ifdef TRACE @@ -103,7 +103,7 @@ _nc_trace_buf(int bufnum, size_t want) NCURSES_EXPORT(char *) _nc_trace_bufcat(int bufnum, const char *value) { - char *buffer = _nc_trace_alloc(bufnum, 0); + char *buffer = _nc_trace_alloc(bufnum, (size_t) 0); if (buffer != 0) { size_t have = strlen(buffer); diff --git a/ncurses/trace/visbuf.c b/ncurses/trace/visbuf.c index 66da4f4b..6922d3e2 100644 --- a/ncurses/trace/visbuf.c +++ b/ncurses/trace/visbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2001-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 * @@ -42,7 +42,7 @@ #include #include -MODULE_ID("$Id: visbuf.c,v 1.37 2010/05/29 18:51:41 tom Exp $") +MODULE_ID("$Id: visbuf.c,v 1.38 2011/10/22 16:34:50 tom Exp $") #define NUM_VISBUFS 4 @@ -261,7 +261,7 @@ _nc_viswibuf(const wint_t *buf) NCURSES_EXPORT(const char *) _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) { - char *result = _nc_trace_buf(bufnum, BUFSIZ); + char *result = _nc_trace_buf(bufnum, (size_t) BUFSIZ); int first; const char *found; diff --git a/ncurses/tty/hashmap.c b/ncurses/tty/hashmap.c index b670e1b9..4a723865 100644 --- a/ncurses/tty/hashmap.c +++ b/ncurses/tty/hashmap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -73,7 +73,7 @@ AUTHOR #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: hashmap.c,v 1.62 2010/04/24 23:46:07 tom Exp $") +MODULE_ID("$Id: hashmap.c,v 1.63 2011/10/22 16:34:50 tom Exp $") #ifdef HASHDEBUG @@ -163,7 +163,7 @@ update_cost_from_blank(SCREEN *sp, NCURSES_CH_T * to) * effective. 'blank' indicates whether the line 'to' would become blank. */ static NCURSES_INLINE bool -cost_effective(SCREEN *sp, const int from, const int to, const bool blank) +cost_effective(SCREEN *sp, const int from, const int to, const int blank) { int new_from; diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index ad41f8dd..8de26c4f 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -159,7 +159,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mvcur.c,v 1.126 2011/01/22 19:48:21 tom Exp $") +MODULE_ID("$Id: lib_mvcur.c,v 1.127 2011/10/22 16:09:52 tom Exp $") #define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */ @@ -549,7 +549,7 @@ relative_move(NCURSES_SP_DCLx int from_x, int to_y, int to_x, - bool ovw) + int ovw) /* move via local motions (cuu/cuu1/cud/cud1/cub1/cub/cuf1/cuf/vpa/hpa) */ { string_desc save; @@ -770,7 +770,7 @@ relative_move(NCURSES_SP_DCLx */ static NCURSES_INLINE int -onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw) +onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, int ovw) /* onscreen move from (yold, xold) to (ynew, xnew) */ { string_desc result; diff --git a/ncurses/tty/lib_tstp.c b/ncurses/tty/lib_tstp.c index 583ee0fd..36043f8a 100644 --- a/ncurses/tty/lib_tstp.c +++ b/ncurses/tty/lib_tstp.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_tstp.c,v 1.44 2011/06/25 21:22:16 tom Exp $") +MODULE_ID("$Id: lib_tstp.c,v 1.45 2011/10/22 15:37:42 tom Exp $") #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC) #define USE_SIGTSTP 1 @@ -363,7 +363,7 @@ CatchIfDefault(int sig, RETSIGTYPE (*handler) (int)) * the caller later changes its mind, but that doesn't seem correct. */ NCURSES_EXPORT(void) -_nc_signal_handler(bool enable) +_nc_signal_handler(int enable) { T((T_CALLED("_nc_signal_handler(%d)"), enable)); #if USE_SIGTSTP /* Xenix 2.x doesn't have SIGTSTP, for example */ diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c index 329ec29a..023ba70b 100644 --- a/ncurses/tty/lib_twait.c +++ b/ncurses/tty/lib_twait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -70,10 +70,10 @@ #endif #undef CUR -MODULE_ID("$Id: lib_twait.c,v 1.61 2010/12/25 23:43:58 tom Exp $") +MODULE_ID("$Id: lib_twait.c,v 1.62 2011/10/22 16:34:50 tom Exp $") static long -_nc_gettime(TimeType * t0, bool first) +_nc_gettime(TimeType * t0, int first) { long res; @@ -247,7 +247,7 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED, } #endif - result = poll(fds, (unsigned) count, milliseconds); + result = poll(fds, (size_t) count, milliseconds); #ifdef NCURSES_WGETCH_EVENTS if ((mode & TW_EVENT) && evl) { diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index 2dc93830..c708ca60 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -82,7 +82,7 @@ #include -MODULE_ID("$Id: tty_update.c,v 1.265 2011/05/28 21:51:20 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.267 2011/10/22 17:30:14 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -342,7 +342,7 @@ check_pending(NCURSES_SP_DCL0) struct pollfd fds[1]; fds[0].fd = SP_PARM->_checkfd; fds[0].events = POLLIN; - if (poll(fds, 1, 0) > 0) { + if (poll(fds, (size_t) 1, 0) > 0) { have_pending = TRUE; } #elif defined(__BEOS__) @@ -1079,7 +1079,7 @@ ClrUpdate(NCURSES_SP_DCL0) */ static void -ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, bool needclear) +ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, int needclear) { int j; diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c index 0a1fe82f..ac1b8eca 100644 --- a/ncurses/widechar/lib_cchar.c +++ b/ncurses/widechar/lib_cchar.c @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: lib_cchar.c,v 1.23 2011/07/23 21:31:51 David.Benjamin Exp $") +MODULE_ID("$Id: lib_cchar.c,v 1.24 2011/10/22 15:52:36 tom Exp $") /* * The SuSv2 description leaves some room for interpretation. We'll assume wch @@ -111,7 +111,7 @@ getcchar(const cchar_t *wcval, opts)); if (opts == NULL && wcval != NULL) { - len = ((wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) + len = ((wp = wmemchr(wcval->chars, L'\0', (size_t) CCHARW_MAX)) ? (int) (wp - wcval->chars) : CCHARW_MAX); @@ -126,7 +126,7 @@ getcchar(const cchar_t *wcval, } else if (len >= 0) { *attrs = AttrOf(*wcval) & A_ATTRIBUTES; *color_pair = (short) GetPair(*wcval); - wmemcpy(wch, wcval->chars, (unsigned) len); + wmemcpy(wch, wcval->chars, (size_t) len); wch[len] = L'\0'; code = OK; } diff --git a/ncurses/widechar/lib_get_wstr.c b/ncurses/widechar/lib_get_wstr.c index 0b450211..27cdae0c 100644 --- a/ncurses/widechar/lib_get_wstr.c +++ b/ncurses/widechar/lib_get_wstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 2002-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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_get_wstr.c,v 1.12 2009/10/24 22:38:11 tom Exp $") +MODULE_ID("$Id: lib_get_wstr.c,v 1.13 2011/10/22 16:31:35 tom Exp $") static int wadd_wint(WINDOW *win, wint_t *src) @@ -49,7 +49,7 @@ wadd_wint(WINDOW *win, wint_t *src) wch[0] = (wchar_t) (*src); wch[1] = 0; - setcchar(&tmp, wch, A_NORMAL, 0, NULL); + setcchar(&tmp, wch, A_NORMAL, (short) 0, NULL); return wadd_wch(win, &tmp); } @@ -58,7 +58,7 @@ wadd_wint(WINDOW *win, wint_t *src) * or other character, and handles reverse wraparound. */ static wint_t * -WipeOut(WINDOW *win, int y, int x, wint_t *first, wint_t *last, bool echoed) +WipeOut(WINDOW *win, int y, int x, wint_t *first, wint_t *last, int echoed) { if (last > first) { *--last = '\0'; diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c index 1eee8a3e..2aa71a50 100644 --- a/ncurses/widechar/lib_ins_wch.c +++ b/ncurses/widechar/lib_ins_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2002-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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_ins_wch.c,v 1.16 2010/12/19 01:34:04 tom Exp $") +MODULE_ID("$Id: lib_ins_wch.c,v 1.17 2011/10/22 16:34:50 tom Exp $") /* * Insert the given character, updating the current location to simplify @@ -132,7 +132,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) (void) setcchar(&tmp_cchar, &tmp_wchar, WA_NORMAL, - 0, + (short) 0, (void *) 0); code = _nc_insert_wch(win, &tmp_cchar); } else { diff --git a/ncurses/widechar/lib_slk_wset.c b/ncurses/widechar/lib_slk_wset.c index c76c0f84..89275567 100644 --- a/ncurses/widechar/lib_slk_wset.c +++ b/ncurses/widechar/lib_slk_wset.c @@ -40,7 +40,7 @@ #include #endif -MODULE_ID("$Id: lib_slk_wset.c,v 1.12 2011/05/28 22:46:34 tom Exp $") +MODULE_ID("$Id: lib_slk_wset.c,v 1.13 2011/10/22 15:52:20 tom Exp $") NCURSES_EXPORT(int) slk_wset(int i, const wchar_t *astr, int format) @@ -56,7 +56,7 @@ slk_wset(int i, const wchar_t *astr, int format) if (astr != 0) { init_mb(state); str = astr; - if ((arglen = wcsrtombs(NULL, &str, 0, &state)) != (size_t) -1) { + if ((arglen = wcsrtombs(NULL, &str, (size_t) 0, &state)) != (size_t) -1) { if ((mystr = (char *) _nc_doalloc(0, arglen + 1)) != 0) { str = astr; if (wcsrtombs(mystr, &str, arglen, &state) != (size_t) -1) { diff --git a/ncurses/widechar/lib_unget_wch.c b/ncurses/widechar/lib_unget_wch.c index 7a626a9e..d5ae608e 100644 --- a/ncurses/widechar/lib_unget_wch.c +++ b/ncurses/widechar/lib_unget_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2002-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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_unget_wch.c,v 1.14 2010/07/24 11:35:21 tom Exp $") +MODULE_ID("$Id: lib_unget_wch.c,v 1.15 2011/10/22 16:34:50 tom Exp $") /* * Wrapper for wcrtomb() which obtains the length needed for the given @@ -55,7 +55,7 @@ _nc_wcrtomb(char *target, wchar_t source, mbstate_t * state) const wchar_t *tempp = temp; temp[0] = source; temp[1] = 0; - result = (int) wcsrtombs(NULL, &tempp, 0, state); + result = (int) wcsrtombs(NULL, &tempp, (size_t) 0, state); } else { result = (int) wcrtomb(target, source, state); } -- 2.44.0