/****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <ctype.h>
-MODULE_ID("$Id: tty_update.c,v 1.262 2009/10/24 23:21:31 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.265 2011/05/28 21:51:20 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;
}
T((T_CALLED("_nc_tinfo:doupdate(%p)"), (void *) SP_PARM));
+ if (SP_PARM == 0)
+ returnCode(ERR);
+
#if !USE_REENTRANT
/*
* It is "legal" but unlikely that an application could assign a new
{
int j;
- if (SP_PARM != 0 && CurScreen(SP_PARM) != 0
- && SP_PARM->_cursrow >= 0) {
- for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) {
- if (j >= 0) {
- NCURSES_CH_T *cp =
- &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]);
-
- if (!CharEq(*cp, blank)) {
- *cp = blank;
- needclear = TRUE;
+ if (SP_PARM != 0) {
+ if (CurScreen(SP_PARM) != 0
+ && SP_PARM->_cursrow >= 0) {
+ for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) {
+ if (j >= 0) {
+ NCURSES_CH_T *cp =
+ &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]);
+
+ if (!CharEq(*cp, blank)) {
+ *cp = blank;
+ needclear = TRUE;
+ }
}
}
}
- } else {
- needclear = TRUE;
}
- if (needclear) {
+ if (needclear && (SP_PARM != 0)) {
UpdateAttrs(SP_PARM, blank);
TPUTS_TRACE("clr_eol");
if (clr_eol && SP_PARM->_el_cost <= (screen_columns(SP_PARM) - SP_PARM->_curscol)) {
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);