diff --git a/xwords4/android/XWords4-bt/jni/Android.mk b/xwords4/android/XWords4-bt/jni/Android.mk index ae57c40ce..e1ff553d1 100644 --- a/xwords4/android/XWords4-bt/jni/Android.mk +++ b/xwords4/android/XWords4-bt/jni/Android.mk @@ -33,7 +33,6 @@ local_DEFINES += \ -DFEATURE_TRAY_EDIT \ -DMAX_ROWS=32 \ -DINITIAL_CLIENT_VERS=2 \ - -DNODE_CAN_4 \ -DRELAY_ROOM_DEFAULT=\"\"\ -D__LITTLE_ENDIAN \ diff --git a/xwords4/android/XWords4-sms/jni/Android.mk b/xwords4/android/XWords4-sms/jni/Android.mk index 012a4b0fc..d1169b0a9 100644 --- a/xwords4/android/XWords4-sms/jni/Android.mk +++ b/xwords4/android/XWords4-sms/jni/Android.mk @@ -37,7 +37,6 @@ local_DEFINES += \ -DHASH_STREAM \ -DXWFEATURE_BASE64 \ -DINITIAL_CLIENT_VERS=2 \ - -DNODE_CAN_4 \ -DRELAY_ROOM_DEFAULT=\"\" \ -D__LITTLE_ENDIAN \ diff --git a/xwords4/android/XWords4/jni/Android.mk b/xwords4/android/XWords4/jni/Android.mk index 671e37409..7154bc7eb 100644 --- a/xwords4/android/XWords4/jni/Android.mk +++ b/xwords4/android/XWords4/jni/Android.mk @@ -34,7 +34,6 @@ local_DEFINES += \ -DHASH_STREAM \ -DXWFEATURE_BASE64 \ -DINITIAL_CLIENT_VERS=2 \ - -DNODE_CAN_4 \ -DRELAY_ROOM_DEFAULT=\"\" \ -D__LITTLE_ENDIAN \ diff --git a/xwords4/android/XWords4/jni/anddict.c b/xwords4/android/XWords4/jni/anddict.c index 9b9b06362..382736b7f 100644 --- a/xwords4/android/XWords4/jni/anddict.c +++ b/xwords4/android/XWords4/jni/anddict.c @@ -376,13 +376,8 @@ parseDict( AndDictionaryCtxt* ctxt, XP_U8 const* ptr, XP_U32 dictLength, CHECK_PTR( ptr, sizeof(offset), end ); offset = n_ptr_tohl( &ptr ); dictLength -= sizeof(offset); -#ifdef NODE_CAN_4 XP_ASSERT( dictLength % ctxt->super.nodeSize == 0 ); *numEdges = dictLength / ctxt->super.nodeSize; -#else - XP_ASSERT( dictLength % 3 == 0 ); - *numEdges = dictLength / 3; -#endif #ifdef DEBUG ctxt->super.numEdges = *numEdges; #endif @@ -392,12 +387,8 @@ parseDict( AndDictionaryCtxt* ctxt, XP_U8 const* ptr, XP_U32 dictLength, if ( dictLength > 0 ) { ctxt->super.base = (array_edge*)ptr; -#ifdef NODE_CAN_4 ctxt->super.topEdge = ctxt->super.base + (offset * ctxt->super.nodeSize); -#else - ctxt->super.topEdge = ctxt->super.base + (offset * 3); -#endif } else { ctxt->super.topEdge = (array_edge*)NULL; ctxt->super.base = (array_edge*)NULL; diff --git a/xwords4/common/dawg.h b/xwords4/common/dawg.h index a29187d2d..8473ed5fc 100644 --- a/xwords4/common/dawg.h +++ b/xwords4/common/dawg.h @@ -66,9 +66,7 @@ typedef struct dawg_header { unsigned char charTableRecNum; unsigned char valTableRecNum; unsigned char reserved[3]; /* worst case this points to a new resource */ -#ifdef NODE_CAN_4 unsigned short flags; -#endif } dawg_header; /* Part of xwords3 dictionaries on PalmOS */ diff --git a/xwords4/common/dictnry.c b/xwords4/common/dictnry.c index bd30d8a13..52e0dadb6 100644 --- a/xwords4/common/dictnry.c +++ b/xwords4/common/dictnry.c @@ -600,7 +600,6 @@ dict_super_edge_for_index( const DictionaryCtxt* dict, XP_U32 index ) result = NULL; } else { XP_ASSERT( index < dict->numEdges ); -#ifdef NODE_CAN_4 /* avoid long-multiplication lib call on Palm... */ if ( dict->nodeSize == 3 ) { index += (index << 1); @@ -608,9 +607,6 @@ dict_super_edge_for_index( const DictionaryCtxt* dict, XP_U32 index ) XP_ASSERT( dict->nodeSize == 4 ); index <<= 2; } -#else - index += (index << 1); -#endif result = &dict->base[index]; } return result; @@ -627,7 +623,6 @@ dict_super_index_from( const DictionaryCtxt* dict, array_edge* p_edge ) { unsigned long result; -#ifdef NODE_CAN_4 array_edge_new* edge = (array_edge_new*)p_edge; result = ((edge->highByte << 8) | edge->lowByte) & 0x0000FFFF; @@ -639,14 +634,6 @@ dict_super_index_from( const DictionaryCtxt* dict, array_edge* p_edge ) result |= 0x00010000; /* using | instead of + saves 4 bytes */ } } -#else - array_edge_old* edge = (array_edge_old*)p_edge; - result = ((edge->highByte << 8) | edge->lowByte) & 0x0000FFFF; - if ( (edge->bits & EXTRABITMASK_OLD) != 0 ) { - result |= 0x00010000; /* using | instead of + saves 4 bytes */ - } -#endif - return result; } /* dict_super_index_from */ @@ -673,11 +660,7 @@ dict_super_edge_with_tile( const DictionaryCtxt* dict, array_edge* from, from = NULL; break; } -#ifdef NODE_CAN_4 from += dict->nodeSize; -#else - from += 3; -#endif } return from; diff --git a/xwords4/common/dictnry.h b/xwords4/common/dictnry.h index 53788e77a..ea3f6bc79 100644 --- a/xwords4/common/dictnry.h +++ b/xwords4/common/dictnry.h @@ -83,10 +83,8 @@ struct DictionaryCtxt { XP_LangCode langCode; XP_U8 nFaces; -#ifdef NODE_CAN_4 XP_U8 nodeSize; XP_Bool is_4_byte; -#endif XP_S8 blankTile; /* negative means there's no known blank */ XP_Bool isUTF8; @@ -130,22 +128,13 @@ struct DictionaryCtxt { #define dict_edge_with_tile(d,e,t) (*((d)->func_dict_edge_with_tile))(d,e,t) #define dict_getShortName(d) (*((d)->func_dict_getShortName))(d) -#ifdef NODE_CAN_4 -# define ISACCEPTING(d,e) \ +#define ISACCEPTING(d,e) \ ((ACCEPTINGMASK_NEW & ((array_edge_old*)(e))->bits) != 0) -# define IS_LAST_EDGE(d,e) \ +#define IS_LAST_EDGE(d,e) \ ((LASTEDGEMASK_NEW & ((array_edge_old*)(e))->bits) != 0) -# define EDGETILE(d,edge) \ +#define EDGETILE(d,edge) \ ((Tile)(((array_edge_old*)(edge))->bits & \ ((d)->is_4_byte?LETTERMASK_NEW_4:LETTERMASK_NEW_3))) -#else -# define ISACCEPTING(d,e) \ - ((ACCEPTINGMASK_OLD & ((array_edge_old*)(e))->bits) != 0) -# define IS_LAST_EDGE(d,e) \ - ((LASTEDGEMASK_OLD & ((array_edge_old*)(e))->bits) != 0) -# define EDGETILE(d,edge) \ - ((Tile)(((array_edge_old*)(edge))->bits & LETTERMASK_OLD)) -#endif XP_Bool dict_tilesAreSame( const DictionaryCtxt* dict1, const DictionaryCtxt* dict2 ); diff --git a/xwords4/common/engine.c b/xwords4/common/engine.c index 5d9717f38..eaecbe35b 100644 --- a/xwords4/common/engine.c +++ b/xwords4/common/engine.c @@ -716,11 +716,7 @@ figureCrosschecks( EngineCtxt* engine, XP_U16 x, XP_U16 y, XP_U16* scoreP, if ( IS_LAST_EDGE(dict,candidateEdge ) ) { break; } -#ifdef NODE_CAN_4 candidateEdge += dict->nodeSize; -#else - candidateEdge += 3; -#endif } } outer: @@ -893,9 +889,7 @@ leftPart( EngineCtxt* engine, Tile* tiles, XP_U16 tileLength, anchorCol, row ); if ( !engine->returnNOW ) { if ( (limit > 0) && (edge != NULL) ) { -#ifdef NODE_CAN_4 XP_U16 nodeSize = engine->dict->nodeSize; -#endif if ( engine->nTilesMax > 0 ) { for ( ; ; ) { XP_Bool isBlank; @@ -911,12 +905,7 @@ leftPart( EngineCtxt* engine, Tile* tiles, XP_U16 tileLength, if ( IS_LAST_EDGE( dict, edge ) || engine->returnNOW ) { break; } -#ifdef NODE_CAN_4 edge += nodeSize; -#else - edge += 3; -#endif - } } } @@ -980,11 +969,7 @@ extendRight( EngineCtxt* engine, Tile* tiles, XP_U16 tileLength, if ( IS_LAST_EDGE( dict, edge ) ) { break; } -#ifdef NODE_CAN_4 edge += dict->nodeSize; -#else - edge += 3; -#endif } } diff --git a/xwords4/linux/Makefile b/xwords4/linux/Makefile index 0d8686b92..eb788b2fb 100644 --- a/xwords4/linux/Makefile +++ b/xwords4/linux/Makefile @@ -78,7 +78,7 @@ endif include ../common/config.mk -DEFINES += -DPLATFORM_LINUX -DKEY_SUPPORT -DKEYBOARD_NAV -DNODE_CAN_4 \ +DEFINES += -DPLATFORM_LINUX -DKEY_SUPPORT -DKEYBOARD_NAV \ -DSCROLL_DRAG_THRESHHOLD=1 -DNUM_SAVED_ENGINE_MOVES=32 # DEFINES += -DSTUBBED_DICT ifdef DO_GTK diff --git a/xwords4/linux/linuxdict.c b/xwords4/linux/linuxdict.c index 76eace460..d6c25cf72 100644 --- a/xwords4/linux/linuxdict.c +++ b/xwords4/linux/linuxdict.c @@ -252,7 +252,6 @@ initFromDictFile( LinuxDictionaryCtxt* dctx, const char* fileName ) flags &= ~DICT_HEADER_MASK; XP_DEBUGF( "has header!" ); } -#ifdef NODE_CAN_4 if ( flags == 0x0001 ) { dctx->super.nodeSize = 3; charSize = 1; @@ -281,10 +280,6 @@ initFromDictFile( LinuxDictionaryCtxt* dctx, const char* fileName ) XP_ASSERT(0); } -#else - XP_ASSERT( flags == 0x0001 ); -#endif - if ( formatOk ) { XP_U8 numFaceBytes, numFaces; @@ -351,17 +346,9 @@ initFromDictFile( LinuxDictionaryCtxt* dctx, const char* fileName ) } if ( dictLength > 0 ) { -# ifdef NODE_CAN_4 numEdges = dictLength / dctx->super.nodeSize; -# else - numEdges = dictLength / 3; -# endif #ifdef DEBUG -# ifdef NODE_CAN_4 XP_ASSERT( (dictLength % dctx->super.nodeSize) == 0 ); -# else - XP_ASSERT( (dictLength % 3) == 0 ); -# endif dctx->super.numEdges = numEdges; #endif dctx->super.base = (array_edge*)ptr;