summaryrefslogtreecommitdiffstats
path: root/contrib/ncurses/ncurses/tty/hashmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ncurses/ncurses/tty/hashmap.c')
-rw-r--r--contrib/ncurses/ncurses/tty/hashmap.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/ncurses/ncurses/tty/hashmap.c b/contrib/ncurses/ncurses/tty/hashmap.c
index 1c30526..1f482d4 100644
--- a/contrib/ncurses/ncurses/tty/hashmap.c
+++ b/contrib/ncurses/ncurses/tty/hashmap.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,2006 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 @@ AUTHOR
#include <curses.priv.h>
#include <term.h> /* for back_color_erase */
-MODULE_ID("$Id: hashmap.c,v 1.45 2001/12/19 01:06:49 tom Exp $")
+MODULE_ID("$Id: hashmap.c,v 1.49 2006/03/11 19:33:49 tom Exp $")
#ifdef HASHDEBUG
@@ -108,7 +108,9 @@ static chtype oldtext[MAXLINES][TEXTWIDTH], newtext[MAXLINES][TEXTWIDTH];
#define HASH_VAL(ch) (ch)
#endif
-static inline unsigned long
+static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
+
+static NCURSES_INLINE unsigned long
hash(NCURSES_CH_T * text)
{
int i;
@@ -140,10 +142,10 @@ update_cost_from_blank(NCURSES_CH_T * to)
{
int cost = 0;
int i;
- NCURSES_CH_T blank = NewChar2(BLANK_TEXT, BLANK_ATTR);
+ NCURSES_CH_T blank = blankchar;
if (back_color_erase)
- AddAttr(blank, (AttrOf(stdscr->_nc_bkgd) & A_COLOR));
+ SetPair(blank, GetPair(stdscr->_nc_bkgd));
for (i = TEXTWIDTH; i > 0; i--)
if (!(CharEq(blank, *to++)))
@@ -156,7 +158,7 @@ update_cost_from_blank(NCURSES_CH_T * to)
* Returns true when moving line 'from' to line 'to' seems to be cost
* effective. 'blank' indicates whether the line 'to' would become blank.
*/
-static inline bool
+static NCURSES_INLINE bool
cost_effective(const int from, const int to, const bool blank)
{
int new_from;
@@ -294,9 +296,9 @@ _nc_hash_map(void)
} else {
/* re-hash all */
if (oldhash == 0)
- oldhash = typeCalloc(unsigned long, screen_lines);
+ oldhash = typeCalloc(unsigned long, (unsigned) screen_lines);
if (newhash == 0)
- newhash = typeCalloc(unsigned long, screen_lines);
+ newhash = typeCalloc(unsigned long, (unsigned) screen_lines);
if (!oldhash || !newhash)
return; /* malloc failure */
for (i = 0; i < screen_lines; i++) {
OpenPOWER on IntegriCloud