X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fwidechar%2Flib_add_wch.c;h=0e1f4ea52acdd282317aa24a1396d9adbf6d829c;hp=eada2f19c4f3add534e325f6ae82ef9e58ba99f7;hb=61d8ae54ff6acd69e9dab2afb21591d44c46ee1f;hpb=cf94c7485f7b40ff7870b5bf9a65e7ab87481a76 diff --git a/ncurses/widechar/lib_add_wch.c b/ncurses/widechar/lib_add_wch.c index eada2f19..0e1f4ea5 100644 --- a/ncurses/widechar/lib_add_wch.c +++ b/ncurses/widechar/lib_add_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2004-2011,2016 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.10 2010/03/31 23:38:02 tom Exp $") +MODULE_ID("$Id: lib_add_wch.c,v 1.13 2016/05/28 23:36:34 tom Exp $") /* clone/adapt lib_addch.c */ static const cchar_t blankchar = NewChar(BLANK_TEXT); @@ -55,7 +55,7 @@ static const cchar_t blankchar = NewChar(BLANK_TEXT); */ /* Return bit mask for clearing color pair number if given ch has color */ -#define COLOR_MASK(ch) (~(attr_t)((ch) & A_COLOR ? A_COLOR : 0)) +#define COLOR_MASK(ch) (~(attr_t)(((ch) & A_COLOR) ? A_COLOR : 0)) static NCURSES_INLINE cchar_t render_char(WINDOW *win, cchar_t ch) @@ -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; } @@ -308,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); /* @@ -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.