From 598be8b40422caa9e3f78034d4a1913375e67404 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Fri, 18 Nov 2011 07:56:02 -0800 Subject: [PATCH] MAX_COLS -> MAX_COLS_DICT for dict-related stuff (since dicts are staying with fewer words for now.) --- xwords4/common/dictiter.c | 4 ++-- xwords4/common/dictiter.h | 3 ++- xwords4/common/dictnry.c | 2 +- xwords4/linux/linuxmain.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/xwords4/common/dictiter.c b/xwords4/common/dictiter.c index 7b734bd29..80d679cde 100644 --- a/xwords4/common/dictiter.c +++ b/xwords4/common/dictiter.c @@ -38,7 +38,7 @@ extern "C" { #endif typedef struct _EdgeArray { - array_edge* edges[MAX_COLS]; + array_edge* edges[MAX_COLS_DICT]; XP_U16 nEdges; } EdgeArray; @@ -391,7 +391,7 @@ dict_makeIndex( const DictIter* iter, XP_U16 depth, IndexData* data ) { ASSERT_INITED( iter ); const DictionaryCtxt* dict = iter->dict; - XP_ASSERT( depth < MAX_COLS ); + XP_ASSERT( depth < MAX_COLS_DICT ); XP_U16 ii, needCount; const XP_U16 nFaces = dict_numTileFaces( dict ); XP_U16 nNonBlankFaces = nFaces; diff --git a/xwords4/common/dictiter.h b/xwords4/common/dictiter.h index a00649ff8..14b258b4b 100644 --- a/xwords4/common/dictiter.h +++ b/xwords4/common/dictiter.h @@ -33,12 +33,13 @@ extern "C" { #endif +#define MAX_COLS_DICT 15 /* API for iterating over a dict */ typedef XP_S32 DictPosition; typedef struct _DictIter { XP_U16 nEdges; - array_edge* edges[MAX_COLS]; + array_edge* edges[MAX_COLS_DICT]; #ifdef XWFEATURE_WALKDICT_FILTER XP_U16 min; XP_U16 max; diff --git a/xwords4/common/dictnry.c b/xwords4/common/dictnry.c index 06d4f5989..3884ce0f2 100644 --- a/xwords4/common/dictnry.c +++ b/xwords4/common/dictnry.c @@ -482,7 +482,7 @@ dict_getWordCount( const DictionaryCtxt* dict ) #ifdef XWFEATURE_WALKDICT if ( 0 == nWords ) { DictIter iter; - dict_initIter( &iter, dict, 0, MAX_COLS ); + dict_initIter( &iter, dict, 0, MAX_COLS_DICT ); nWords = dict_countWords( &iter ); } #endif diff --git a/xwords4/linux/linuxmain.c b/xwords4/linux/linuxmain.c index b19ea30d2..f2a602071 100644 --- a/xwords4/linux/linuxmain.c +++ b/xwords4/linux/linuxmain.c @@ -956,7 +956,7 @@ walk_dict_test( const LaunchParams* params, const DictionaryCtxt* dict, XP_U16 min, max; if ( !testMinMax || !parsePair( testMinMax, &min, &max ) ) { min = 0; - max = MAX_COLS; + max = MAX_COLS_DICT; } 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 ); for ( ii = 0; ii < count; ++ii ) { gchar* prefix = (gchar*)g_slist_nth_data( testPrefixes, ii ); - Tile tiles[MAX_COLS]; + Tile tiles[MAX_COLS_DICT]; XP_U16 nTiles = VSIZE(tiles); if ( dict_tilesForString( dict, prefix, tiles, &nTiles ) ) { if ( dict_findStartsWith( &iter, NULL, tiles, nTiles ) ) {