- dic/encoding.cpp: simplification (this also removes a warning)

- game/rack.*: added a missing const
 - game/game_io.cpp: fixed a compilation warning
This commit is contained in:
Olivier Teulière 2008-01-11 10:09:26 +00:00
parent 7e7f7f2dfa
commit 572b31c64e
4 changed files with 3 additions and 13 deletions

View file

@ -181,17 +181,7 @@ string convertToMb(const wstring& iWStr)
string convertToMb(wchar_t iWChar)
{
#ifdef WIN32
return convertToMb(wstring(1, iWChar));
#else
char res[MB_CUR_MAX + 1];
int len = wctomb(res, iWChar);
if (len == -1)
return "";
res[len] = '\0';
return res;
#endif
}

View file

@ -327,7 +327,7 @@ Game* Game::gameLoadFormat_15(FILE *fin, const Dictionary& iDic)
int pts;
unsigned int player;
char bonus = 0;
int res = sscanf(buff, " %2d | %8s | %s | %3s | %3d | %1d | %c",
int res = sscanf(buff, " %2d | %8s | %s | %3s | %3d | %1u | %c",
&num, rack, tmpWord, ref, &pts, &player, &bonus);
debug(" -- line %s",buff);

View file

@ -68,7 +68,7 @@ void Rack::getTiles(vector<Tile> &oTiles) const
}
wstring Rack::toString()
wstring Rack::toString() const
{
wstring rs;
for (unsigned int i = 1; i < m_tiles.size(); i++)

View file

@ -55,7 +55,7 @@ public:
void clear();
void getTiles(vector<Tile> &oTiles) const;
wstring toString();
wstring toString() const;
private:
/// Vector indexed by tile codes, containing the number of tiles