MAX_COLS -> MAX_COLS_DICT for dict-related stuff (since dicts are

staying with fewer words for now.)
This commit is contained in:
Andy2 2011-11-18 07:56:02 -08:00
parent 2eac8e70e0
commit 598be8b404
4 changed files with 7 additions and 6 deletions

View file

@ -38,7 +38,7 @@ extern "C" {
#endif #endif
typedef struct _EdgeArray { typedef struct _EdgeArray {
array_edge* edges[MAX_COLS]; array_edge* edges[MAX_COLS_DICT];
XP_U16 nEdges; XP_U16 nEdges;
} EdgeArray; } EdgeArray;
@ -391,7 +391,7 @@ dict_makeIndex( const DictIter* iter, XP_U16 depth, IndexData* data )
{ {
ASSERT_INITED( iter ); ASSERT_INITED( iter );
const DictionaryCtxt* dict = iter->dict; const DictionaryCtxt* dict = iter->dict;
XP_ASSERT( depth < MAX_COLS ); XP_ASSERT( depth < MAX_COLS_DICT );
XP_U16 ii, needCount; XP_U16 ii, needCount;
const XP_U16 nFaces = dict_numTileFaces( dict ); const XP_U16 nFaces = dict_numTileFaces( dict );
XP_U16 nNonBlankFaces = nFaces; XP_U16 nNonBlankFaces = nFaces;

View file

@ -33,12 +33,13 @@
extern "C" { extern "C" {
#endif #endif
#define MAX_COLS_DICT 15
/* API for iterating over a dict */ /* API for iterating over a dict */
typedef XP_S32 DictPosition; typedef XP_S32 DictPosition;
typedef struct _DictIter { typedef struct _DictIter {
XP_U16 nEdges; XP_U16 nEdges;
array_edge* edges[MAX_COLS]; array_edge* edges[MAX_COLS_DICT];
#ifdef XWFEATURE_WALKDICT_FILTER #ifdef XWFEATURE_WALKDICT_FILTER
XP_U16 min; XP_U16 min;
XP_U16 max; XP_U16 max;

View file

@ -482,7 +482,7 @@ dict_getWordCount( const DictionaryCtxt* dict )
#ifdef XWFEATURE_WALKDICT #ifdef XWFEATURE_WALKDICT
if ( 0 == nWords ) { if ( 0 == nWords ) {
DictIter iter; DictIter iter;
dict_initIter( &iter, dict, 0, MAX_COLS ); dict_initIter( &iter, dict, 0, MAX_COLS_DICT );
nWords = dict_countWords( &iter ); nWords = dict_countWords( &iter );
} }
#endif #endif

View file

@ -956,7 +956,7 @@ walk_dict_test( const LaunchParams* params, const DictionaryCtxt* dict,
XP_U16 min, max; XP_U16 min, max;
if ( !testMinMax || !parsePair( testMinMax, &min, &max ) ) { if ( !testMinMax || !parsePair( testMinMax, &min, &max ) ) {
min = 0; min = 0;
max = MAX_COLS; max = MAX_COLS_DICT;
} }
dict_initIter( &iter, dict, min, max ); dict_initIter( &iter, dict, min, max );
@ -1048,7 +1048,7 @@ walk_dict_test( const LaunchParams* params, const DictionaryCtxt* dict,
guint count = g_slist_length( testPrefixes ); guint count = g_slist_length( testPrefixes );
for ( ii = 0; ii < count; ++ii ) { for ( ii = 0; ii < count; ++ii ) {
gchar* prefix = (gchar*)g_slist_nth_data( testPrefixes, ii ); gchar* prefix = (gchar*)g_slist_nth_data( testPrefixes, ii );
Tile tiles[MAX_COLS]; Tile tiles[MAX_COLS_DICT];
XP_U16 nTiles = VSIZE(tiles); XP_U16 nTiles = VSIZE(tiles);
if ( dict_tilesForString( dict, prefix, tiles, &nTiles ) ) { if ( dict_tilesForString( dict, prefix, tiles, &nTiles ) ) {
if ( dict_findStartsWith( &iter, NULL, tiles, nTiles ) ) { if ( dict_findStartsWith( &iter, NULL, tiles, nTiles ) ) {