eliot-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Eliot-dev] eliot dic/compdicmain.cpp dic/encoding.cpp dic/...


From: Olivier Teulière
Subject: [Eliot-dev] eliot dic/compdicmain.cpp dic/encoding.cpp dic/...
Date: Thu, 20 May 2010 20:27:47 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Changes by:     Olivier Teulière <ipkiss>       10/05/20 20:27:47

Modified files:
        dic            : compdicmain.cpp encoding.cpp encoding.h 
        utils          : eliottxt.cpp 

Log message:
        Renamed _wtoi into wtoi to avoid a name collision with mingw32 headers

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/dic/compdicmain.cpp?cvsroot=eliot&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/eliot/dic/encoding.cpp?cvsroot=eliot&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/eliot/dic/encoding.h?cvsroot=eliot&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/eliot/utils/eliottxt.cpp?cvsroot=eliot&r1=1.42&r2=1.43

Patches:
Index: dic/compdicmain.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/dic/compdicmain.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- dic/compdicmain.cpp 15 May 2010 12:14:53 -0000      1.1
+++ dic/compdicmain.cpp 20 May 2010 20:27:47 -0000      1.2
@@ -103,9 +103,9 @@
         {
             inputs = vector<wstring>(tokens.begin() + 5, tokens.end());
         }
-        ioBuilder.addLetter(letter[0], _wtoi(tokens[1].c_str()),
-                            _wtoi(tokens[2].c_str()), _wtoi(tokens[3].c_str()),
-                            _wtoi(tokens[4].c_str()), inputs);
+        ioBuilder.addLetter(letter[0], wtoi(tokens[1].c_str()),
+                            wtoi(tokens[2].c_str()), wtoi(tokens[3].c_str()),
+                            wtoi(tokens[4].c_str()), inputs);
 
         ++lineNb;
     }

Index: dic/encoding.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/dic/encoding.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- dic/encoding.cpp    19 May 2010 19:28:26 -0000      1.14
+++ dic/encoding.cpp    20 May 2010 20:27:47 -0000      1.15
@@ -71,7 +71,7 @@
 #endif
 
 
-int _wtoi(const wchar_t *iWStr)
+int wtoi(const wchar_t *iWStr)
 {
     return wcstol(iWStr, NULL, 10);
 }

Index: dic/encoding.h
===================================================================
RCS file: /cvsroot/eliot/eliot/dic/encoding.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- dic/encoding.h      29 Nov 2009 16:01:31 -0000      1.5
+++ dic/encoding.h      20 May 2010 20:27:47 -0000      1.6
@@ -28,7 +28,7 @@
 
 
 /// Equivalent of atoi for wide-caracter strings
-int _wtoi(const wchar_t *iWStr);
+int wtoi(const wchar_t *iWStr);
 
 /// Equivalent of swprintf, but working also with mingw32
 int _swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...);

Index: utils/eliottxt.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/utils/eliottxt.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- utils/eliottxt.cpp  28 Jan 2010 22:25:51 -0000      1.42
+++ utils/eliottxt.cpp  20 May 2010 20:27:47 -0000      1.43
@@ -349,7 +349,7 @@
         else
             GameIO::printSearchResults(cout,
                                        iGame.trainingGetResults(),
-                                       _wtoi(limit.c_str()));
+                                       wtoi(limit.c_str()));
     }
     else if (displayType == L"s")
         GameIO::printPoints(cout, iGame);
@@ -391,12 +391,12 @@
             return;
         if (action[0] == L'p')
         {
-            for (int i = 0; i < _wtoi(count.c_str()); ++i)
+            for (int i = 0; i < wtoi(count.c_str()); ++i)
                 iGame.prevTurn();
         }
         else if (action[0] == L'n')
         {
-            for (int i = 0; i < _wtoi(count.c_str()); ++i)
+            for (int i = 0; i < wtoi(count.c_str()); ++i)
                 iGame.nextTurn();
         }
         else if (action[0] == L'f')
@@ -467,9 +467,9 @@
     if (regexp == L"")
         return;
 
-    unsigned int nres = (cnres != L"") ? _wtoi(cnres.c_str()) : 50;
-    unsigned int lmin = (clmin != L"") ? _wtoi(clmin.c_str()) : 1;
-    unsigned int lmax = (clmax != L"") ? _wtoi(clmax.c_str()) : DIC_WORD_MAX - 
1;
+    unsigned int nres = (cnres != L"") ? wtoi(cnres.c_str()) : 50;
+    unsigned int lmin = (clmin != L"") ? wtoi(clmin.c_str()) : 1;
+    unsigned int lmax = (clmax != L"") ? wtoi(clmax.c_str()) : DIC_WORD_MAX - 
1;
 
     if (lmax > (DIC_WORD_MAX - 1) || lmin < 1 || lmin > lmax)
     {
@@ -521,11 +521,11 @@
         string setting = convertToMb(settingWide);
         if (type == L"i")
         {
-            Settings::Instance().setInt(setting, _wtoi(value.c_str()));
+            Settings::Instance().setInt(setting, wtoi(value.c_str()));
         }
         else if (type == L"b")
         {
-            Settings::Instance().setBool(setting, _wtoi(value.c_str()));
+            Settings::Instance().setBool(setting, wtoi(value.c_str()));
         }
     }
     catch (GameException &e)
@@ -635,7 +635,7 @@
                             helpTraining();
                         else
                         {
-                            int n = _wtoi(num.c_str());
+                            int n = wtoi(num.c_str());
                             if (n <= 0)
                                 printf("mauvais argument\n");
                             iGame.trainingPlayResult(n - 1);
@@ -797,7 +797,7 @@
                             helpDuplicate();
                         else
                         {
-                            int n = _wtoi(id.c_str());
+                            int n = wtoi(id.c_str());
                             if (n < 0 || n >= (int)iGame.getNbPlayers())
                             {
                                 fprintf(stderr, "Numéro de joueur invalide\n");
@@ -925,9 +925,9 @@
                         // New duplicate game
                         Duplicate *tmpGame = 
GameFactory::Instance()->createDuplicate(iDic);
                         PublicGame *game = new PublicGame(*tmpGame);
-                        for (int i = 0; i < _wtoi(nbHuman.c_str()); ++i)
+                        for (int i = 0; i < wtoi(nbHuman.c_str()); ++i)
                             game->addPlayer(new HumanPlayer);
-                        for (int i = 0; i < _wtoi(nbAI.c_str()); ++i)
+                        for (int i = 0; i < wtoi(nbAI.c_str()); ++i)
                             game->addPlayer(new AIPercent(1));
                         // Set the variant
                         if (tokens[0].size() > 1)
@@ -960,9 +960,9 @@
                         // New free game
                         FreeGame *tmpGame = 
GameFactory::Instance()->createFreeGame(iDic);
                         PublicGame *game = new PublicGame(*tmpGame);
-                        for (int i = 0; i < _wtoi(nbHuman.c_str()); i++)
+                        for (int i = 0; i < wtoi(nbHuman.c_str()); i++)
                             game->addPlayer(new HumanPlayer);
-                        for (int i = 0; i < _wtoi(nbAI.c_str()); i++)
+                        for (int i = 0; i < wtoi(nbAI.c_str()); i++)
                             game->addPlayer(new AIPercent(1));
                         // Set the variant
                         if (tokens[0].size() > 1)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]