X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fwidechar%2Flib_add_wch.c;h=38d3130a54c422550e5686edc2eda0d7ab94e4e6;hp=4d79114c9db14c09cd310d1ea2264412c2b4d24c;hb=cc387b11f421650091d84640e05825ea5161ac66;hpb=d803343ca3e2a419085e76fc9f04a6fbd14498b8 diff --git a/ncurses/widechar/lib_add_wch.c b/ncurses/widechar/lib_add_wch.c index 4d79114c..38d3130a 100644 --- a/ncurses/widechar/lib_add_wch.c +++ b/ncurses/widechar/lib_add_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004-2006,2009 Free Software Foundation, Inc. * + * Copyright (c) 2004-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include #endif -MODULE_ID("$Id: lib_add_wch.c,v 1.8 2009/07/25 14:38:01 tom Exp $") +MODULE_ID("$Id: lib_add_wch.c,v 1.12 2011/03/22 09:31:15 Petr.Pavlu Exp $") /* clone/adapt lib_addch.c */ static const cchar_t blankchar = NewChar(BLANK_TEXT); @@ -81,12 +81,6 @@ render_char(WINDOW *win, cchar_t ch) if ((pair = GET_WINDOW_PAIR(win)) == 0) pair = GetPair(win->_nc_bkgd); } -#if 0 - if (pair > 255) { - cchar_t fixme = ch; - SetPair(fixme, pair); - } -#endif AddAttr(ch, (a & COLOR_MASK(AttrOf(ch)))); SetPair(ch, pair); } @@ -128,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; } @@ -172,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 @@ -297,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; } @@ -314,11 +308,11 @@ wadd_wch_nosync(WINDOW *win, cchar_t ch) /* * If we are using the alternate character set, forget about locale. - * Otherwise, if the locale * claims the code is printable, treat it that + * Otherwise, if the locale claims the code is printable, treat it that * way. */ if ((AttrOf(ch) & A_ALTCHARSET) - || iswprint(CharOf(ch))) + || iswprint((wint_t) CharOf(ch))) return wadd_wch_literal(win, ch); /* @@ -335,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. @@ -415,7 +409,8 @@ wadd_wch(WINDOW *win, const cchar_t *wch) { int code = ERR; - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win, + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), + (void *) win, _tracecchar_t(wch))); if (win && (wadd_wch_nosync(win, *wch) != ERR)) { @@ -432,7 +427,8 @@ wecho_wchar(WINDOW *win, const cchar_t *wch) { int code = ERR; - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), win, + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), + (void *) win, _tracecchar_t(wch))); if (win && (wadd_wch_nosync(win, *wch) != ERR)) {