From 3d48facb5515826f3e1935507819cb5390bf2043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Sun, 28 Aug 2011 16:33:50 +0200 Subject: [PATCH] Cosmetics --- game/game_factory.cpp | 5 ++--- game/xml_writer.cpp | 1 + test/driver | 4 ---- test/load_test_adv.input | 7 ------- test/load_test_adv.ref | 2 -- utils/eliottxt.cpp | 2 +- 6 files changed, 4 insertions(+), 17 deletions(-) delete mode 100644 test/load_test_adv.input delete mode 100644 test/load_test_adv.ref diff --git a/game/game_factory.cpp b/game/game_factory.cpp index 91ccf7d..686bfdf 100644 --- a/game/game_factory.cpp +++ b/game/game_factory.cpp @@ -21,6 +21,7 @@ #include "config.h" +#include #include #include #include @@ -153,9 +154,7 @@ Game *GameFactory::createFromCmdLine(int argc, char **argv) wstring name; if (optarg == NULL) { - // TODO: use Boost.Format - char s[200]; - snprintf(s, 200, _("Player %u"), m_players.size() + 1); + string s = str(boost::format(_("Player %1%")) % (m_players.size() + 1)); name = wfl(s); } else diff --git a/game/xml_writer.cpp b/game/xml_writer.cpp index 053e9fc..2f79d90 100644 --- a/game/xml_writer.cpp +++ b/game/xml_writer.cpp @@ -199,6 +199,7 @@ void XmlWriter::write(const Game &iGame, const string &iFileName) } else { + LOG_ERROR("Unsupported command: " << lfw(cmd->toString())); // XXX //throw SaveGameException("Unsupported command: " + lfw(cmd->toString())); } diff --git a/test/driver b/test/driver index 462028c..c56c12a 100644 --- a/test/driver +++ b/test/driver @@ -105,10 +105,6 @@ load_game 0 load_saved_game 0 # randseed unused # save and load a game combining 2 variants load_combi_variants 21 -# load a training game with advanced format (test.elt) -# load_test_adv 0 # We need to specify a much more complete file format - # before we can handle load/save on duplicate and - # freegame games ##################### # Regular Expression diff --git a/test/load_test_adv.input b/test/load_test_adv.input deleted file mode 100644 index 1dd94be..0000000 --- a/test/load_test_adv.input +++ /dev/null @@ -1,7 +0,0 @@ -c test.elt -a p -a g -a l -q -q - diff --git a/test/load_test_adv.ref b/test/load_test_adv.ref deleted file mode 100644 index ed5427b..0000000 --- a/test/load_test_adv.ref +++ /dev/null @@ -1,2 +0,0 @@ -[?] pour l'aide -commande> c test.elt diff --git a/utils/eliottxt.cpp b/utils/eliottxt.cpp index 1d72231..b109af5 100644 --- a/utils/eliottxt.cpp +++ b/utils/eliottxt.cpp @@ -179,7 +179,7 @@ wstring checkFileNameToken(const vector &tokens, uint8_t index) const wstring &wstr = tokens[index]; BOOST_FOREACH(wchar_t wch, wstr) { - if (!iswalpha(wch) && wch != L'.' && wch != L'_') + if (!iswalnum(wch) && wch != L'.' && wch != L'_') return L""; } return wstr;