-- 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
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).
-------------------------------------------------------------------------------
--- 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 --
-- 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
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
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.
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.
# 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
# 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)
* 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
/* 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)
#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
* 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
/****************************************************************************
- * 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 *
* 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))
#define TPARM_1(a,b) TPARM_2(a,b,0)
#define TPARM_0(a) TPARM_1(a,0)
#endif
+
+#endif /* NC_TPARM_included */
.\" 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
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.
#!/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. #
# #
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"
-# $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. #
# #
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) {"
#
# 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. #
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) {
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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)
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);
SetWidecExt(line->text[x + j], j);
}
}
- x += len;
+ x = (NCURSES_SIZE_T) (x + len);
end += len - 1;
} else {
break;
#include <curses.priv.h>
-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;
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);
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);
}
{
int code = ERR;
- T((T_CALLED("doupdate(%p)"), sp));
+ T((T_CALLED("doupdate(%p)"), (void *) sp));
if (IsValidScreen(sp))
code = CallDriver(sp, update);
{
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);
}
#include <curses.priv.h>
-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 <fifo_defs.h>
# 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
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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));
/****************************************************************************
- * 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 *
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
****************************************************************************/
/*
#include <curses.priv.h>
-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)
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;
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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)
* 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));
}
#include <curses.priv.h>
-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)
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]);
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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)
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
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;
dst_col = src_col + begx;
if_WIDEC({
- register int j;
+ int j;
/*
* Ensure that we will copy complete multi-column characters
: 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
}
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;
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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,
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));
#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
ReturnScreenError();
}
- T(("created SP %p", sp));
+ T(("created SP %p", (void *) sp));
sp->_next_screen = _nc_screen_chain;
_nc_screen_chain = sp;
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)
#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
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));
*/
#include <curses.priv.h>
-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)
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);
/****************************************************************************
- * 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 *
#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)
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;
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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)
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);
}
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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));
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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);
}
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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)
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;
* 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
*
#ifndef CURSES_PRIV_H
#define CURSES_PRIV_H 1
+/* *INDENT-OFF* */
#include <ncurses_dll.h>
*/
#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)
#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
#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; \
#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)
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); \
* 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, \
#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]))
* 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 */
#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))));}
}
#endif
+/* *INDENT-ON* */
+
#endif /* CURSES_PRIV_H */
#!/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"), #
# 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}
static void
next_string(const char *strings, unsigned *offset)
{
- *offset += strlen(strings + *offset) + 1;
+ *offset += (unsigned) strlen(strings + *offset) + 1;
}
static const struct name_table_entry *
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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))
if (CMP_TRY(ptr->ch, cmp)) {
if (*(++txt) == '\0') {
- ptr->value = code;
+ ptr->value = (unsigned short) code;
returnCode(OK);
}
if (ptr->child != 0)
ptr->value = 0;
}
- ptr->value = code;
+ ptr->value = (unsigned short) code;
returnCode(OK);
}
#include <tic.h>
-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
} 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);
}
}
}
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)
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);
#include <tic.h>
-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
/*
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,
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,
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,
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,
#include <tic.h>
-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;
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;
}
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);
}
#include <ctype.h>
#include <tic.h>
-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.
_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;
#include <tic.h>
-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
*offset += (int) strlen(result);
} else {
*marker++ = 0;
- *offset = marker - ThisDbList;
+ *offset = (int) (marker - ThisDbList);
}
if (*result == 0 && result != (ThisDbList + ThisDbSize))
result = system_db;
/****************************************************************************
- * 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 *
#include <curses.priv.h>
#include <tic.h>
-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 */
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);
/****************************************************************************
- * 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 *
#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
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;
}
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;
/****************************************************************************
- * 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 *
#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
int ret;
if ((ret = _nc_getenv_num("BAUDRATE")) <= 0)
ret = 9600;
- ospeed = _nc_ospeed(ret);
+ ospeed = (NCURSES_OSPEED) _nc_ospeed(ret);
returnCode(ret);
}
#endif
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
#include <curses.priv.h>
#include <termcap.h> /* 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.
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);
}
#include <curses.priv.h>
-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)
result = termp->Ottyb.sg_erase;
#endif
}
- returnChar(result);
+ returnChar((char) result);
}
#if NCURSES_SP_FUNCS
result = termp->Ottyb.sg_kill;
#endif
}
- returnChar(result);
+ returnChar((char) result);
}
#if NCURSES_SP_FUNCS
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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 *)
{'\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);
#include <locale.h>
#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 $")
/****************************************************************************
*
#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,
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,
ttytype[NAMESIZE - 1] = '\0';
#endif
- termp->Filedes = Filedes;
+ termp->Filedes = (short) Filedes;
termp->_termname = strdup(tname);
set_curterm(termp);
#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;
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
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
/*
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)
#endif*/
}
- returnCode(errcode);
+ returnCode(rc);
}
#if NCURSES_SP_FUNCS
#include <ctype.h>
#include <tic.h>
-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 *
if (p_is_s[i])
spush(p_is_s[i]);
else
- npush(param[i]);
+ npush((int) param[i]);
}
}
#ifdef TRACE
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;
if (p_is_s[i])
spush(p_is_s[i]);
else
- npush(param[i]);
+ npush((int) param[i]);
}
break;
/****************************************************************************
- * 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 *
#include <termcap.h> /* ospeed */
#include <tic.h>
-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 */
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);
/****************************************************************************
- * 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 *
#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)
*/
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;
}
# 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,
*/
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;
}
#include <tic.h>
-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->
{
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;
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),
off + i);
if (k2 != 0) {
found = TRUE;
- chop_out(off, i, i + k2);
+ chop_out(off, (unsigned) i, (unsigned) (i + k2));
break;
}
}
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;
}
}
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;
}
#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;
#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;
}
#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) {
}
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;
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]));
}
}
}
#include <ctype.h>
-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 */
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);
*/
#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)",
#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))
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;
(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 */
/****************************************************************************
- * 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 *
#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 */
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
#endif
cum_cost += number * 10;
} else
- cum_cost += SP_PARM->_char_padding;
+ cum_cost += (float) SP_PARM->_char_padding;
}
return ((int) cum_cost);
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) {
*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,
/****************************************************************************
- * 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 *
#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)
returntime = _nc_gettime(&t0, FALSE);
if (milliseconds >= 0)
- milliseconds -= (returntime - starttime);
+ milliseconds -= (int) (returntime - starttime);
#ifdef NCURSES_WGETCH_EVENTS
if (evl) {
#include <ctype.h>
-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
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;
}
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;
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;
}
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));
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);
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);
#include <wctype.h>
#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);
*ypos = win->_regbottom;
result = TRUE;
} else {
- *ypos += 1;
+ *ypos = (NCURSES_SIZE_T) (*ypos + 1);
}
return result;
}
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
if (x > win->_maxx) {
return wrap_to_next_line(win);
}
- win->_curx = x;
+ win->_curx = (NCURSES_SIZE_T) x;
return OK;
}
* way.
*/
if ((AttrOf(ch) & A_ALTCHARSET)
- || iswprint(CharOf(ch)))
+ || iswprint((wint_t) CharOf(ch)))
return wadd_wch_literal(win, 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.
#include <curses.priv.h>
-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
(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;
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,
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) {
/*
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;
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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));
#include <curses.priv.h>
-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
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;
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);
#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)
} \
}
-#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
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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));
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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;
{
/* *INDENT-OFF* */
static const struct {
- int map;
+ unsigned map;
int value[2];
} table[] = {
/* VT100 symbols */
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-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)
(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;
#include <curses.priv.h>
#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)
EVENTLIST_2nd(_nc_eventlist * evl))
{
SCREEN *sp;
- INPUT_RECORD inp;
+ INPUT_RECORD inp_rec;
BOOL b;
DWORD nRead = 0, rc = -1;
int code = 0;
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();
if (milliseconds < 0)
milliseconds = INFINITY;
- memset(&inp, 0, sizeof(inp));
+ memset(&inp_rec, 0, sizeof(inp_rec));
while (true) {
GetSystemTimeAsFileTime(&fstart);
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) {
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) {
{
SCREEN *sp;
int n = 1;
- INPUT_RECORD inp;
+ INPUT_RECORD inp_rec;
BOOL b;
DWORD nRead;
WORD vk;
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);
} 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;
}
* 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
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) {