Fixed a few char/wchar_t issues. The remaining ones need a wchar_t-aware dictionary

This commit is contained in:
Olivier Teulière 2006-12-23 13:50:43 +00:00
parent 21c07afee4
commit 421d0a29b1
4 changed files with 10 additions and 10 deletions

View file

@ -132,7 +132,7 @@ void Bag::dumpAll() const
for (it = m_tilesMap.begin(); it != m_tilesMap.end(); it++)
{
if (it->second)
fprintf(stderr, "%c[%i] ", it->first.toChar(), it->second);
fprintf(stderr, "%lc[%i] ", it->first.toChar(), it->second);
}
fprintf(stderr, "\n");
}

View file

@ -272,16 +272,16 @@ int Board::checkRoundAux(Matrix<Tile> &iTilesMx,
/* There is already a letter on the board */
if (iTilesMx[row][col + i] != t)
{
/* check if it is only a joker */
/* Check if it is only a joker */
if ((iTilesMx[row][col+i].toCode() == t.toCode()) && iTilesMx[row][col+i].isJoker())
{
// do nothing, we don't need to change the tile in the round
// Do nothing, we don't need to change the tile in the round
// iRound.setJoker(i,true);
debug("load: play on joker for letter %d (%c)\n",i,iRound.getTile(i).toChar());
debug("load: play on joker for letter %d (%lc)\n", i, iRound.getTile(i).toChar());
}
else
{
debug("load: overwriting tile %c with %c\n",
debug("load: overwriting tile %lc with %lc\n",
iTilesMx[row][col+i].toChar(),
t.toChar());
return 2;

View file

@ -65,7 +65,7 @@ static void Board_checkout_tile(const Dictionary &iDic,
/* Tiles that can be played */
node = Dic_char_lookup(iDic, Dic_root(iDic), leftTiles);
if (node == 0)
if (node == 0)
{
oCross.setNone();
return;
@ -83,9 +83,9 @@ static void Board_checkout_tile(const Dictionary &iDic,
/* yes, it is REALLY [index+1] */
while (!iTiles[index+1].isEmpty())
{
index++;
if (!iJoker[index])
oPoints += iTiles[index].getPoints();
index++;
if (!iJoker[index])
oPoints += iTiles[index].getPoints();
}
}

View file

@ -92,7 +92,7 @@ int Game::helperPlayRound(const Round &iRound)
{
// Is the represented letter still available in the bag?
// FIXME: this way to get the represented letter sucks...
Tile t(toupper(iRound.getTile(i).toChar()));
Tile t(towupper(iRound.getTile(i).toChar()));
Bag bag;
realBag(bag);
// FIXME: realBag() does not give us a real bag in this