mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
get rid of NODE_CAN_4. Not change to post-compiled code
This commit is contained in:
parent
b8ba3c5906
commit
464696566d
10 changed files with 4 additions and 74 deletions
|
@ -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 \
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ local_DEFINES += \
|
|||
-DHASH_STREAM \
|
||||
-DXWFEATURE_BASE64 \
|
||||
-DINITIAL_CLIENT_VERS=2 \
|
||||
-DNODE_CAN_4 \
|
||||
-DRELAY_ROOM_DEFAULT=\"\" \
|
||||
-D__LITTLE_ENDIAN \
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ local_DEFINES += \
|
|||
-DHASH_STREAM \
|
||||
-DXWFEATURE_BASE64 \
|
||||
-DINITIAL_CLIENT_VERS=2 \
|
||||
-DNODE_CAN_4 \
|
||||
-DRELAY_ROOM_DEFAULT=\"\" \
|
||||
-D__LITTLE_ENDIAN \
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue