Turn dictthreshold and dictincrease into cell-sized variables, so

they can be used with cell operators like !.

As I did this, I noticed the whole CELL thing might have problems with
big endian architectures with sizeof(int)!=sizeof(void*).
This commit is contained in:
Daniel C. Sobral 2001-05-29 23:44:12 +00:00
parent d0605c94ed
commit 38e0371f17
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77443
2 changed files with 8 additions and 7 deletions

View File

@ -66,8 +66,8 @@
#include "ficl.h"
/* Dictionary on-demand resizing control variables */
unsigned int dictThreshold;
unsigned int dictIncrease;
CELL dictThreshold;
CELL dictIncrease;
static char *dictCopyName(FICL_DICT *pDict, STRINGINFO si);
@ -774,11 +774,12 @@ void hashReset(FICL_HASH *pHash)
void dictCheckThreshold(FICL_DICT* dp)
{
if( dictCellsAvail(dp) < dictThreshold ) {
dp->dict = ficlMalloc( dictIncrease * sizeof (CELL) );
if( dictCellsAvail(dp) < dictThreshold.u ) {
dp->dict = ficlMalloc( dictIncrease.u * sizeof (CELL) );
assert(dp->dict);
dp->here = dp->dict;
dp->size = dictIncrease;
dp->size = dictIncrease.u;
dictAlign(dp);
}
}

View File

@ -1011,8 +1011,8 @@ WORDKIND ficlWordClassify(FICL_WORD *pFW);
/*
** Dictionary on-demand resizing
*/
extern unsigned int dictThreshold;
extern unsigned int dictIncrease;
extern CELL dictThreshold;
extern CELL dictIncrease;
/*
** Various FreeBSD goodies