From 421d0a29b1cab693d29e46af0a11525609409b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Sat, 23 Dec 2006 13:50:43 +0000 Subject: [PATCH] Fixed a few char/wchar_t issues. The remaining ones need a wchar_t-aware dictionary --- game/bag.cpp | 2 +- game/board.cpp | 8 ++++---- game/board_cross.cpp | 8 ++++---- game/game.cpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/game/bag.cpp b/game/bag.cpp index 4c6186a..c35680d 100644 --- a/game/bag.cpp +++ b/game/bag.cpp @@ -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"); } diff --git a/game/board.cpp b/game/board.cpp index 91f415b..cbe4f30 100644 --- a/game/board.cpp +++ b/game/board.cpp @@ -272,16 +272,16 @@ int Board::checkRoundAux(Matrix &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; diff --git a/game/board_cross.cpp b/game/board_cross.cpp index 4f285d1..2671a4f 100644 --- a/game/board_cross.cpp +++ b/game/board_cross.cpp @@ -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(); } } diff --git a/game/game.cpp b/game/game.cpp index b244837..a117892 100644 --- a/game/game.cpp +++ b/game/game.cpp @@ -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