/****************************************************************************
- * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 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 <term.h> /* for back_color_erase */
-MODULE_ID("$Id: hashmap.c,v 1.46 2002/09/07 18:13:15 tom Exp $")
+MODULE_ID("$Id: hashmap.c,v 1.51 2007/04/28 20:14:15 tom Exp $")
#ifdef HASHDEBUG
# define NEWTEXT(m) newtext[m]
# define PENDING(n) 1
+extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing;
+
#else /* !HASHDEBUG */
-# define OLDNUM(n) _nc_oldnums[n]
+# define OLDNUM(n) SP->_oldnum_list[n]
# define OLDTEXT(n) curscr->_line[n].text
# define NEWTEXT(m) newscr->_line[m].text
# define TEXTWIDTH (curscr->_maxx+1)
#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;
{
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++)))
* 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;