X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftty%2Fhashmap.c;h=7ff356b645502719e5d75f61ad2d4914a2649a81;hp=d60878617eda8e4dce329c191cc446e668d903cb;hb=f70db18a0c3c6a828d8a5999be37239f01c9d98a;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8 diff --git a/ncurses/tty/hashmap.c b/ncurses/tty/hashmap.c index d6087861..7ff356b6 100644 --- a/ncurses/tty/hashmap.c +++ b/ncurses/tty/hashmap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2005 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 #include /* for back_color_erase */ -MODULE_ID("$Id: hashmap.c,v 1.47 2005/01/29 21:27:58 tom Exp $") +MODULE_ID("$Id: hashmap.c,v 1.50 2006/12/30 22:19:58 tom Exp $") #ifdef HASHDEBUG @@ -89,7 +89,7 @@ static chtype oldtext[MAXLINES][TEXTWIDTH], newtext[MAXLINES][TEXTWIDTH]; #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) @@ -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,7 +142,7 @@ 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) SetPair(blank, GetPair(stdscr->_nc_bkgd)); @@ -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;