mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
dict_tilesToString sig change
This commit is contained in:
parent
3d067ccbbc
commit
56accaaad5
5 changed files with 18 additions and 11 deletions
|
@ -1677,7 +1677,7 @@ drawCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool skipBlanks )
|
|||
XP_ASSERT( !!bitmap );
|
||||
textP = (XP_UCHAR*)NULL;
|
||||
} else {
|
||||
dict_tilesToString( dict, &tile, 1, ch );
|
||||
dict_tilesToString( dict, &tile, 1, ch, sizeof(ch) );
|
||||
}
|
||||
}
|
||||
bonus = util_getSquareBonus( board->util, model, col, row );
|
||||
|
|
|
@ -921,7 +921,8 @@ model_packTilesUtil( ModelCtxt* model, PoolContext* pool,
|
|||
|
||||
tiles[nFacesAvail] = tile;
|
||||
nChars = dict_tilesToString( dict, &tile, 1,
|
||||
(XP_UCHAR*)&texts[nFacesAvail] );
|
||||
(XP_UCHAR*)&texts[nFacesAvail],
|
||||
sizeof(texts[0]) );
|
||||
XP_ASSERT( nChars < sizeof(texts[0]) );
|
||||
++nFacesAvail;
|
||||
}
|
||||
|
@ -1383,7 +1384,8 @@ formatTray( const TrayTileSet* tiles, DictionaryCtxt* dict, XP_UCHAR* buf,
|
|||
}
|
||||
buf[i] = '\0';
|
||||
} else {
|
||||
dict_tilesToString( dict, (Tile*)tiles->tiles, tiles->nTiles, buf );
|
||||
dict_tilesToString( dict, (Tile*)tiles->tiles, tiles->nTiles,
|
||||
buf, sizeof(buf) );
|
||||
}
|
||||
|
||||
return buf;
|
||||
|
|
|
@ -676,7 +676,8 @@ scoreWord( ModelCtxt* model, MoveInfo* movei, /* new tiles */
|
|||
|
||||
if ( !legal ) {
|
||||
XP_UCHAR buf[(MAX_ROWS*2)+1];
|
||||
dict_tilesToString( dict, checkWordBuf, len, buf );
|
||||
dict_tilesToString( dict, checkWordBuf, len, buf,
|
||||
sizeof(buf) );
|
||||
(*notifyInfo->proc)( buf, notifyInfo->closure );
|
||||
}
|
||||
}
|
||||
|
@ -766,7 +767,7 @@ wordScoreFormatterAddTile( WordScoreFormatter* fmtr, Tile tile,
|
|||
|
||||
++fmtr->nTiles;
|
||||
|
||||
dict_tilesToString( fmtr->dict, &tile, 1, buf );
|
||||
dict_tilesToString( fmtr->dict, &tile, 1, buf, sizeof(buf) );
|
||||
XP_ASSERT( XP_STRLEN(fmtr->wordBuf) + XP_STRLEN(buf) < sizeof(fmtr->wordBuf) );
|
||||
XP_STRCAT( fmtr->wordBuf, buf );
|
||||
if ( isBlank ) {
|
||||
|
@ -798,7 +799,8 @@ wordScoreFormatterFinish( WordScoreFormatter* fmtr, Tile* word, XWStreamCtxt* st
|
|||
XP_UCHAR* mainWord )
|
||||
{
|
||||
XP_UCHAR buf[(MAX_ROWS*2)+1];
|
||||
XP_U16 len = dict_tilesToString( fmtr->dict, word, fmtr->nTiles, buf );
|
||||
XP_U16 len = dict_tilesToString( fmtr->dict, word, fmtr->nTiles,
|
||||
buf, sizeof(buf) );
|
||||
|
||||
if ( !!stream ) {
|
||||
stream_putBytes( stream, buf, len );
|
||||
|
|
|
@ -1362,7 +1362,9 @@ curTrayAsTexts( ServerCtxt* server, XP_U16 turn, const TrayTileSet* notInTray,
|
|||
}
|
||||
|
||||
if ( !toBeTraded ) {
|
||||
dict_tilesToString( dict, &tile, 1, (XP_UCHAR*)&curTrayText[nUsed++] );
|
||||
dict_tilesToString( dict, &tile, 1,
|
||||
(XP_UCHAR*)&curTrayText[nUsed++],
|
||||
sizeof(curTrayText[0]) );
|
||||
}
|
||||
}
|
||||
*nUsedP = nUsed;
|
||||
|
@ -1439,7 +1441,8 @@ fetchTiles( ServerCtxt* server, XP_U16 playerNum, XP_U16 nToFetch,
|
|||
pool_removeTiles( pool, &oneTile );
|
||||
|
||||
(void)dict_tilesToString( dict, &tile, 1,
|
||||
(XP_UCHAR*)&curTray[pi.nCurTiles++] );
|
||||
(XP_UCHAR*)&curTray[pi.nCurTiles++],
|
||||
sizeof(curTray[0]) );
|
||||
resultTiles->tiles[nSoFar++] = tile;
|
||||
++pi.thisPick;
|
||||
}
|
||||
|
@ -2350,7 +2353,7 @@ server_formatDictCounts( ServerCtxt* server, XWStreamCtxt* stream,
|
|||
count = dict_numTiles( dict, tile );
|
||||
|
||||
if ( count > 0 ) {
|
||||
dict_tilesToString( dict, &tile, 1, face );
|
||||
dict_tilesToString( dict, &tile, 1, face, sizeof(face) );
|
||||
value = dict_getTileValue( dict, tile );
|
||||
|
||||
XP_SNPRINTF( buf, sizeof(buf), (XP_UCHAR*)"%s: %d/%d",
|
||||
|
@ -2419,7 +2422,7 @@ server_formatRemainingTiles( ServerCtxt* server, XWStreamCtxt* stream,
|
|||
count = pool_getNTilesLeftFor( pool, tile ) + counts[tile];
|
||||
|
||||
if ( count > 0 ) {
|
||||
dict_tilesToString( dict, &tile, 1, face );
|
||||
dict_tilesToString( dict, &tile, 1, face, sizeof(face) );
|
||||
|
||||
buf[0] = '\0';
|
||||
putNTiles( buf, face, count );
|
||||
|
|
|
@ -151,7 +151,7 @@ drawTray( BoardCtxt* board, XP_Bool focussed )
|
|||
} else {
|
||||
textP = buf;
|
||||
dict_tilesToString( dictionary, &tile, 1,
|
||||
textP );
|
||||
textP, sizeof(buf) );
|
||||
}
|
||||
value = dict_getTileValue( dictionary, tile );
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue