From: Thomas E. Dickey Date: Sun, 26 Dec 2010 01:22:11 +0000 (+0000) Subject: ncurses 5.7 - patch 20101225 X-Git-Tag: v5.8~8 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=f79b52fddd95c7a6f1ead29ef9c39eb8cdf60795 ncurses 5.7 - patch 20101225 + modify nc_tparm.h, adding guards against repeated inclusion, and allowing TPARM_ARG to be overridden. + fix some strict compiler warnings in ncurses library. --- diff --git a/NEWS b/NEWS index 0dacd15c..2842dafb 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.1621 2010/12/11 23:42:36 tom Exp $ +-- $Id: NEWS,v 1.1624 2010/12/25 23:56:36 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,11 @@ 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. +20101225 + + modify nc_tparm.h, adding guards against repeated inclusion, and + allowing TPARM_ARG to be overridden. + + fix some strict compiler warnings in ncurses library. + 20101211 + suppress ncv in screen entry, allowing underline (patch by Alejandro R Sedeno). diff --git a/README.MinGW b/README.MinGW index 2d405da6..8bc5dad8 100644 --- a/README.MinGW +++ b/README.MinGW @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 2008 Free Software Foundation, Inc. -- +-- Copyright (c) 2008,2010 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 -- @@ -25,28 +25,28 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: README.MinGW,v 1.3 2010/10/02 16:32:41 juergen Exp $ +-- $Id: README.MinGW,v 1.4 2010/12/18 21:07:03 tom Exp $ -- Author: Juergen Pfeifer ------------------------------------------------------------------------------- This is work in progress, but it's in an state where one can see it works at least on the Windows Console. -You should install the MSYS package, so that you've a shell environment -that allows you to run the scripts, especially configure etc. You can get -that from http://www.mingw.org - -To build ncurses for native Windows, you need the MinGW toolchain. The -original MinGW toolchain from above site is only for 32-Bit Windows. As -Windows Server - and even more and more regular workstations - are moving -to 64-Bit, it seems to be reasonable to have a toolchain that supports -both architectures. I recommend to use the TDM gcc toolchain which you -can find at http://tdm-gcc.tdragon.net/download. Go to the download section -and select the bundle installer for tdm64 (MinGW-w64). This installs a -multilib version of the gcc toolchain that can compile for native 32- and -64-Bit Windows versions. It also comes with a working pthread implementation. - -The latest config and build scripts we use for MinGW have only be tested +You should install the MSYS package, so that you've a shell environment that +allows you to run the scripts, especially configure etc. You can get that +from http://www.mingw.org + +To build ncurses for native Windows, you need the MinGW toolchain. The +original MinGW toolchain from the above site is only for 32-Bit Windows. As +Windows Server - and also regular workstations - are moving to 64-Bit, it +seems to be reasonable to have a toolchain that supports both architectures. +I recommend to use the TDM gcc toolchain which you can find at +http://tdm-gcc.tdragon.net/download. Go to the download section and select +the bundle installer for tdm64 (MinGW-w64). This installs a multilib version +of the gcc toolchain that can compile for native 32- and 64-Bit Windows +versions. It also comes with a working pthread implementation. + +The latest config and build scripts we use for MinGW have only been tested for the gcc-4.4 compiler toolchain (or better). Using MinGW is a pragmatic decision, it's the easiest way to port this @@ -65,8 +65,8 @@ It contains the LIB.EXE tool. You may also use this compiler to test writing native Windows programs using the ncurses DLLs without using MinGW then for writing apps. -Please unset the TERM environment variable, so that the Console driver -gets activated. +It is necessary to unset the TERM environment variable, to activate the +Windows console-driver. Please also make sure that MSYS links to the correct directory containing your MinGW toolchain. For TDM this is usually C:\MinGW64. In your Windows @@ -91,13 +91,39 @@ recommend to use these options with configure This is the configuration commandline as I'm using it at the moment: -./configure --prefix=/mingw --without-cxx-binding --without-ada --enable-warnings --enable-assertions --enable-reentrant --with-debug --with-normal --disable-home-terminfo --enable-sp-funcs --enable-term-driver --enable-interop --with-pthread +./configure \ + --prefix=/mingw \ + --without-cxx-binding \ + --without-ada \ + --enable-warnings \ + --enable-assertions \ + --enable-reentrant \ + --with-debug \ + --with-normal \ + --disable-home-terminfo \ + --enable-sp-funcs \ + --enable-term-driver \ + --enable-interop \ + --with-pthread If you are on a 64-Bit Windows system and want to build a 32-Bit version of ncurses, you may use this commandline for configuration (when using the TDM toolchain): -CC="gcc -m32" LD="ld -m32" ./configure --prefix=/mingw --without-cxx-binding --without-ada --enable-warnings --enable-assertions --enable-reentrant --with-debug --with-normal --disable-home-terminfo --enable-sp-funcs --enable-term-driver --enable-interop --with-pthread +CC="gcc -m32" LD="ld -m32" ./configure \ + --prefix=/mingw \ + --without-cxx-binding \ + --without-ada \ + --enable-warnings \ + --enable-assertions \ + --enable-reentrant \ + --with-debug \ + --with-normal \ + --disable-home-terminfo \ + --enable-sp-funcs \ + --enable-term-driver \ + --enable-interop \ + --with-pthread All the options above are - like the whole Windows support - experimental. @@ -106,10 +132,8 @@ In order to build the DLLs, after your regular make you must call make dlls - A lot is still TODO, e.g.: - - Mouse support for the Console - Wide Character support The Win32Con driver should actually only use Unicode in the future. diff --git a/dist.mk b/dist.mk index 5e004ee7..dc6fe080 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.785 2010/12/11 17:04:22 tom Exp $ +# $Id: dist.mk,v 1.787 2010/12/25 23:56:22 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 = 7 -NCURSES_PATCH = 20101211 +NCURSES_PATCH = 20101225 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/curses.h.in b/include/curses.h.in index 2ad68f1f..fc714f67 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -32,7 +32,7 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: curses.h.in,v 1.215 2010/04/29 09:46:38 tom Exp $ */ +/* $Id: curses.h.in,v 1.218 2010/12/25 23:39:07 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -1097,7 +1097,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* /* It seems older SYSV curses versions define these */ #if !NCURSES_OPAQUE -#define getattrs(win) ((win) ? (win)->_attrs : A_NORMAL) +#define getattrs(win) NCURSES_CAST(int, (win) ? (win)->_attrs : A_NORMAL) #define getcurx(win) ((win) ? (win)->_curx : ERR) #define getcury(win) ((win) ? (win)->_cury : ERR) #define getbegx(win) ((win) ? (win)->_begx : ERR) @@ -1118,12 +1118,12 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* #if defined(NCURSES_WIDECHAR) && @NCURSES_EXT_COLORS@ #define wattrset(win,at) ((win) \ ? ((win)->_color = PAIR_NUMBER(at), \ - (win)->_attrs = (at), \ + (win)->_attrs = NCURSES_CAST(attr_t, at), \ OK) \ : ERR) #else #define wattrset(win,at) ((win) \ - ? ((win)->_attrs = (at), \ + ? ((win)->_attrs = NCURSES_CAST(attr_t, at), \ OK) \ : ERR) #endif @@ -1155,7 +1155,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* * These apply to the first 256 color pairs. */ #define COLOR_PAIR(n) NCURSES_BITS(n, 0) -#define PAIR_NUMBER(a) (NCURSES_CAST(int,(((a) & A_COLOR) >> NCURSES_ATTR_SHIFT))) +#define PAIR_NUMBER(a) (NCURSES_CAST(int,((NCURSES_CAST(unsigned long,a) & A_COLOR) >> NCURSES_ATTR_SHIFT))) /* * pseudo functions for standard screen diff --git a/include/nc_tparm.h b/include/nc_tparm.h index d1d769be..a8dbcacb 100644 --- a/include/nc_tparm.h +++ b/include/nc_tparm.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006 Free Software Foundation, Inc. * + * Copyright (c) 2006,2010 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 * @@ -30,13 +30,19 @@ * Author: Thomas E. Dickey 2006 * ****************************************************************************/ -/* $Id: nc_tparm.h,v 1.4 2006/11/26 00:49:25 tom Exp $ */ +/* $Id: nc_tparm.h,v 1.5 2010/12/25 20:27:22 tom Exp $ */ + +#ifndef NC_TPARM_included +#define NC_TPARM_included 1 /* * Cast parameters past the formatting-string for tparm() to match the * assumption of the varargs code. */ +#ifndef TPARM_ARG #define TPARM_ARG long +#endif + #define TPARM_N(n) (TPARM_ARG)(n) #define TPARM_9(a,b,c,d,e,f,g,h,i,j) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i),TPARM_N(j)) @@ -63,3 +69,5 @@ #define TPARM_1(a,b) TPARM_2(a,b,0) #define TPARM_0(a) TPARM_1(a,0) #endif + +#endif /* NC_TPARM_included */ diff --git a/man/curs_color.3x b/man/curs_color.3x index 9df4c9a9..2f63c848 100644 --- a/man/curs_color.3x +++ b/man/curs_color.3x @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_color.3x,v 1.34 2010/12/04 18:36:44 tom Exp $ +.\" $Id: curs_color.3x,v 1.35 2010/12/20 00:50:58 tom Exp $ .TH curs_color 3X "" .de bP .IP \(bu 4 @@ -180,7 +180,7 @@ X/Open defines no error conditions. This implementation will return \fBERR\fR on attempts to use color values outside the range 0 to COLORS\-1 (except for the default colors extension), -or use color pairs outside the range 0 to COLOR_PAIR\-1. +or use color pairs outside the range 0 to COLOR_PAIRS\-1. Color values used in \fBinit_color\fP must be in the range 0 to 1000. An error is returned from all functions if the terminal has not been initialized. diff --git a/mk-dlls.sh.in b/mk-dlls.sh.in index 35a02baa..05c646ae 100644 --- a/mk-dlls.sh.in +++ b/mk-dlls.sh.in @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: mk-dlls.sh.in,v 1.2 2010/10/02 16:34:01 juergen Exp $ +# $Id: mk-dlls.sh.in,v 1.3 2010/12/25 22:25:41 tom Exp $ ############################################################################## # Copyright (c) 2008,2010 Free Software Foundation, Inc. # # # @@ -52,7 +52,7 @@ EOF rm -rf tmp-dll popd echo $ARCH > mingw_arch - echo Building DLLs and Import Librarie for Win${ARCH} + echo Building DLLs and Import Libraries for Win${ARCH} if [ -d lib ]; then cf="-shared" diff --git a/ncurses/base/MKkeyname.awk b/ncurses/base/MKkeyname.awk index abceeea8..bb2599ac 100644 --- a/ncurses/base/MKkeyname.awk +++ b/ncurses/base/MKkeyname.awk @@ -1,4 +1,4 @@ -# $Id: MKkeyname.awk,v 1.44 2010/01/23 17:57:43 tom Exp $ +# $Id: MKkeyname.awk,v 1.45 2010/12/19 01:36:14 tom Exp $ ############################################################################## # Copyright (c) 1999-2009,2010 Free Software Foundation, Inc. # # # @@ -120,7 +120,7 @@ END { print " int j, k;" print " char * bound;" print " TERMTYPE *tp = &(TerminalOf(sp)->type);" - print " int save_trace = _nc_tracing;" + print " unsigned save_trace = _nc_tracing;" print "" print " _nc_tracing = 0; /* prevent recursion via keybound() */" print " for (j = 0; (bound = NCURSES_SP_NAME(keybound)(NCURSES_SP_ARGx c, j)) != 0; ++j) {" diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh index 12a83e04..decf3c6a 100755 --- a/ncurses/base/MKlib_gen.sh +++ b/ncurses/base/MKlib_gen.sh @@ -2,7 +2,7 @@ # # MKlib_gen.sh -- generate sources from curses.h macro definitions # -# ($Id: MKlib_gen.sh,v 1.40 2010/03/30 22:42:16 tom Exp $) +# ($Id: MKlib_gen.sh,v 1.41 2010/12/19 00:39:24 tom Exp $) # ############################################################################## # Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # @@ -264,22 +264,23 @@ $0 !~ /^P_/ { argtype = "" for (i = myfunc; i <= NF; i++) { ch = $i; - if ( ch == "*" ) + if ( ch == "*" ) { pointer = 1; - else if ( ch == "va_list" ) + } else if ( ch == "va_list" ) { va_list = 1; - else if ( ch == "..." ) + } else if ( ch == "..." ) { varargs = 1; - else if ( ch == "char" ) + } else if ( ch == "char" ) { argtype = "char"; - else if ( ch == "int" ) + } else if ( ch == "int" ) { argtype = "int"; - else if ( ch == "short" ) + } else if ( ch == "short" ) { argtype = "short"; - else if ( ch == "chtype" ) + } else if ( ch == "chtype" ) { argtype = "chtype"; - else if ( ch == "attr_t" || ch == "NCURSES_ATTR_T" ) + } else if ( ch == "attr_t" || ch == "NCURSES_ATTR_T" ) { argtype = "attr"; + } if ( ch == "," || ch == ")" ) { if (va_list) { diff --git a/ncurses/base/lib_addstr.c b/ncurses/base/lib_addstr.c index d8190e45..d73ce00a 100644 --- a/ncurses/base/lib_addstr.c +++ b/ncurses/base/lib_addstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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 @@ #include -MODULE_ID("$Id: lib_addstr.c,v 1.50 2009/10/24 23:24:03 tom Exp $") +MODULE_ID("$Id: lib_addstr.c,v 1.51 2010/12/19 01:22:58 tom Exp $") NCURSES_EXPORT(int) waddnstr(WINDOW *win, const char *astr, int n) @@ -107,7 +107,7 @@ waddchnstr(WINDOW *win, const chtype *astr, int n) for (i = 0; i < n && ChCharOf(astr[i]) != '\0'; ++i) { SetChar2(line->text[i + x], astr[i]); } - CHANGED_RANGE(line, x, x + n - 1); + CHANGED_RANGE(line, x, (NCURSES_SIZE_T) (x + n - 1)); _nc_synchook(win); returnCode(code); @@ -193,7 +193,7 @@ wadd_wchnstr(WINDOW *win, const cchar_t *astr, int n) SetWidecExt(line->text[x + j], j); } } - x += len; + x = (NCURSES_SIZE_T) (x + len); end += len - 1; } else { break; diff --git a/ncurses/base/lib_driver.c b/ncurses/base/lib_driver.c index 215fb0ca..40487609 100644 --- a/ncurses/base/lib_driver.c +++ b/ncurses/base/lib_driver.c @@ -33,7 +33,7 @@ #include -MODULE_ID("$Id: lib_driver.c,v 1.2 2010/01/16 21:26:09 tom Exp $") +MODULE_ID("$Id: lib_driver.c,v 1.3 2010/12/20 00:29:17 tom Exp $") typedef struct DriverEntry { const char *name; @@ -56,7 +56,8 @@ _nc_get_driver(TERMINAL_CONTROL_BLOCK * TCB, const char *name, int *errret) TERM_DRIVER *res = (TERM_DRIVER *) 0; TERM_DRIVER *use = 0; - T((T_CALLED("_nc_get_driver(%p, %s, %p)"), TCB, NonNull(name), errret)); + T((T_CALLED("_nc_get_driver(%p, %s, %p)"), + (void *) TCB, NonNull(name), (void *) errret)); assert(TCB != 0); @@ -77,7 +78,7 @@ _nc_get_driver(TERMINAL_CONTROL_BLOCK * TCB, const char *name, int *errret) NCURSES_EXPORT(int) NCURSES_SP_NAME(has_key) (SCREEN *sp, int keycode) { - T((T_CALLED("has_key(%p, %d)"), sp, keycode)); + T((T_CALLED("has_key(%p, %d)"), (void *) sp, keycode)); returnCode(IsValidTIScreen(sp) ? CallDriver_1(sp, kyExist, keycode) : FALSE); } @@ -108,7 +109,7 @@ NCURSES_SP_NAME(doupdate) (SCREEN *sp) { int code = ERR; - T((T_CALLED("doupdate(%p)"), sp)); + T((T_CALLED("doupdate(%p)"), (void *) sp)); if (IsValidScreen(sp)) code = CallDriver(sp, update); @@ -127,7 +128,7 @@ NCURSES_SP_NAME(mvcur) (SCREEN *sp, int yold, int xold, int ynew, int xnew) { int code = ERR; TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("mvcur(%p,%d,%d,%d,%d)"), - sp, yold, xold, ynew, xnew)); + (void *) sp, yold, xold, ynew, xnew)); if (HasTerminal(sp)) { code = CallDriver_4(sp, hwcur, yold, xold, ynew, xnew); } diff --git a/ncurses/base/lib_getch.c b/ncurses/base/lib_getch.c index e0d1803f..130c5024 100644 --- a/ncurses/base/lib_getch.c +++ b/ncurses/base/lib_getch.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_getch.c,v 1.120 2010/08/28 20:58:29 tom Exp $") +MODULE_ID("$Id: lib_getch.c,v 1.121 2010/12/25 23:24:04 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 = read(sp->_ifd, &c2, 1); + n = (int) read(sp->_ifd, &c2, 1); #if USE_PTHREADS_EINTR _nc_globals.read_thread = 0; #endif diff --git a/ncurses/base/lib_hline.c b/ncurses/base/lib_hline.c index 0ff2d5bd..1f038083 100644 --- a/ncurses/base/lib_hline.c +++ b/ncurses/base/lib_hline.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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_hline.c,v 1.12 2009/10/24 22:31:53 tom Exp $") +MODULE_ID("$Id: lib_hline.c,v 1.13 2010/12/19 01:48:39 tom Exp $") NCURSES_EXPORT(int) whline(WINDOW *win, chtype ch, int n) { int code = ERR; - NCURSES_SIZE_T start; - NCURSES_SIZE_T end; + int start; + int end; T((T_CALLED("whline(%p,%s,%d)"), (void *) win, _tracechtype(ch), n)); diff --git a/ncurses/base/lib_inchstr.c b/ncurses/base/lib_inchstr.c index 884ea51f..aebb6d62 100644 --- a/ncurses/base/lib_inchstr.c +++ b/ncurses/base/lib_inchstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * ****************************************************************************/ /* @@ -40,7 +41,7 @@ #include -MODULE_ID("$Id: lib_inchstr.c,v 1.11 2009/10/24 22:49:33 tom Exp $") +MODULE_ID("$Id: lib_inchstr.c,v 1.12 2010/12/20 01:37:41 tom Exp $") NCURSES_EXPORT(int) winchnstr(WINDOW *win, chtype *str, int n) @@ -55,7 +56,7 @@ winchnstr(WINDOW *win, chtype *str, int n) if (win) { for (; (n < 0 || (i < n)) && (win->_curx + i <= win->_maxx); i++) str[i] = - CharOf(win->_line[win->_cury].text[win->_curx + i]) | + (chtype) CharOf(win->_line[win->_cury].text[win->_curx + i]) | AttrOf(win->_line[win->_cury].text[win->_curx + i]); } str[i] = (chtype) 0; diff --git a/ncurses/base/lib_mvwin.c b/ncurses/base/lib_mvwin.c index 37963e40..18d31c13 100644 --- a/ncurses/base/lib_mvwin.c +++ b/ncurses/base/lib_mvwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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_mvwin.c,v 1.17 2009/10/24 22:05:03 tom Exp $") +MODULE_ID("$Id: lib_mvwin.c,v 1.18 2010/12/19 01:22:58 tom Exp $") NCURSES_EXPORT(int) mvwin(WINDOW *win, int by, int bx) @@ -114,7 +114,7 @@ mvwin(WINDOW *win, int by, int bx) * new location. This ensures that if the caller has refreshed another * window at the same location, that this one will be displayed. */ - win->_begy = by; - win->_begx = bx; + win->_begy = (NCURSES_SIZE_T) by; + win->_begx = (NCURSES_SIZE_T) bx; returnCode(touchwin(win)); } diff --git a/ncurses/base/lib_redrawln.c b/ncurses/base/lib_redrawln.c index ad540441..72905f84 100644 --- a/ncurses/base/lib_redrawln.c +++ b/ncurses/base/lib_redrawln.c @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_redrawln.c,v 1.16 2010/05/01 22:10:55 David.Benjamin Exp $") +MODULE_ID("$Id: lib_redrawln.c,v 1.17 2010/12/19 00:03:23 tom Exp $") NCURSES_EXPORT(int) wredrawln(WINDOW *win, int beg, int num) @@ -71,7 +71,7 @@ wredrawln(WINDOW *win, int beg, int num) if (end > win->_maxy + 1) end = win->_maxy + 1; - len = (win->_maxx + 1); + len = (size_t) (win->_maxx + 1); if (len > (size_t) (CurScreen(sp)->_maxx + 1 - win->_begx)) len = (size_t) (CurScreen(sp)->_maxx + 1 - win->_begx); len *= sizeof(CurScreen(sp)->_line[0].text[0]); diff --git a/ncurses/base/lib_refresh.c b/ncurses/base/lib_refresh.c index 01d363f4..8c02086a 100644 --- a/ncurses/base/lib_refresh.c +++ b/ncurses/base/lib_refresh.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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_refresh.c,v 1.43 2009/10/24 22:08:32 tom Exp $") +MODULE_ID("$Id: lib_refresh.c,v 1.44 2010/12/19 01:22:58 tom Exp $") NCURSES_EXPORT(int) wrefresh(WINDOW *win) @@ -77,11 +77,11 @@ wrefresh(WINDOW *win) NCURSES_EXPORT(int) wnoutrefresh(WINDOW *win) { - NCURSES_SIZE_T limit_x; - NCURSES_SIZE_T src_row, src_col; - NCURSES_SIZE_T begx; - NCURSES_SIZE_T begy; - NCURSES_SIZE_T dst_row, dst_col; + int limit_x; + int src_row, src_col; + int begx; + int begy; + int dst_row, dst_col; #if USE_SCROLL_HINTS bool wide; #endif @@ -150,8 +150,8 @@ wnoutrefresh(WINDOW *win) for (src_row = 0, dst_row = begy + win->_yoffset; src_row <= win->_maxy && dst_row <= NewScreen(SP_PARM)->_maxy; src_row++, dst_row++) { - register struct ldat *nline = &(NewScreen(SP_PARM)->_line[dst_row]); - register struct ldat *oline = &win->_line[src_row]; + struct ldat *nline = &(NewScreen(SP_PARM)->_line[dst_row]); + struct ldat *oline = &win->_line[src_row]; if (oline->firstchar != _NOCHANGE) { int last_src = oline->lastchar; @@ -163,7 +163,7 @@ wnoutrefresh(WINDOW *win) dst_col = src_col + begx; if_WIDEC({ - register int j; + int j; /* * Ensure that we will copy complete multi-column characters @@ -204,7 +204,7 @@ wnoutrefresh(WINDOW *win) : win->_maxx); int fix_left = dst_col; int fix_right = last_dst; - register int j; + int j; /* * Check for boundary cases where we may overwrite part of a @@ -281,8 +281,9 @@ wnoutrefresh(WINDOW *win) } if (!win->_leaveok) { - NewScreen(SP_PARM)->_cury = win->_cury + win->_begy + win->_yoffset; - NewScreen(SP_PARM)->_curx = win->_curx + win->_begx; + NewScreen(SP_PARM)->_cury = (NCURSES_SIZE_T) (win->_cury + + win->_begy + win->_yoffset); + NewScreen(SP_PARM)->_curx = (NCURSES_SIZE_T) (win->_curx + win->_begx); } NewScreen(SP_PARM)->_leaveok = win->_leaveok; diff --git a/ncurses/base/lib_scroll.c b/ncurses/base/lib_scroll.c index 454ad5b0..fe4e8080 100644 --- a/ncurses/base/lib_scroll.c +++ b/ncurses/base/lib_scroll.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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,7 +43,7 @@ #include -MODULE_ID("$Id: lib_scroll.c,v 1.27 2009/10/24 22:35:45 tom Exp $") +MODULE_ID("$Id: lib_scroll.c,v 1.28 2010/12/19 01:48:09 tom Exp $") NCURSES_EXPORT(void) _nc_scroll_window(WINDOW *win, @@ -55,7 +55,7 @@ _nc_scroll_window(WINDOW *win, int limit; int line; int j; - size_t to_copy = (size_t) (sizeof(NCURSES_CH_T) * (win->_maxx + 1)); + size_t to_copy = (sizeof(NCURSES_CH_T) * (size_t) (win->_maxx + 1)); TR(TRACE_MOVE, ("_nc_scroll_window(%p, %d, %ld, %ld)", (void *) win, n, (long) top, (long) bottom)); diff --git a/ncurses/base/lib_set_term.c b/ncurses/base/lib_set_term.c index 92b2f14e..df0a276a 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.137 2010/05/01 19:47:51 tom Exp $") +MODULE_ID("$Id: lib_set_term.c,v 1.138 2010/12/20 00:42:20 tom Exp $") #ifdef USE_TERM_DRIVER #define MaxColors InfoOf(sp).maxcolors @@ -314,7 +314,7 @@ NCURSES_SP_NAME(_nc_setupscreen) ( ReturnScreenError(); } - T(("created SP %p", sp)); + T(("created SP %p", (void *) sp)); sp->_next_screen = _nc_screen_chain; _nc_screen_chain = sp; @@ -723,7 +723,7 @@ NCURSES_SP_NAME(_nc_ripoffline) (NCURSES_SP_DCLx int code = ERR; START_TRACE(); - T((T_CALLED("ripoffline(%p,%d,%p)"), (void *) SP_PARM, line, (void *) init)); + T((T_CALLED("ripoffline(%p,%d,%p)"), (void *) SP_PARM, line, init)); #if NCURSES_SP_FUNCS if (SP_PARM != 0 && SP_PARM->_prescreen) diff --git a/ncurses/base/lib_slk.c b/ncurses/base/lib_slk.c index 118db945..7a2eecd9 100644 --- a/ncurses/base/lib_slk.c +++ b/ncurses/base/lib_slk.c @@ -47,7 +47,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_slk.c,v 1.46 2010/06/05 22:37:05 tom Exp $") +MODULE_ID("$Id: lib_slk.c,v 1.47 2010/12/25 22:58:58 tom Exp $") #ifdef USE_TERM_DRIVER #define NumLabels InfoOf(SP_PARM).numlabels @@ -185,7 +185,7 @@ _nc_slk_initialize(WINDOW *stwin, int cols) if (SP_PARM->_slk->maxlen <= 0 || SP_PARM->_slk->labcnt <= 0 || (SP_PARM->_slk->ent = typeCalloc(slk_ent, - (unsigned) SP_PARM->_slk->labcnt)) + (size_t) SP_PARM->_slk->labcnt)) == NULL) returnCode(slk_failed(NCURSES_SP_ARG)); diff --git a/ncurses/base/lib_slkattr.c b/ncurses/base/lib_slkattr.c index 9dd2ec8c..bec11e84 100644 --- a/ncurses/base/lib_slkattr.c +++ b/ncurses/base/lib_slkattr.c @@ -38,7 +38,7 @@ */ #include -MODULE_ID("$Id: lib_slkattr.c,v 1.10 2010/03/31 23:38:02 tom Exp $") +MODULE_ID("$Id: lib_slkattr.c,v 1.11 2010/12/20 01:41:25 tom Exp $") NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(slk_attr) (NCURSES_SP_DCL0) @@ -49,7 +49,7 @@ NCURSES_SP_NAME(slk_attr) (NCURSES_SP_DCL0) attr_t result = AttrOf(SP_PARM->_slk->attr) & ALL_BUT_COLOR; int pair = GetPair(SP_PARM->_slk->attr); - result |= ColorPair(pair); + result |= (attr_t) ColorPair(pair); returnAttr(result); } else returnAttr(0); diff --git a/ncurses/base/lib_slkset.c b/ncurses/base/lib_slkset.c index eba9f816..91483f10 100644 --- a/ncurses/base/lib_slkset.c +++ b/ncurses/base/lib_slkset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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.20 2009/10/24 22:12:21 tom Exp $") +MODULE_ID("$Id: lib_slkset.c,v 1.21 2010/12/25 23:43:58 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_set) (NCURSES_SP_DCLx int i, const char *astr, int format) @@ -94,12 +94,12 @@ NCURSES_SP_NAME(slk_set) (NCURSES_SP_DCLx int i, const char *astr, int format) numcols += wcwidth(wc); p += need; } - numchrs = (p - str); + numchrs = (int) (p - str); #else while (isprint(UChar(*p))) p++; /* The first non-print stops */ - numcols = (p - str); + numcols = (int) (p - str); if (numcols > limit) numcols = limit; numchrs = numcols; diff --git a/ncurses/base/lib_touch.c b/ncurses/base/lib_touch.c index 3f8771a8..8023c705 100644 --- a/ncurses/base/lib_touch.c +++ b/ncurses/base/lib_touch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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,7 +43,7 @@ #include -MODULE_ID("$Id: lib_touch.c,v 1.10 2009/10/24 22:36:29 tom Exp $") +MODULE_ID("$Id: lib_touch.c,v 1.11 2010/12/19 01:22:58 tom Exp $") NCURSES_EXPORT(bool) is_linetouched(WINDOW *win, int line) @@ -85,7 +85,9 @@ wtouchln(WINDOW *win, int y, int n, int changed) if (i > win->_maxy) break; win->_line[i].firstchar = changed ? 0 : _NOCHANGE; - win->_line[i].lastchar = changed ? win->_maxx : _NOCHANGE; + win->_line[i].lastchar = (NCURSES_SIZE_T) (changed + ? win->_maxx + : _NOCHANGE); } returnCode(OK); } diff --git a/ncurses/base/lib_vline.c b/ncurses/base/lib_vline.c index a396e082..2f3148ec 100644 --- a/ncurses/base/lib_vline.c +++ b/ncurses/base/lib_vline.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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_vline.c,v 1.11 2009/10/24 22:36:15 tom Exp $") +MODULE_ID("$Id: lib_vline.c,v 1.12 2010/12/19 01:22:58 tom Exp $") NCURSES_EXPORT(int) wvline(WINDOW *win, chtype ch, int n) { int code = ERR; - NCURSES_SIZE_T row, col; - NCURSES_SIZE_T end; + int row, col; + int end; T((T_CALLED("wvline(%p,%s,%d)"), (void *) win, _tracechtype(ch), n)); diff --git a/ncurses/base/lib_winch.c b/ncurses/base/lib_winch.c index 43c61459..7e75f85b 100644 --- a/ncurses/base/lib_winch.c +++ b/ncurses/base/lib_winch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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,15 +39,15 @@ #include -MODULE_ID("$Id: lib_winch.c,v 1.7 2009/10/24 22:35:54 tom Exp $") +MODULE_ID("$Id: lib_winch.c,v 1.8 2010/12/19 01:22:58 tom Exp $") NCURSES_EXPORT(chtype) winch(WINDOW *win) { T((T_CALLED("winch(%p)"), (void *) win)); if (win != 0) { - returnChtype(CharOf(win->_line[win->_cury].text[win->_curx]) | - AttrOf(win->_line[win->_cury].text[win->_curx])); + returnChtype((chtype) CharOf(win->_line[win->_cury].text[win->_curx]) + | AttrOf(win->_line[win->_cury].text[win->_curx])); } else { returnChtype(0); } diff --git a/ncurses/base/lib_window.c b/ncurses/base/lib_window.c index 5c1171b5..4baa3694 100644 --- a/ncurses/base/lib_window.c +++ b/ncurses/base/lib_window.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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_window.c,v 1.28 2009/12/19 22:01:07 tom Exp $") +MODULE_ID("$Id: lib_window.c,v 1.29 2010/12/19 01:47:22 tom Exp $") NCURSES_EXPORT(void) _nc_synchook(WINDOW *win) @@ -239,7 +239,7 @@ dupwin(WINDOW *win) if (win->_flags & _ISPAD) nwin->_pad = win->_pad; - linesize = (win->_maxx + 1) * sizeof(NCURSES_CH_T); + linesize = (unsigned) (win->_maxx + 1) * sizeof(NCURSES_CH_T); for (i = 0; i <= nwin->_maxy; i++) { memcpy(nwin->_line[i].text, win->_line[i].text, linesize); nwin->_line[i].firstchar = win->_line[i].firstchar; diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 2f54f5f1..3d357777 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -33,9 +33,8 @@ * and: Juergen Pfeifer * ****************************************************************************/ - /* - * $Id: curses.priv.h,v 1.465 2010/08/28 20:56:48 tom Exp $ + * $Id: curses.priv.h,v 1.470 2010/12/25 23:45:09 tom Exp $ * * curses.priv.h * @@ -46,6 +45,7 @@ #ifndef CURSES_PRIV_H #define CURSES_PRIV_H 1 +/* *INDENT-OFF* */ #include @@ -346,7 +346,7 @@ color_t; */ #if 1 #define ColorPair(n) NCURSES_BITS(n, 0) -#define PairNumber(a) (NCURSES_CAST(int,(((a) & A_COLOR) >> NCURSES_ATTR_SHIFT))) +#define PairNumber(a) (NCURSES_CAST(int,(((unsigned long)(a) & A_COLOR) >> NCURSES_ATTR_SHIFT))) #else #define ColorPair(pair) COLOR_PAIR(pair) #define PairNumber(attr) PAIR_NUMBER(attr) @@ -383,11 +383,11 @@ color_t; #define if_EXT_COLORS(stmt) /* nothing */ #define SetPair(value,p) RemAttr(value, A_COLOR), \ - SetAttr(value, AttrOf(value) | (A_COLOR & ColorPair(p))) + SetAttr(value, AttrOf(value) | (A_COLOR & (attr_t) ColorPair(p))) #define GetPair(value) PairNumber(AttrOf(value)) #define GET_WINDOW_PAIR(w) PairNumber(WINDOW_ATTRS(w)) #define SET_WINDOW_PAIR(w,p) WINDOW_ATTRS(w) &= ALL_BUT_COLOR, \ - WINDOW_ATTRS(w) |= (A_COLOR & ColorPair(p)) + WINDOW_ATTRS(w) |= (A_COLOR & (attr_t) ColorPair(p)) #define SameAttrOf(a,b) (AttrOf(a) == AttrOf(b)) #if NCURSES_SP_FUNCS @@ -1175,7 +1175,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; #endif }; -#define WINDOW_EXT(w,m) (((WINDOWLIST *)((char *)(w) - offsetof(WINDOWLIST, win)))->m) +#define WINDOW_EXT(w,m) (((WINDOWLIST *)((void *)((char *)(w) - offsetof(WINDOWLIST, win))))->m) #define SP_PRE_INIT(sp) \ sp->_cursrow = -1; \ @@ -1310,7 +1310,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; #define SetChar(ch,c,a) do { \ NCURSES_CH_T *_cp = &ch; \ memset(_cp, 0, sizeof(ch)); \ - _cp->chars[0] = (c); \ + _cp->chars[0] = (wchar_t) (c); \ _cp->attr = (a); \ if_EXT_COLORS(SetPair(ch, PairNumber(a))); \ } while (0) @@ -1331,8 +1331,8 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; PUTC_ch = (ch).chars[PUTC_i]; \ if (PUTC_ch == L'\0') \ break; \ - PUTC_n = wcrtomb(PUTC_buf, \ - (ch).chars[PUTC_i], &PUT_st); \ + PUTC_n = (int) wcrtomb(PUTC_buf, \ + (ch).chars[PUTC_i], &PUT_st); \ if (PUTC_n <= 0) { \ if (PUTC_ch && is8bits(PUTC_ch) && PUTC_i == 0) \ putc(PUTC_ch,b); \ @@ -1354,7 +1354,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; * zero. Otherwise we can use those bits to tell if a cell is the * first or extension part of a wide character. */ -#define WidecExt(ch) (AttrOf(ch) & A_CHARTEXT) +#define WidecExt(ch) (int) (AttrOf(ch) & A_CHARTEXT) #define isWidecBase(ch) (WidecExt(ch) == 1) #define isWidecExt(ch) (WidecExt(ch) > 1 && WidecExt(ch) < 32) #define SetWidecExt(dst, ext) AttrOf(dst) &= ~A_CHARTEXT, \ @@ -1420,16 +1420,16 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; #define CHANGED_RANGE(line,start,end) \ if (line->firstchar == _NOCHANGE \ || line->firstchar > (start)) \ - line->firstchar = start; \ + line->firstchar = (NCURSES_SIZE_T) start; \ if (line->lastchar == _NOCHANGE \ || line->lastchar < (end)) \ - line->lastchar = end + line->lastchar = (NCURSES_SIZE_T) end #define CHANGED_TO_EOL(line,start,end) \ if (line->firstchar == _NOCHANGE \ || line->firstchar > (start)) \ - line->firstchar = start; \ - line->lastchar = end + line->firstchar = (NCURSES_SIZE_T) start; \ + line->lastchar = (NCURSES_SIZE_T) end #define SIZEOF(v) (sizeof(v)/sizeof(v[0])) @@ -1590,7 +1590,7 @@ extern NCURSES_EXPORT(const char *) _nc_viscbuf (const NCURSES_CH_T *, int); * Workaround for defective implementation of gcc attribute warn_unused_result */ #if defined(__GNUC__) && defined(_FORTIFY_SOURCE) -#define IGNORE_RC(func) errno = func +#define IGNORE_RC(func) errno = (int) func #else #define IGNORE_RC(func) (void) func #endif /* gcc workarounds */ @@ -1615,9 +1615,9 @@ extern NCURSES_EXPORT(void) name (void); \ #define toggle_attr_on(S,at) {\ if (PairNumber(at) > 0) {\ - (S) = ((S) & ALL_BUT_COLOR) | (at);\ + (S) = ((S) & ALL_BUT_COLOR) | (attr_t) (at);\ } else {\ - (S) |= (at);\ + (S) |= (attr_t) (at);\ }\ TR(TRACE_ATTRS, ("new attribute is %s", _traceattr((S))));} @@ -2298,4 +2298,6 @@ extern NCURSES_EXPORT(NCURSES_CONST char *) _nc_unctrl (SCREEN *, chtype); } #endif +/* *INDENT-ON* */ + #endif /* CURSES_PRIV_H */ diff --git a/ncurses/tinfo/MKcaptab.sh b/ncurses/tinfo/MKcaptab.sh index 5b8c4bcd..4d1b53a5 100755 --- a/ncurses/tinfo/MKcaptab.sh +++ b/ncurses/tinfo/MKcaptab.sh @@ -1,6 +1,6 @@ #!/bin/sh ############################################################################## -# Copyright (c) 2007,2009 Free Software Foundation, Inc. # +# Copyright (c) 2007-2009,2010 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.12 2009/11/14 22:09:55 tom Exp $ +# $Id: MKcaptab.sh,v 1.13 2010/12/25 23:43:58 tom Exp $ AWK=${1-awk} OPT1=${2-0} OPT2=${3-tinfo/MKcaptab.awk} @@ -65,7 +65,7 @@ cat < -MODULE_ID("$Id: add_tries.c,v 1.9 2009/10/24 22:41:36 tom Exp $") +MODULE_ID("$Id: add_tries.c,v 1.10 2010/12/19 01:31:14 tom Exp $") #define SET_TRY(dst,src) if ((dst->ch = *src++) == 128) dst->ch = '\0' #define CMP_TRY(a,b) ((a)? (a == b) : (b == 128)) @@ -67,7 +67,7 @@ _nc_add_to_try(TRIES ** tree, const char *str, unsigned code) if (CMP_TRY(ptr->ch, cmp)) { if (*(++txt) == '\0') { - ptr->value = code; + ptr->value = (unsigned short) code; returnCode(OK); } if (ptr->child != 0) @@ -116,6 +116,6 @@ _nc_add_to_try(TRIES ** tree, const char *str, unsigned code) ptr->value = 0; } - ptr->value = code; + ptr->value = (unsigned short) code; returnCode(OK); } diff --git a/ncurses/tinfo/alloc_entry.c b/ncurses/tinfo/alloc_entry.c index a54f9ef3..506fb386 100644 --- a/ncurses/tinfo/alloc_entry.c +++ b/ncurses/tinfo/alloc_entry.c @@ -47,7 +47,7 @@ #include -MODULE_ID("$Id: alloc_entry.c,v 1.50 2010/05/01 19:55:48 tom Exp $") +MODULE_ID("$Id: alloc_entry.c,v 1.51 2010/12/25 23:06:01 tom Exp $") #define ABSENT_OFFSET -1 #define CANCELLED_OFFSET -2 @@ -182,7 +182,7 @@ _nc_wrap_entry(ENTRY * const ep, bool copy_strings) } else if (tp->Strings[i] == CANCELLED_STRING) { offsets[i] = CANCELLED_OFFSET; } else { - offsets[i] = tp->Strings[i] - stringbuf; + offsets[i] = (int) (tp->Strings[i] - stringbuf); } } } @@ -191,7 +191,7 @@ _nc_wrap_entry(ENTRY * const ep, bool copy_strings) if (ep->uses[i].name == 0) useoffsets[i] = ABSENT_OFFSET; else - useoffsets[i] = ep->uses[i].name - stringbuf; + useoffsets[i] = (int) (ep->uses[i].name - stringbuf); } if ((tp->str_table = typeMalloc(char, next_free)) == (char *) 0) @@ -215,10 +215,10 @@ _nc_wrap_entry(ENTRY * const ep, bool copy_strings) if (!copy_strings) { if ((n = (unsigned) NUM_EXT_NAMES(tp)) != 0) { if (n < SIZEOF(offsets)) { - unsigned length = 0; + size_t length = 0; for (i = 0; i < n; i++) { length += strlen(tp->ext_Names[i]) + 1; - offsets[i] = tp->ext_Names[i] - stringbuf; + offsets[i] = (int) (tp->ext_Names[i] - stringbuf); } if ((tp->ext_str_table = typeMalloc(char, length)) == 0) _nc_err_abort(MSG_NO_MEMORY); diff --git a/ncurses/tinfo/alloc_ttype.c b/ncurses/tinfo/alloc_ttype.c index 116245e4..b02cb9c6 100644 --- a/ncurses/tinfo/alloc_ttype.c +++ b/ncurses/tinfo/alloc_ttype.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: alloc_ttype.c,v 1.21 2010/05/01 19:32:33 tom Exp $") +MODULE_ID("$Id: alloc_ttype.c,v 1.22 2010/12/19 00:24:09 tom Exp $") #if NCURSES_XNAMES /* @@ -90,6 +90,9 @@ find_name(char **table, int length, char *name) return FALSE; } +#define EXTEND_NUM(num, ext) \ + to->num = (unsigned short) (to->num + (ext - to->ext)) + static void realign_data(TERMTYPE *to, char **ext_Names, int ext_Booleans, @@ -100,7 +103,7 @@ realign_data(TERMTYPE *to, char **ext_Names, int limit = (to->ext_Booleans + to->ext_Numbers + to->ext_Strings); if (to->ext_Booleans != ext_Booleans) { - to->num_Booleans += (ext_Booleans - to->ext_Booleans); + EXTEND_NUM(num_Booleans, ext_Booleans); to->Booleans = typeRealloc(NCURSES_SBOOL, to->num_Booleans, to->Booleans); for (n = to->ext_Booleans - 1, m = ext_Booleans - 1, @@ -114,7 +117,7 @@ realign_data(TERMTYPE *to, char **ext_Names, to->ext_Booleans = UShort(ext_Booleans); } if (to->ext_Numbers != ext_Numbers) { - to->num_Numbers += (ext_Numbers - to->ext_Numbers); + EXTEND_NUM(num_Numbers, ext_Numbers); to->Numbers = typeRealloc(short, to->num_Numbers, to->Numbers); for (n = to->ext_Numbers - 1, m = ext_Numbers - 1, @@ -128,7 +131,7 @@ realign_data(TERMTYPE *to, char **ext_Names, to->ext_Numbers = UShort(ext_Numbers); } if (to->ext_Strings != ext_Strings) { - to->num_Strings += (ext_Strings - to->ext_Strings); + EXTEND_NUM(num_Strings, ext_Strings); to->Strings = typeRealloc(char *, to->num_Strings, to->Strings); for (n = to->ext_Strings - 1, m = ext_Strings - 1, diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c index eda581b9..8204d75a 100644 --- a/ncurses/tinfo/comp_parse.c +++ b/ncurses/tinfo/comp_parse.c @@ -52,7 +52,7 @@ #include -MODULE_ID("$Id: comp_parse.c,v 1.72 2010/01/23 17:57:43 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.73 2010/12/25 23:06:37 tom Exp $") static void sanity_check2(TERMTYPE *, bool); NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2; @@ -274,7 +274,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) unresolved++; total_unresolved++; - _nc_curr_line = lookline; + _nc_curr_line = (int) lookline; _nc_warning("resolution of use=%s failed", lookfor); qp->uses[i].link = 0; } @@ -376,7 +376,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) if (_nc_check_termtype != 0) { _nc_curr_col = -1; for_entry_list(qp) { - _nc_curr_line = qp->startline; + _nc_curr_line = (int) qp->startline; _nc_set_type(_nc_first_name(qp->tterm.term_names)); _nc_check_termtype2(&qp->tterm, literal); } diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c index 48d33002..8725b2ed 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.88 2010/08/28 19:26:09 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.89 2010/12/25 23:06:37 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -612,7 +612,7 @@ _nc_get_token(bool silent) _nc_warning("Missing separator"); } _nc_curr_token.tk_name = tok_buf; - _nc_curr_token.tk_valnumber = number; + _nc_curr_token.tk_valnumber = (int) number; type = NUMBER; break; diff --git a/ncurses/tinfo/db_iterator.c b/ncurses/tinfo/db_iterator.c index 911223c6..82665cb5 100644 --- a/ncurses/tinfo/db_iterator.c +++ b/ncurses/tinfo/db_iterator.c @@ -38,7 +38,7 @@ #include -MODULE_ID("$Id: db_iterator.c,v 1.8 2010/06/05 22:20:04 tom Exp $") +MODULE_ID("$Id: db_iterator.c,v 1.9 2010/12/25 23:00:25 tom Exp $") #define HaveTicDirectory _nc_globals.have_tic_directory #define KeepTicDirectory _nc_globals.keep_tic_directory @@ -121,7 +121,7 @@ next_list_item(const char *source, int *offset) *offset += (int) strlen(result); } else { *marker++ = 0; - *offset = marker - ThisDbList; + *offset = (int) (marker - ThisDbList); } if (*result == 0 && result != (ThisDbList + ThisDbSize)) result = system_db; diff --git a/ncurses/tinfo/home_terminfo.c b/ncurses/tinfo/home_terminfo.c index 4521c4a8..69d69f95 100644 --- a/ncurses/tinfo/home_terminfo.c +++ b/ncurses/tinfo/home_terminfo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 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 #include -MODULE_ID("$Id: home_terminfo.c,v 1.11 2008/08/03 23:43:11 tom Exp $") +MODULE_ID("$Id: home_terminfo.c,v 1.12 2010/12/25 23:43:58 tom Exp $") /* ncurses extension...fall back on user's private directory */ @@ -53,7 +53,7 @@ _nc_home_terminfo(void) if (use_terminfo_vars()) { if (MyBuffer == 0) { if ((home = getenv("HOME")) != 0) { - unsigned want = (strlen(home) + sizeof(PRIVATE_INFO)); + size_t want = (strlen(home) + sizeof(PRIVATE_INFO)); MyBuffer = typeMalloc(char, want); if (MyBuffer == 0) _nc_err_abort(MSG_NO_MEMORY); diff --git a/ncurses/tinfo/lib_acs.c b/ncurses/tinfo/lib_acs.c index 5be3659f..d8fdedca 100644 --- a/ncurses/tinfo/lib_acs.c +++ b/ncurses/tinfo/lib_acs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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_acs.c,v 1.41 2009/10/04 00:26:54 tom Exp $") +MODULE_ID("$Id: lib_acs.c,v 1.43 2010/12/25 23:00:45 tom Exp $") #if BROKEN_LINKER || USE_REENTRANT #define MyBuffer _nc_prescreen.real_acs_map @@ -93,7 +93,7 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0) if (real_map != fake_map) { for (j = 1; j < ACS_LEN; ++j) { real_map[j] = 0; - fake_map[j] = A_ALTCHARSET | j; + fake_map[j] = A_ALTCHARSET | (chtype) j; if (SP_PARM) SP_PARM->_screen_acs_map[j] = FALSE; } @@ -189,7 +189,7 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0) size_t i; for (i = 1; i < ACS_LEN; ++i) { if (real_map[i] == 0) { - real_map[i] = i; + real_map[i] = (chtype) i; if (real_map != fake_map) { if (SP != 0) SP->_screen_acs_map[i] = TRUE; diff --git a/ncurses/tinfo/lib_baudrate.c b/ncurses/tinfo/lib_baudrate.c index 854442a9..9302f022 100644 --- a/ncurses/tinfo/lib_baudrate.c +++ b/ncurses/tinfo/lib_baudrate.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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 * @@ -79,7 +79,7 @@ #undef USE_OLD_TTY #endif /* USE_OLD_TTY */ -MODULE_ID("$Id: lib_baudrate.c,v 1.30 2009/10/24 22:15:00 tom Exp $") +MODULE_ID("$Id: lib_baudrate.c,v 1.31 2010/12/19 01:50:50 tom Exp $") /* * int @@ -212,7 +212,7 @@ NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0) int ret; if ((ret = _nc_getenv_num("BAUDRATE")) <= 0) ret = 9600; - ospeed = _nc_ospeed(ret); + ospeed = (NCURSES_OSPEED) _nc_ospeed(ret); returnCode(ret); } #endif @@ -223,9 +223,9 @@ NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0) ospeed = _nc_ospeed(result); #else /* !USE_OLD_TTY */ #ifdef TERMIOS - ospeed = cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb)); + ospeed = (NCURSES_OSPEED) cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb)); #else - ospeed = TerminalOf(SP_PARM)->Nttyb.sg_ospeed; + ospeed = (NCURSES_OSPEED) TerminalOf(SP_PARM)->Nttyb.sg_ospeed; #endif result = _nc_baudrate(ospeed); #endif diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c index f9f7b9cd..86e130e7 100644 --- a/ncurses/tinfo/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -39,7 +39,7 @@ #include #include /* ospeed */ -MODULE_ID("$Id: lib_cur_term.c,v 1.29 2010/01/23 17:57:43 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.30 2010/12/19 01:38:45 tom Exp $") #undef CUR #define CUR termp->type. @@ -95,13 +95,13 @@ NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp) if (termp != 0) { #ifdef USE_TERM_DRIVER TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp; - ospeed = _nc_ospeed(termp->_baudrate); + ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); if (TCB->drv->isTerminfo && termp->type.Strings) { PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); } TCB->csp = SP_PARM; #else - ospeed = _nc_ospeed(termp->_baudrate); + ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); if (termp->type.Strings) { PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); } diff --git a/ncurses/tinfo/lib_kernel.c b/ncurses/tinfo/lib_kernel.c index 0cd095f1..37f70842 100644 --- a/ncurses/tinfo/lib_kernel.c +++ b/ncurses/tinfo/lib_kernel.c @@ -48,7 +48,7 @@ #include -MODULE_ID("$Id: lib_kernel.c,v 1.30 2010/04/24 23:12:25 tom Exp $") +MODULE_ID("$Id: lib_kernel.c,v 1.31 2010/12/19 01:21:19 tom Exp $") static int _nc_vdisable(void) @@ -95,7 +95,7 @@ NCURSES_SP_NAME(erasechar) (NCURSES_SP_DCL0) result = termp->Ottyb.sg_erase; #endif } - returnChar(result); + returnChar((char) result); } #if NCURSES_SP_FUNCS @@ -130,7 +130,7 @@ NCURSES_SP_NAME(killchar) (NCURSES_SP_DCL0) result = termp->Ottyb.sg_kill; #endif } - returnChar(result); + returnChar((char) result); } #if NCURSES_SP_FUNCS diff --git a/ncurses/tinfo/lib_longname.c b/ncurses/tinfo/lib_longname.c index 2164a126..14903175 100644 --- a/ncurses/tinfo/lib_longname.c +++ b/ncurses/tinfo/lib_longname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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_longname.c,v 1.11 2009/02/21 17:18:02 tom Exp $") +MODULE_ID("$Id: lib_longname.c,v 1.12 2010/12/20 00:31:26 tom Exp $") #if USE_REENTRANT NCURSES_EXPORT(char *) @@ -52,7 +52,7 @@ NCURSES_SP_NAME(longname) (NCURSES_SP_DCL0) {'\0'}; char *ptr; - T((T_CALLED("longname(%p)"), SP_PARM)); + T((T_CALLED("longname(%p)"), (void *) SP_PARM)); if (SP_PARM) { for (ptr = SP_PARM->_ttytype + strlen(SP_PARM->_ttytype); diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 91012005..378fd940 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -51,7 +51,7 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.130 2010/07/31 22:16:26 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.132 2010/12/20 00:26:35 tom Exp $") /**************************************************************************** * @@ -587,7 +587,7 @@ TINFO_SETUP_TERM(TERMINAL ** tp, #ifdef USE_TERM_DRIVER T((T_CALLED("_nc_setupterm_ex(%p,%s,%d,%p)"), - tp, _nc_visbuf(tname), Filedes, errret)); + (void *) tp, _nc_visbuf(tname), Filedes, (void *) errret)); if (tp == 0) { ret_error0(TGETENT_ERR, @@ -660,7 +660,7 @@ TINFO_SETUP_TERM(TERMINAL ** tp, TCB = (TERMINAL_CONTROL_BLOCK *) termp; code = _nc_globals.term_driver(TCB, tname, errret); if (code == OK) { - termp->Filedes = Filedes; + termp->Filedes = (short) Filedes; termp->_termname = strdup(tname); } else { ret_error0(TGETENT_ERR, @@ -696,7 +696,7 @@ TINFO_SETUP_TERM(TERMINAL ** tp, ttytype[NAMESIZE - 1] = '\0'; #endif - termp->Filedes = Filedes; + termp->Filedes = (short) Filedes; termp->_termname = strdup(tname); set_curterm(termp); diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c index bd84a094..e9dae85b 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.72 2010/01/23 17:57:43 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.73 2010/12/25 19:27:12 tom Exp $") NCURSES_EXPORT_VAR(char *) UP = 0; NCURSES_EXPORT_VAR(char *) BC = 0; @@ -81,7 +81,7 @@ NCURSES_EXPORT_VAR(char *) BC = 0; NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) { - int errcode = ERR; + int rc = ERR; int n; bool found_cache = FALSE; #ifdef USE_TERM_DRIVER @@ -92,12 +92,12 @@ NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) T((T_CALLED("tgetent()"))); TINFO_SETUP_TERM(&termp, (NCURSES_CONST char *) name, - STDOUT_FILENO, &errcode, TRUE); + STDOUT_FILENO, &rc, TRUE); #ifdef USE_TERM_DRIVER if (termp == 0 || !((TERMINAL_CONTROL_BLOCK *) termp)->drv->isTerminfo) - return (errcode); + return (rc); #endif /* @@ -152,7 +152,7 @@ NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) BC = 0; FIX_SGR0 = 0; /* don't free it - application may still use */ - if (errcode == 1) { + if (rc == 1) { if (cursor_left) if ((backspaces_with_bs = (char) !strcmp(cursor_left, "\b")) == 0) @@ -187,7 +187,7 @@ NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) #endif*/ } - returnCode(errcode); + returnCode(rc); } #if NCURSES_SP_FUNCS diff --git a/ncurses/tinfo/lib_tparm.c b/ncurses/tinfo/lib_tparm.c index 0fda5f2e..44f410e7 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.79 2010/01/16 16:47:46 tom Exp $") +MODULE_ID("$Id: lib_tparm.c,v 1.80 2010/12/25 23:01:29 tom Exp $") /* * char * @@ -509,7 +509,7 @@ tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) if (p_is_s[i]) spush(p_is_s[i]); else - npush(param[i]); + npush((int) param[i]); } } #ifdef TRACE @@ -518,7 +518,7 @@ tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) if (p_is_s[i] != 0) save_text(", %s", _nc_visbuf(p_is_s[i]), 0); else - save_number(", %d", param[i], 0); + save_number(", %d", (int) param[i], 0); } _tracef(T_CALLED("%s(%s%s)"), TPS(tname), _nc_visbuf(cp), TPS(out_buff)); TPS(out_used) = 0; @@ -565,7 +565,7 @@ tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) if (p_is_s[i]) spush(p_is_s[i]); else - npush(param[i]); + npush((int) param[i]); } break; diff --git a/ncurses/tinfo/lib_tputs.c b/ncurses/tinfo/lib_tputs.c index f90f3554..dc70f3e0 100644 --- a/ncurses/tinfo/lib_tputs.c +++ b/ncurses/tinfo/lib_tputs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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.80 2009/11/21 23:09:31 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.81 2010/12/20 00:42:50 tom Exp $") NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ @@ -218,7 +218,7 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx if (outc == NCURSES_SP_NAME(_nc_outch)) (void) strcpy(addrbuf, "_nc_outch"); else - (void) sprintf(addrbuf, "%p", (void *) outc); + (void) sprintf(addrbuf, "%p", outc); if (_nc_tputs_trace) { _tracef("tputs(%s = %s, %d, %s) called", _nc_tputs_trace, _nc_visbuf(string), affcnt, addrbuf); diff --git a/ncurses/tinfo/lib_ttyflags.c b/ncurses/tinfo/lib_ttyflags.c index d0d58251..663a0689 100644 --- a/ncurses/tinfo/lib_ttyflags.c +++ b/ncurses/tinfo/lib_ttyflags.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_ttyflags.c,v 1.26 2009/10/24 22:15:47 tom Exp $") +MODULE_ID("$Id: lib_ttyflags.c,v 1.27 2010/12/25 23:43:58 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf) @@ -186,9 +186,9 @@ NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0) */ if (_nc_get_tty_mode(&termp->Nttyb) == OK) { #ifdef TERMIOS - termp->Nttyb.c_oflag &= ~OFLAGS_TABS; + termp->Nttyb.c_oflag &= (unsigned) (~OFLAGS_TABS); #else - termp->Nttyb.sg_flags &= ~XTABS; + termp->Nttyb.sg_flags &= (unsigned) (~XTABS); #endif rc = OK; } diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c index 9fa5b4ed..5b3b55a4 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.12 2010/07/31 22:16:38 tom Exp $") +MODULE_ID("$Id: tinfo_driver.c,v 1.13 2010/12/20 01:47:09 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -515,9 +515,9 @@ drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag) */ if ((drv_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) { #ifdef TERMIOS - _term->Nttyb.c_oflag &= ~OFLAGS_TABS; + _term->Nttyb.c_oflag &= (unsigned) ~OFLAGS_TABS; #else - _term->Nttyb.sg_flags &= ~XTABS; + _term->Nttyb.sg_flags &= (unsigned) ~XTABS; #endif code = OK; } diff --git a/ncurses/tinfo/trim_sgr0.c b/ncurses/tinfo/trim_sgr0.c index 5f7b9b33..1f992086 100644 --- a/ncurses/tinfo/trim_sgr0.c +++ b/ncurses/tinfo/trim_sgr0.c @@ -36,7 +36,7 @@ #include -MODULE_ID("$Id: trim_sgr0.c,v 1.11 2010/05/01 19:33:31 tom Exp $") +MODULE_ID("$Id: trim_sgr0.c,v 1.12 2010/12/25 23:03:57 tom Exp $") #undef CUR #define CUR tp-> @@ -99,8 +99,8 @@ rewrite_sgr(char *s, char *attr) { if (PRESENT(s)) { if (PRESENT(attr)) { - unsigned len_s = strlen(s); - unsigned len_a = strlen(attr); + size_t len_s = strlen(s); + size_t len_a = strlen(attr); if (len_s > len_a && !strncmp(attr, s, len_a)) { unsigned n; @@ -123,8 +123,8 @@ similar_sgr(char *a, char *b) bool result = FALSE; int csi_a = is_csi(a); int csi_b = is_csi(b); - unsigned len_a; - unsigned len_b; + size_t len_a; + size_t len_b; TR(TRACE_DATABASE, ("similar_sgr:\n\t%s\n\t%s", _nc_visbuf2(1, a), @@ -264,7 +264,7 @@ _nc_trim_sgr0(TERMTYPE *tp) off + i); if (k2 != 0) { found = TRUE; - chop_out(off, i, i + k2); + chop_out(off, (unsigned) i, (unsigned) (i + k2)); break; } } @@ -285,7 +285,7 @@ _nc_trim_sgr0(TERMTYPE *tp) if (off[i - 1] == ';') i--; j = (size_t) (skip_zero(tmp + 1) - off); - (void) chop_out(off, i, j); + (void) chop_out(off, (unsigned) i, (unsigned) j); found = TRUE; } } @@ -296,7 +296,7 @@ _nc_trim_sgr0(TERMTYPE *tp) i = (size_t) (tmp - end); j = strlen(off); tmp = strdup(end); - chop_out(tmp, i, j); + chop_out(tmp, (unsigned) i, (unsigned) j); free(off); result = tmp; } diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index 97fa06ab..a86c1126 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -53,7 +53,7 @@ #define TRACE_OUT(p) /*nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.77 2010/08/28 21:04:05 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.78 2010/12/25 23:23:08 tom Exp $") static int total_written; @@ -469,22 +469,22 @@ _nc_write_entry(TERMTYPE *const tp) #endif /* USE_HASHED_DB */ } -static unsigned +static size_t fake_write(char *dst, unsigned *offset, - unsigned limit, + size_t limit, char *src, - unsigned want, - unsigned size) + size_t want, + size_t size) { - unsigned have = (limit - *offset); + size_t have = (limit - *offset); want *= size; if (have > 0) { if (want > have) want = have; memcpy(dst + *offset, src, want); - *offset += want; + *offset += (unsigned) want; } else { want = 0; } @@ -502,10 +502,10 @@ fake_write(char *dst, #define WRITE_STRING(str) (Write(str, sizeof(char), strlen(str) + 1) == strlen(str) + 1) static int -compute_offsets(char **Strings, unsigned strmax, short *offsets) +compute_offsets(char **Strings, size_t strmax, short *offsets) { int nextfree = 0; - unsigned i; + size_t i; for (i = 0; i < strmax; i++) { if (Strings[i] == ABSENT_STRING) { @@ -523,9 +523,9 @@ compute_offsets(char **Strings, unsigned strmax, short *offsets) } static void -convert_shorts(unsigned char *buf, short *Numbers, unsigned count) +convert_shorts(unsigned char *buf, short *Numbers, size_t count) { - unsigned i; + size_t i; for (i = 0; i < count; i++) { if (Numbers[i] == ABSENT_NUMERIC) { /* HI/LO won't work */ buf[2 * i] = buf[2 * i + 1] = 0377; @@ -534,7 +534,7 @@ convert_shorts(unsigned char *buf, short *Numbers, unsigned count) buf[2 * i + 1] = 0377; } else { LITTLE_ENDIAN(buf + 2 * i, Numbers[i]); - TRACE_OUT(("put Numbers[%d]=%d", i, Numbers[i])); + TRACE_OUT(("put Numbers[%u]=%d", (unsigned) i, Numbers[i])); } } } diff --git a/ncurses/trace/lib_trace.c b/ncurses/trace/lib_trace.c index c1859b2a..a726901d 100644 --- a/ncurses/trace/lib_trace.c +++ b/ncurses/trace/lib_trace.c @@ -47,7 +47,7 @@ #include -MODULE_ID("$Id: lib_trace.c,v 1.75 2010/09/25 22:16:12 juergen Exp $") +MODULE_ID("$Id: lib_trace.c,v 1.76 2010/12/19 01:21:19 tom Exp $") NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ @@ -96,7 +96,7 @@ trace(const unsigned int tracelevel) const char *mode = _nc_globals.init_trace ? "ab" : "wb"; if (TracePath[0] == '\0') { - int size = sizeof(TracePath) - 12; + size_t size = sizeof(TracePath) - 12; if (getcwd(TracePath, size) == 0) { perror("curses: Can't get working directory"); exit(EXIT_FAILURE); @@ -122,7 +122,7 @@ trace(const unsigned int tracelevel) */ #if HAVE_SETVBUF /* ANSI */ (void) setvbuf(TraceFP, (char *) 0, _IOLBF, 0); -#elif HAVE_SETBUF /* POSIX */ +#elif HAVE_SETBUF /* POSIX */ (void) setbuffer(TraceFP, (char *) 0); #endif _tracef("TRACING NCURSES version %s.%d (tracelevel=%#x)", diff --git a/ncurses/trace/lib_traceatr.c b/ncurses/trace/lib_traceatr.c index 1eaeff8c..0f2c681e 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.71 2010/08/28 21:05:25 tom Exp $") +MODULE_ID("$Id: lib_traceatr.c,v 1.72 2010/12/19 00:51:35 tom Exp $") #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name)) @@ -241,14 +241,14 @@ _nc_altcharset_name(attr_t attr, chtype ch) const ALT_NAMES *strp; for (cp = acs_chars; cp[0] && cp[1]; cp += 2) { - if (ChCharOf(cp[1]) == ChCharOf(ch)) { + if (ChCharOf(UChar(cp[1])) == ChCharOf(ch)) { found = cp; /* don't exit from loop - there may be redefinitions */ } } if (found != 0) { - ch = ChCharOf(*found); + ch = ChCharOf(UChar(*found)); for (strp = names; strp->val; strp++) if (strp->val == ch) { result = strp->name; @@ -330,7 +330,7 @@ _tracecchar_t2(int bufnum, const cchar_t *ch) (void) _nc_trace_bufcat(bufnum, "\\000"); break; } - PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st); + PUTC_n = (int) wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st); if (PUTC_n <= 0) { if (PUTC_ch != L'\0') { /* it could not be a multibyte sequence */ diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index 24cfa83c..5e29c62f 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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 * @@ -159,7 +159,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mvcur.c,v 1.123 2009/11/07 16:07:55 tom Exp $") +MODULE_ID("$Id: lib_mvcur.c,v 1.124 2010/12/19 01:22:58 tom Exp $") #define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */ @@ -231,11 +231,11 @@ NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_DCLx const char *const cap, int affcn for (cp += 2; *cp != '>'; cp++) { if (isdigit(UChar(*cp))) - number = number * 10 + (*cp - '0'); + number = number * 10 + (float) (*cp - '0'); else if (*cp == '*') - number *= affcnt; + number *= (float) affcnt; else if (*cp == '.' && (*++cp != '>') && isdigit(UChar(*cp))) - number += (*cp - '0') / 10.0; + number += (float) ((*cp - '0') / 10.0); } #if NCURSES_NO_PADDING @@ -243,7 +243,7 @@ NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_DCLx const char *const cap, int affcn #endif cum_cost += number * 10; } else - cum_cost += SP_PARM->_char_padding; + cum_cost += (float) SP_PARM->_char_padding; } return ((int) cum_cost); @@ -515,7 +515,7 @@ _nc_mvcur_wrap(void) static NCURSES_INLINE int repeated_append(string_desc * target, int total, int num, int repeat, const char *src) { - size_t need = repeat * strlen(src); + size_t need = (size_t) repeat * strlen(src); if (need < target->s_size) { while (repeat-- > 0) { @@ -695,7 +695,7 @@ relative_move(NCURSES_SP_DCLx *check.s_tail++ = (char) CharOf(WANT_CHAR(SP_PARM, to_y, from_x + i)); *check.s_tail = '\0'; - check.s_size -= n; + check.s_size -= (size_t) n; lhcost += n * SP_PARM->_char_padding; } else { lhcost = repeated_append(&check, lhcost, SP_PARM->_cuf1_cost, diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c index 3091719c..329ec29a 100644 --- a/ncurses/tty/lib_twait.c +++ b/ncurses/tty/lib_twait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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,7 +70,7 @@ #endif #undef CUR -MODULE_ID("$Id: lib_twait.c,v 1.60 2009/04/18 21:01:13 tom Exp $") +MODULE_ID("$Id: lib_twait.c,v 1.61 2010/12/25 23:43:58 tom Exp $") static long _nc_gettime(TimeType * t0, bool first) @@ -386,7 +386,7 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED, returntime = _nc_gettime(&t0, FALSE); if (milliseconds >= 0) - milliseconds -= (returntime - starttime); + milliseconds -= (int) (returntime - starttime); #ifdef NCURSES_WGETCH_EVENTS if (evl) { diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index dd6c3b67..f0d2369c 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.263 2010/05/01 20:44:34 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.264 2010/12/19 01:21:02 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -497,7 +497,9 @@ can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch) return FALSE; if ((pair = GetPair(CHDEREF(ch))) != 0) { short fg, bg; - NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx pair, &fg, &bg); + NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx + (short) pair, + &fg, &bg); if (fg != C_MASK || bg != C_MASK) return FALSE; } @@ -1413,7 +1415,7 @@ TransformLine(NCURSES_SP_DCLx int const lineno) nLastChar); memcpy(oldLine + firstChar, newLine + firstChar, - (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T)); + (unsigned) (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T)); } TR(TRACE_UPDATE, (T_RETURN(""))); return; @@ -1535,7 +1537,7 @@ TransformLine(NCURSES_SP_DCLx int const lineno) if (screen_columns(SP_PARM) > firstChar) memcpy(oldLine + firstChar, newLine + firstChar, - (screen_columns(SP_PARM) - firstChar) * sizeof(NCURSES_CH_T)); + (unsigned) (screen_columns(SP_PARM) - firstChar) * sizeof(NCURSES_CH_T)); TR(TRACE_UPDATE, (T_RETURN(""))); return; } @@ -1559,7 +1561,7 @@ ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank) if (SP_PARM->_coloron && !SP_PARM->_default_color) { NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx - GET_SCREEN_PAIR(SP_PARM), + (short) GET_SCREEN_PAIR(SP_PARM), 0, FALSE, NCURSES_SP_NAME(_nc_outch)); @@ -2064,7 +2066,10 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx if (res == ERR) return (ERR); - _nc_scroll_window(CurScreen(SP_PARM), n, top, bot, blank); + _nc_scroll_window(CurScreen(SP_PARM), n, + (NCURSES_SIZE_T) top, + (NCURSES_SIZE_T) bot, + blank); /* shift hash values too - they can be reused */ NCURSES_SP_NAME(_nc_scroll_oldhash) (NCURSES_SP_ARGx n, top, bot); @@ -2099,7 +2104,8 @@ NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_DCL0) SP_PARM->_color_defs = -(SP_PARM->_color_defs); for (n = 0; n < SP_PARM->_color_defs; ++n) { if (SP_PARM->_color_table[n].init) { - NCURSES_SP_NAME(init_color) (NCURSES_SP_ARGx n, + NCURSES_SP_NAME(init_color) (NCURSES_SP_ARGx + (short) n, SP_PARM->_color_table[n].r, SP_PARM->_color_table[n].g, SP_PARM->_color_table[n].b); diff --git a/ncurses/widechar/lib_add_wch.c b/ncurses/widechar/lib_add_wch.c index eada2f19..a8491fcb 100644 --- a/ncurses/widechar/lib_add_wch.c +++ b/ncurses/widechar/lib_add_wch.c @@ -39,7 +39,7 @@ #include #endif -MODULE_ID("$Id: lib_add_wch.c,v 1.10 2010/03/31 23:38:02 tom Exp $") +MODULE_ID("$Id: lib_add_wch.c,v 1.11 2010/12/19 01:32:55 tom Exp $") /* clone/adapt lib_addch.c */ static const cchar_t blankchar = NewChar(BLANK_TEXT); @@ -122,7 +122,7 @@ newline_forces_scroll(WINDOW *win, NCURSES_SIZE_T * ypos) *ypos = win->_regbottom; result = TRUE; } else { - *ypos += 1; + *ypos = (NCURSES_SIZE_T) (*ypos + 1); } return result; } @@ -166,8 +166,8 @@ fill_cells(WINDOW *win, int count) if (wadd_wch_literal(win, blank) == ERR) break; } - win->_curx = save_x; - win->_cury = save_y; + win->_curx = (NCURSES_SIZE_T) save_x; + win->_cury = (NCURSES_SIZE_T) save_y; } static int @@ -291,7 +291,7 @@ wadd_wch_literal(WINDOW *win, cchar_t ch) if (x > win->_maxx) { return wrap_to_next_line(win); } - win->_curx = x; + win->_curx = (NCURSES_SIZE_T) x; return OK; } @@ -312,7 +312,7 @@ wadd_wch_nosync(WINDOW *win, cchar_t ch) * way. */ if ((AttrOf(ch) & A_ALTCHARSET) - || iswprint(CharOf(ch))) + || iswprint((wint_t) CharOf(ch))) return wadd_wch_literal(win, ch); /* @@ -329,7 +329,7 @@ wadd_wch_nosync(WINDOW *win, cchar_t ch) #else tabsize = TABSIZE; #endif - x += (tabsize - (x % tabsize)); + x = (NCURSES_SIZE_T) (x + (tabsize - (x % tabsize))); /* * Space-fill the tab on the bottom line so that we'll get the * "correct" cursor position. diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c index 38268a7e..c61c7952 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.17 2010/03/31 23:38:02 tom Exp $") +MODULE_ID("$Id: lib_cchar.c,v 1.20 2010/12/25 23:46:26 tom Exp $") /* * The SuSv2 description leaves some room for interpretation. We'll assume wch @@ -58,7 +58,7 @@ setcchar(cchar_t *wcval, (void *) wcval, _nc_viswbuf(wch), (unsigned long) attrs, color_pair, opts)); - len = wcslen(wch); + len = (unsigned) wcslen(wch); if (opts != NULL || (len > 1 && wcwidth(wch[0]) < 0)) { code = ERR; @@ -80,7 +80,7 @@ setcchar(cchar_t *wcval, memset(wcval, 0, sizeof(*wcval)); if (len != 0) { - SetAttr(*wcval, attrs | ColorPair(color_pair)); + SetAttr(*wcval, attrs | (attr_t) ColorPair(color_pair)); SetPair(CHDEREF(wcval), color_pair); memcpy(&wcval->chars, wch, len * sizeof(wchar_t)); TR(TRACE_CCALLS, ("copy %d wchars, first is %s", len, @@ -111,9 +111,9 @@ getcchar(const cchar_t *wcval, opts)); if (opts == NULL) { - len = (wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) - ? wp - wcval->chars - : CCHARW_MAX; + len = ((wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) + ? (int) (wp - wcval->chars) + : CCHARW_MAX); if (wch == NULL) { /* @@ -125,7 +125,7 @@ getcchar(const cchar_t *wcval, code = ERR; } else if (len >= 0) { *attrs = AttrOf(*wcval) & A_ATTRIBUTES; - *color_pair = GetPair(*wcval); + *color_pair = (short) GetPair(*wcval); wmemcpy(wch, wcval->chars, (unsigned) len); wch[len] = L'\0'; code = OK; diff --git a/ncurses/widechar/lib_hline_set.c b/ncurses/widechar/lib_hline_set.c index 4bd77fa4..da92b834 100644 --- a/ncurses/widechar/lib_hline_set.c +++ b/ncurses/widechar/lib_hline_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2009 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,2010 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,14 +39,14 @@ #include -MODULE_ID("$Id: lib_hline_set.c,v 1.3 2009/10/24 22:42:50 tom Exp $") +MODULE_ID("$Id: lib_hline_set.c,v 1.4 2010/12/19 01:45:03 tom Exp $") NCURSES_EXPORT(int) whline_set(WINDOW *win, const cchar_t *ch, int n) { int code = ERR; - NCURSES_SIZE_T start; - NCURSES_SIZE_T end; + int start; + int end; T((T_CALLED("whline_set(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n)); diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c index 4f62d365..1eee8a3e 100644 --- a/ncurses/widechar/lib_ins_wch.c +++ b/ncurses/widechar/lib_ins_wch.c @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_ins_wch.c,v 1.15 2010/12/11 19:58:39 tom Exp $") +MODULE_ID("$Id: lib_ins_wch.c,v 1.16 2010/12/19 01:34:04 tom Exp $") /* * Insert the given character, updating the current location to simplify @@ -53,7 +53,7 @@ _nc_insert_wch(WINDOW *win, const cchar_t *wch) int code = OK; if (cells < 0) { - code = winsch(win, CharOf(CHDEREF(wch))); + code = winsch(win, (chtype) CharOf(CHDEREF(wch))); } else { if (cells == 0) cells = 1; @@ -115,7 +115,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) if (win != 0 && wstr != 0) { if (n < 1) - n = wcslen(wstr); + n = (int) wcslen(wstr); code = OK; if (n > 0) { SCREEN *sp = _nc_screen_of(win); diff --git a/ncurses/widechar/lib_vid_attr.c b/ncurses/widechar/lib_vid_attr.c index ef64c723..e4cf093a 100644 --- a/ncurses/widechar/lib_vid_attr.c +++ b/ncurses/widechar/lib_vid_attr.c @@ -36,7 +36,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_vid_attr.c,v 1.13 2010/03/31 23:22:35 tom Exp $") +MODULE_ID("$Id: lib_vid_attr.c,v 1.14 2010/12/19 01:44:24 tom Exp $") #define doPut(mode) TPUTS_TRACE(#mode); NCURSES_SP_NAME(tputs)(NCURSES_SP_ARGx mode, 1, outc) @@ -59,7 +59,9 @@ MODULE_ID("$Id: lib_vid_attr.c,v 1.13 2010/03/31 23:22:35 tom Exp $") } \ } -#define set_color(mode, pair) mode &= ALL_BUT_COLOR; mode |= ColorPair(pair) +#define set_color(mode, pair) \ + mode &= ALL_BUT_COLOR; \ + mode |= (attr_t) ColorPair(pair) NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx diff --git a/ncurses/widechar/lib_vline_set.c b/ncurses/widechar/lib_vline_set.c index aacc00e3..917caac4 100644 --- a/ncurses/widechar/lib_vline_set.c +++ b/ncurses/widechar/lib_vline_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2009 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,2010 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,14 +39,14 @@ #include -MODULE_ID("$Id: lib_vline_set.c,v 1.3 2009/10/24 22:43:43 tom Exp $") +MODULE_ID("$Id: lib_vline_set.c,v 1.4 2010/12/19 01:50:50 tom Exp $") NCURSES_EXPORT(int) wvline_set(WINDOW *win, const cchar_t *ch, int n) { int code = ERR; - NCURSES_SIZE_T row, col; - NCURSES_SIZE_T end; + int row, col; + int end; T((T_CALLED("wvline(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n)); diff --git a/ncurses/widechar/lib_wacs.c b/ncurses/widechar/lib_wacs.c index 7c1ce021..5a16e457 100644 --- a/ncurses/widechar/lib_wacs.c +++ b/ncurses/widechar/lib_wacs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,2010 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 * @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: lib_wacs.c,v 1.9 2009/10/03 20:18:21 tom Exp $") +MODULE_ID("$Id: lib_wacs.c,v 1.10 2010/12/19 01:43:19 tom Exp $") NCURSES_EXPORT_VAR(cchar_t) * _nc_wacs = 0; @@ -41,7 +41,7 @@ _nc_init_wacs(void) { /* *INDENT-OFF* */ static const struct { - int map; + unsigned map; int value[2]; } table[] = { /* VT100 symbols */ diff --git a/ncurses/widechar/lib_wunctrl.c b/ncurses/widechar/lib_wunctrl.c index b9f8d6a5..50958e44 100644 --- a/ncurses/widechar/lib_wunctrl.c +++ b/ncurses/widechar/lib_wunctrl.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2007,2009 Free Software Foundation, Inc. * + * Copyright (c) 2001-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: lib_wunctrl.c,v 1.13 2009/04/18 19:06:55 tom Exp $") +MODULE_ID("$Id: lib_wunctrl.c,v 1.14 2010/12/19 01:42:15 tom Exp $") NCURSES_EXPORT(wchar_t *) NCURSES_SP_NAME(wunctrl) (NCURSES_SP_DCLx cchar_t *wc) @@ -48,7 +48,7 @@ NCURSES_SP_NAME(wunctrl) (NCURSES_SP_DCLx cchar_t *wc) (unsigned) _nc_to_char((wint_t)CharOf(*wc))); for (wsp = str; *p; ++p) { - *wsp++ = _nc_to_widechar(*p); + *wsp++ = (wchar_t) _nc_to_widechar(*p); } *wsp = 0; return str; diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c index 05118890..c214639c 100644 --- a/ncurses/win32con/win_driver.c +++ b/ncurses/win32con/win_driver.c @@ -39,7 +39,7 @@ #include #define CUR my_term.type. -MODULE_ID("$Id: win_driver.c,v 1.9 2010/07/31 23:43:21 tom Exp $") +MODULE_ID("$Id: win_driver.c,v 1.10 2010/12/25 19:28:21 tom Exp $") #define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) @@ -929,7 +929,7 @@ drv_twait(TERMINAL_CONTROL_BLOCK * TCB, EVENTLIST_2nd(_nc_eventlist * evl)) { SCREEN *sp; - INPUT_RECORD inp; + INPUT_RECORD inp_rec; BOOL b; DWORD nRead = 0, rc = -1; int code = 0; @@ -938,7 +938,7 @@ drv_twait(TERMINAL_CONTROL_BLOCK * TCB, int diff; bool isImmed = (milliseconds == 0); -#define CONSUME() ReadConsoleInput(TCB->inp,&inp,1,&nRead) +#define CONSUME() ReadConsoleInput(TCB->inp,&inp_rec,1,&nRead) AssertTCB(); SetSP(); @@ -949,7 +949,7 @@ drv_twait(TERMINAL_CONTROL_BLOCK * TCB, if (milliseconds < 0) milliseconds = INFINITY; - memset(&inp, 0, sizeof(inp)); + memset(&inp_rec, 0, sizeof(inp_rec)); while (true) { GetSystemTimeAsFileTime(&fstart); @@ -965,15 +965,15 @@ drv_twait(TERMINAL_CONTROL_BLOCK * TCB, if (mode) { b = GetNumberOfConsoleInputEvents(TCB->inp, &nRead); if (b && nRead > 0) { - b = PeekConsoleInput(TCB->inp, &inp, 1, &nRead); + b = PeekConsoleInput(TCB->inp, &inp_rec, 1, &nRead); if (b && nRead > 0) { - switch (inp.EventType) { + switch (inp_rec.EventType) { case KEY_EVENT: if (mode & TW_INPUT) { - WORD vk = inp.Event.KeyEvent.wVirtualKeyCode; - char ch = inp.Event.KeyEvent.uChar.AsciiChar; + WORD vk = inp_rec.Event.KeyEvent.wVirtualKeyCode; + char ch = inp_rec.Event.KeyEvent.uChar.AsciiChar; - if (inp.Event.KeyEvent.bKeyDown) { + if (inp_rec.Event.KeyEvent.bKeyDown) { if (0 == ch) { int nKey = MapKey(TCB, vk); if ((nKey < 0) || FALSE == sp->_keypad_on) { @@ -990,7 +990,7 @@ drv_twait(TERMINAL_CONTROL_BLOCK * TCB, continue; case MOUSE_EVENT: if (decode_mouse(TCB, - (inp.Event.MouseEvent.dwButtonState + (inp_rec.Event.MouseEvent.dwButtonState & BUTTON_MASK)) == 0) { CONSUME(); } else if (mode & TW_MOUSE) { @@ -1076,7 +1076,7 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) { SCREEN *sp; int n = 1; - INPUT_RECORD inp; + INPUT_RECORD inp_rec; BOOL b; DWORD nRead; WORD vk; @@ -1086,17 +1086,17 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) assert(buf); SetSP(); - memset(&inp, 0, sizeof(inp)); + memset(&inp_rec, 0, sizeof(inp_rec)); T((T_CALLED("win32con::drv_read(%p)"), TCB)); - while ((b = ReadConsoleInput(TCB->inp, &inp, 1, &nRead))) { + while ((b = ReadConsoleInput(TCB->inp, &inp_rec, 1, &nRead))) { if (b && nRead > 0) { - if (inp.EventType == KEY_EVENT) { - if (!inp.Event.KeyEvent.bKeyDown) + if (inp_rec.EventType == KEY_EVENT) { + if (!inp_rec.Event.KeyEvent.bKeyDown) continue; - *buf = (int) inp.Event.KeyEvent.uChar.AsciiChar; - vk = inp.Event.KeyEvent.wVirtualKeyCode; - sc = inp.Event.KeyEvent.wVirtualScanCode; + *buf = (int) inp_rec.Event.KeyEvent.uChar.AsciiChar; + vk = inp_rec.Event.KeyEvent.wVirtualKeyCode; + sc = inp_rec.Event.KeyEvent.wVirtualScanCode; if (*buf == 0) { if (sp->_keypad_on) { *buf = MapKey(TCB, vk); @@ -1109,8 +1109,8 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) } else { /* *buf != 0 */ break; } - } else if (inp.EventType == MOUSE_EVENT) { - if (handle_mouse(TCB, inp.Event.MouseEvent)) { + } else if (inp_rec.EventType == MOUSE_EVENT) { + if (handle_mouse(TCB, inp_rec.Event.MouseEvent)) { *buf = KEY_MOUSE; break; } diff --git a/test/test_add_wchstr.c b/test/test_add_wchstr.c index 08ff6ee0..78c8f371 100644 --- a/test/test_add_wchstr.c +++ b/test/test_add_wchstr.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_add_wchstr.c,v 1.12 2010/12/12 00:17:13 tom Exp $ + * $Id: test_add_wchstr.c,v 1.13 2010/12/25 22:49:28 tom Exp $ * * Demonstrate the waddwchstr() and wadd_wch functions. * Thomas Dickey - 2009/9/12 @@ -123,7 +123,7 @@ ChWLen(const wchar_t *source) if (!pass_ctls) { size_t adjust = 0; size_t n; - char *s; + NCURSES_CONST char *s; for (n = 0; n < result; ++n) { if (source[n] < 256 && (s = unctrl((chtype) source[n])) != 0) {