From 52250ef9f9be242bcefa14077cf22cb28f4693c1 Mon Sep 17 00:00:00 2001 From: James Turk Date: Mon, 16 Jun 2003 07:45:03 +0000 Subject: [PATCH] source revisions and clarifications --- include/ZE_Includes.h | 16 ++++++---------- src/ZE_ZClient.cpp | 10 ++++++---- src/ZE_ZConfigFile.cpp | 4 ++-- src/ZE_ZEngine.cpp | 4 ++-- vc7/ZEngine.vcproj | 6 ++++++ 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/include/ZE_Includes.h b/include/ZE_Includes.h index c71dbbe..bb857e1 100644 --- a/include/ZE_Includes.h +++ b/include/ZE_Includes.h @@ -44,15 +44,11 @@ #endif #include "external/mt19937ar.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include //used frequently +#include //used by ZEngine for ZErrors +#include //used by ZConfigFile +#include //used by ZConfigFile +#include //used in parsing +#include //used to seed the random generator #endif //__ze_includes_h__ diff --git a/src/ZE_ZClient.cpp b/src/ZE_ZClient.cpp index 3840bb3..a728297 100755 --- a/src/ZE_ZClient.cpp +++ b/src/ZE_ZClient.cpp @@ -13,7 +13,7 @@ \brief Source file for ZClient. Implementation file for ZClient, the TCP Client class for ZEngine. -
$Id: ZE_ZClient.cpp,v 1.9 2003/06/11 05:51:15 cozman Exp $
+
$Id: ZE_ZClient.cpp,v 1.10 2003/06/16 07:45:03 cozman Exp $
\author James Turk **/ @@ -26,7 +26,8 @@ namespace ZE std::string num2dotted4(unsigned int num) { - vector ip; + int ip[4]; + int index=0; int d=16777216; //2^24 int m; @@ -35,11 +36,12 @@ std::string num2dotted4(unsigned int num) { m = num/d; num %= d; - ip.push_back(m); + ip[index] = m; + ++index; d /= 256; } - return FormatStr("%d.%d.%d.%d",ip[3],ip[2],ip[1],ip[0]); + return FormatStr("%d.%d.%d.%d",ip[0],ip[1],ip[2],ip[3]); } ZClient::ZClient(bool verbose) : diff --git a/src/ZE_ZConfigFile.cpp b/src/ZE_ZConfigFile.cpp index e4be9d5..2a176a1 100644 --- a/src/ZE_ZConfigFile.cpp +++ b/src/ZE_ZConfigFile.cpp @@ -13,7 +13,7 @@ \brief Source file for ZConfigFile. Implementation of ZConfigFile, the ZEngine INI-Style Config File. -
$Id: ZE_ZConfigFile.cpp,v 1.12 2003/06/11 05:51:15 cozman Exp $
+
$Id: ZE_ZConfigFile.cpp,v 1.13 2003/06/16 07:45:03 cozman Exp $
\author James Turk **/ @@ -191,7 +191,7 @@ void ZConfigFile::Process(std::string filename) //if std::string is bracketed it is a section, if it begins in a letter it is a variable if(tmp[0] == '[' && tmp[tmp.length()-1] == ']') section = str; - else if(isalpha(tmp[0])) + else if(std::isalpha(tmp[0])) { var = str.substr(0,str.find('=')); //split the std::string at the equals sign SetVariable(section,var,str.substr(str.find('=')+1,str.length()-var.length()-1)); diff --git a/src/ZE_ZEngine.cpp b/src/ZE_ZEngine.cpp index 6acf7ac..953ed21 100644 --- a/src/ZE_ZEngine.cpp +++ b/src/ZE_ZEngine.cpp @@ -13,7 +13,7 @@ \brief Central source file for ZEngine. Actual implementation of ZEngine singleton class, the core of ZEngine. -
$Id: ZE_ZEngine.cpp,v 1.46 2003/06/11 05:51:15 cozman Exp $
+
$Id: ZE_ZEngine.cpp,v 1.47 2003/06/16 07:45:03 cozman Exp $
\author James Turk **/ @@ -43,7 +43,7 @@ ZEngine::ZEngine() : ZError::CreateStringTable(); - SeedRandom(static_cast(time(NULL))); + SeedRandom(static_cast(std::time(NULL))); } ZEngine* ZEngine::GetInstance() diff --git a/vc7/ZEngine.vcproj b/vc7/ZEngine.vcproj index a5cd3ac..3d1ab63 100644 --- a/vc7/ZEngine.vcproj +++ b/vc7/ZEngine.vcproj @@ -57,6 +57,9 @@ + + @@ -112,6 +115,9 @@ + +