mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-18 10:26:15 +01:00
- 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:
parent
7e7f7f2dfa
commit
572b31c64e
4 changed files with 3 additions and 13 deletions
|
@ -181,17 +181,7 @@ string convertToMb(const wstring& iWStr)
|
||||||
|
|
||||||
string convertToMb(wchar_t iWChar)
|
string convertToMb(wchar_t iWChar)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
|
||||||
return convertToMb(wstring(1, iWChar));
|
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -327,7 +327,7 @@ Game* Game::gameLoadFormat_15(FILE *fin, const Dictionary& iDic)
|
||||||
int pts;
|
int pts;
|
||||||
unsigned int player;
|
unsigned int player;
|
||||||
char bonus = 0;
|
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);
|
&num, rack, tmpWord, ref, &pts, &player, &bonus);
|
||||||
|
|
||||||
debug(" -- line %s",buff);
|
debug(" -- line %s",buff);
|
||||||
|
|
|
@ -68,7 +68,7 @@ void Rack::getTiles(vector<Tile> &oTiles) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wstring Rack::toString()
|
wstring Rack::toString() const
|
||||||
{
|
{
|
||||||
wstring rs;
|
wstring rs;
|
||||||
for (unsigned int i = 1; i < m_tiles.size(); i++)
|
for (unsigned int i = 1; i < m_tiles.size(); i++)
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
void clear();
|
void clear();
|
||||||
void getTiles(vector<Tile> &oTiles) const;
|
void getTiles(vector<Tile> &oTiles) const;
|
||||||
|
|
||||||
wstring toString();
|
wstring toString() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Vector indexed by tile codes, containing the number of tiles
|
/// Vector indexed by tile codes, containing the number of tiles
|
||||||
|
|
Loading…
Reference in a new issue