mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
cleanup; fix for 4-byte nodes on ARM
This commit is contained in:
parent
9ed0a8bc17
commit
8839dfd211
1 changed files with 32 additions and 30 deletions
|
@ -731,10 +731,10 @@ localGetBoardTile( EngineCtxt* engine, XP_U16 col, XP_U16 row,
|
|||
if ( isBlank && substBlank ) {
|
||||
result = engine->blankTile;
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
return EMPTY_TILE;
|
||||
result = EMPTY_TILE;
|
||||
}
|
||||
return result;
|
||||
} /* localGetBoardTile */
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -910,7 +910,7 @@ extendRight( EngineCtxt* engine, Tile* tiles, XP_U16 tileLength,
|
|||
|
||||
if ( edge == NULL ) { // we're off the dictionary
|
||||
if ( tile != EMPTY_TILE ) {
|
||||
return; // don't check at the end
|
||||
goto no_check; // don't check at the end
|
||||
}
|
||||
} else if ( tile == EMPTY_TILE ) {
|
||||
Crosscheck check = engine->rowChecks[col]; /* make a local copy */
|
||||
|
@ -927,7 +927,7 @@ extendRight( EngineCtxt* engine, Tile* tiles, XP_U16 tileLength,
|
|||
ISACCEPTING( dict, edge ), firstCol, col+1, row );
|
||||
rack_replace( engine, tile, isBlank );
|
||||
if ( engine->returnNOW ) {
|
||||
return;
|
||||
goto no_check;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -947,9 +947,9 @@ extendRight( EngineCtxt* engine, Tile* tiles, XP_U16 tileLength,
|
|||
accepting = ISACCEPTING( dict, edge );
|
||||
extendRight( engine, tiles, tileLength, follow(dict, edge),
|
||||
accepting, firstCol, col+1, row );
|
||||
return; /* don't do the check at the end */
|
||||
goto no_check; /* don't do the check at the end */
|
||||
} else {
|
||||
return;
|
||||
goto no_check;
|
||||
}
|
||||
check_exit:
|
||||
if ( accepting
|
||||
|
@ -959,6 +959,8 @@ extendRight( EngineCtxt* engine, Tile* tiles, XP_U16 tileLength,
|
|||
) {
|
||||
considerMove( engine, tiles, tileLength, firstCol, col, row );
|
||||
}
|
||||
no_check:
|
||||
return;
|
||||
} /* extendRight */
|
||||
|
||||
static XP_Bool
|
||||
|
@ -1008,13 +1010,12 @@ considerMove( EngineCtxt* engine, Tile* tiles, XP_S16 tileLength,
|
|||
|
||||
if ( !util_engineProgressCallback( engine->util ) ) {
|
||||
engine->returnNOW = XP_TRUE;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
||||
/* if this never gets hit then the top-level caller of leftPart should
|
||||
never pass a value greater than 7 for limit. I think we're always
|
||||
guaranteed to run out of tiles before finding a legal move with larger
|
||||
values but that it's expensive to look only to fail. */
|
||||
guaranteed to run out of tiles before finding a legal move with
|
||||
larger values but that it's expensive to look only to fail. */
|
||||
XP_ASSERT( engine->curLimit < MAX_TRAY_TILES );
|
||||
|
||||
XP_MEMSET( &posmove, 0, sizeof(posmove) );
|
||||
|
@ -1035,6 +1036,7 @@ considerMove( EngineCtxt* engine, Tile* tiles, XP_S16 tileLength,
|
|||
|
||||
considerScoreWordHasBlanks( engine, engine->blankCount, &posmove,
|
||||
lastRow, blankTuples, 0 );
|
||||
}
|
||||
} /* considerMove */
|
||||
|
||||
static void
|
||||
|
@ -1204,13 +1206,13 @@ index_from( DictionaryCtxt* dict, array_edge* p_edge )
|
|||
|
||||
#ifdef NODE_CAN_4
|
||||
array_edge_new* edge = (array_edge_new*)p_edge;
|
||||
result = ((edge->o.highByte << 8) | edge->o.lowByte) & 0x0000FFFF;
|
||||
result = ((edge->highByte << 8) | edge->lowByte) & 0x0000FFFF;
|
||||
|
||||
if ( dict->is_4_byte ) {
|
||||
result |= ((XP_U32)edge->moreBits) << 16;
|
||||
} else {
|
||||
XP_ASSERT( dict->nodeSize == 3 );
|
||||
if ( (edge->o.bits & EXTRABITMASK_NEW) != 0 ) {
|
||||
if ( (edge->bits & EXTRABITMASK_NEW) != 0 ) {
|
||||
result |= 0x00010000; /* using | instead of + saves 4 bytes */
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue