mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
remove assertions from dictiter code on Android
Makes wordlist scrolling really slow, and since it's common code keeping the assertions in Linux is probably good enough.
This commit is contained in:
parent
aea47e0184
commit
353e9cf795
2 changed files with 13 additions and 5 deletions
|
@ -33,6 +33,13 @@
|
|||
#include "dictiter.h"
|
||||
#include "game.h"
|
||||
|
||||
/* Define DI_DEBUG in Makefile. It's makes iteration really slow on Android */
|
||||
#ifdef DI_DEBUG
|
||||
# define DI_ASSERT(...) XP_ASSERT(__VA_ARGS__)
|
||||
#else
|
||||
# define DI_ASSERT(...)
|
||||
#endif
|
||||
|
||||
#ifdef CPLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -455,7 +462,7 @@ dict_makeIndex( const DictIter* iter, XP_U16 depth, IndexData* data )
|
|||
{
|
||||
ASSERT_INITED( iter );
|
||||
const DictionaryCtxt* dict = iter->dict;
|
||||
XP_ASSERT( depth < MAX_COLS_DICT );
|
||||
DI_ASSERT( depth < MAX_COLS_DICT );
|
||||
XP_U16 ii, needCount;
|
||||
const XP_U16 nFaces = dict_numTileFaces( dict );
|
||||
XP_U16 nNonBlankFaces = nFaces;
|
||||
|
@ -466,7 +473,7 @@ dict_makeIndex( const DictIter* iter, XP_U16 depth, IndexData* data )
|
|||
for ( ii = 1, needCount = nNonBlankFaces; ii < depth; ++ii ) {
|
||||
needCount *= nNonBlankFaces;
|
||||
}
|
||||
XP_ASSERT( needCount <= data->count );
|
||||
DI_ASSERT( needCount <= data->count );
|
||||
|
||||
Tile allTiles[nNonBlankFaces];
|
||||
XP_U16 nTiles = 0;
|
||||
|
@ -491,10 +498,10 @@ dict_makeIndex( const DictIter* iter, XP_U16 depth, IndexData* data )
|
|||
data, &prevIter, &prevIndex );
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef DI_DEBUG
|
||||
DictPosition pos;
|
||||
for ( pos = 1; pos < data->count; ++pos ) {
|
||||
XP_ASSERT( data->indices[pos-1] < data->indices[pos] );
|
||||
DI_ASSERT( data->indices[pos-1] < data->indices[pos] );
|
||||
}
|
||||
#endif
|
||||
} /* dict_makeIndex */
|
||||
|
@ -569,7 +576,7 @@ dict_getNthWord( DictIter* iter, DictPosition position, XP_U16 depth,
|
|||
XP_Bool validWord = 0 < iter->nEdges;
|
||||
if ( validWord ) { /* uninitialized */
|
||||
wordCount = iter->nWords;
|
||||
XP_ASSERT( wordCount == dict_countWords( iter, NULL ) );
|
||||
DI_ASSERT( wordCount == dict_countWords( iter, NULL ) );
|
||||
} else {
|
||||
wordCount = dict_getWordCount( dict );
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ ifeq ($(MEMDEBUG),TRUE)
|
|||
DEFINES = -DMEM_DEBUG -DDEBUG -DENABLE_LOGGING -DNUMBER_KEY_AS_INDEX
|
||||
DEFINES += -DCOMMS_CHECKSUM
|
||||
DEFINES += -DLOG_COMMS_MSGNOS
|
||||
DEFINES += -DDI_DEBUG
|
||||
CFLAGS += -g $(GPROFFLAG) -Wall -Wunused-parameter -Wcast-align -Werror -O0
|
||||
DEFINES += -DDEBUG_HASHING
|
||||
CFLAGS += -DDEBUG_TS -rdynamic
|
||||
|
|
Loading…
Reference in a new issue