diff --git a/src/Client/DefScript/DefScriptTools.cpp b/src/Client/DefScript/DefScriptTools.cpp index b0efa96..e32d174 100644 --- a/src/Client/DefScript/DefScriptTools.cpp +++ b/src/Client/DefScript/DefScriptTools.cpp @@ -43,7 +43,7 @@ std::string DefScriptTools::toString(ldbl num) // hex numbers: 0xa56ff, 0XFF, 0xDEADBABE, etc (must begin with 0x) // float numbers: 99.65, 0.025 // negative numbers: -100, -0x3d, -55.123 -ldbl DefScriptTools::toNumber(std::string& str) +ldbl DefScriptTools::toNumber(std::string str) { ldbl num=0; uint64 u=0; @@ -93,14 +93,14 @@ ldbl DefScriptTools::toNumber(std::string& str) return num; } -bool DefScriptTools::isTrue(std::string& s) +bool DefScriptTools::isTrue(std::string s) { if(s.empty() || s=="false" || s=="0") return false; return true; } -uint64 DefScriptTools::toUint64(std::string& str) +uint64 DefScriptTools::toUint64(std::string str) { bool negative=false; uint64 num = 0; @@ -135,7 +135,7 @@ uint64 DefScriptTools::toUint64(std::string& str) return num; } -uint64 DefScriptTools::atoi64(std::string& str) +uint64 DefScriptTools::atoi64(std::string str) { uint64 l = 0; for (size_t i = 0; i < str.size(); i++) diff --git a/src/Client/DefScript/DefScriptTools.h b/src/Client/DefScript/DefScriptTools.h index 8922fba..5beb221 100644 --- a/src/Client/DefScript/DefScriptTools.h +++ b/src/Client/DefScript/DefScriptTools.h @@ -18,10 +18,10 @@ namespace DefScriptTools return ss.str(); } - ldbl toNumber(std::string&); - bool isTrue(std::string&); - uint64 toUint64(std::string&); - uint64 atoi64(std::string&); + ldbl toNumber(std::string); + bool isTrue(std::string); + uint64 toUint64(std::string); + uint64 atoi64(std::string); inline long double Round(long double z,unsigned int n); } diff --git a/src/Client/DefScriptInterface.cpp b/src/Client/DefScriptInterface.cpp index f5f695c..d517132 100644 --- a/src/Client/DefScriptInterface.cpp +++ b/src/Client/DefScriptInterface.cpp @@ -1,4 +1,4 @@ - +#include #include "common.h" #include "PseuWoW.h" #include "DefScript/DefScript.h" diff --git a/src/Client/GUI/MInput.h b/src/Client/GUI/MInput.h index 9abc0a8..d0adf37 100644 --- a/src/Client/GUI/MInput.h +++ b/src/Client/GUI/MInput.h @@ -124,7 +124,7 @@ public: mouse.right = false; } - virtual bool OnEvent(SEvent event) + bool OnEvent(SEvent event) { bool value = false; diff --git a/src/Client/World/World.h b/src/Client/World/World.h index 76796df..a1ede0f 100644 --- a/src/Client/World/World.h +++ b/src/Client/World/World.h @@ -13,12 +13,12 @@ struct WorldPosition float x,y,z,o; }; -inline ByteBuffer& operator<<(ByteBuffer& bb, WorldPosition& p) +inline ByteBuffer& operator<<(ByteBuffer& bb, WorldPosition p) { bb << p.x << p.y << p.z << p.o; return bb; } -inline ByteBuffer& operator>>(ByteBuffer& bb, WorldPosition& p) +inline ByteBuffer& operator>>(ByteBuffer& bb, WorldPosition p) { bb >> p.x >> p.y >> p.z >> p.o; return bb; diff --git a/src/shared/Network/TcpSocket.cpp b/src/shared/Network/TcpSocket.cpp index be0aeac..0616f5a 100644 --- a/src/shared/Network/TcpSocket.cpp +++ b/src/shared/Network/TcpSocket.cpp @@ -740,7 +740,7 @@ bool TcpSocket::OnSocks4Read() return false; } - +/* void TcpSocket::Sendf(char const *format, ...) { va_list ap; @@ -750,7 +750,7 @@ void TcpSocket::Sendf(char const *format, ...) va_end(ap); Send( slask ); } - +*/ void TcpSocket::OnSSLConnect() { diff --git a/src/shared/Network/TcpSocket.h b/src/shared/Network/TcpSocket.h index d652571..5de04ce 100644 --- a/src/shared/Network/TcpSocket.h +++ b/src/shared/Network/TcpSocket.h @@ -72,7 +72,7 @@ class TcpSocket : public Socket int Close(); void Send(const std::string &); - void Sendf(char const *format, ...); + //void Sendf(char const *format, ...); virtual void SendBuf(const char *,size_t); virtual void OnRawData(const char *,size_t) {} diff --git a/src/shared/SysDefs.h b/src/shared/SysDefs.h index c4beba3..2161cee 100644 --- a/src/shared/SysDefs.h +++ b/src/shared/SysDefs.h @@ -71,41 +71,28 @@ #define I64FMT "%016llX" #define I64FMTD "%llu" #define SI64FMTD "%lld" -# if PLATFORM == PLATFORM_UNIX - typedef __int64_t int64; - typedef __int32_t int32; - typedef __int16_t int16; - typedef __int8_t int8; - typedef __uint64_t uint64; - typedef __uint32_t uint32; - typedef __uint16_t uint16; - typedef __uint8_t uint8; - typedef uint16 WORD; - typedef uint32 DWORD; -# else - typedef long long int64; - typedef long int32; - typedef short int16; - typedef char int8; - typedef unsigned long long uint64; - typedef unsigned long uint32; - typedef unsigned short uint16; - typedef unsigned char uint8; - typedef unsigned short WORD; - typedef uint32 DWORD; -# endif + typedef long long int64; + typedef long int32; + typedef short int16; + typedef char int8; + typedef unsigned long long uint64; + typedef unsigned long uint32; + typedef unsigned short uint16; + typedef unsigned char uint8; + typedef unsigned short WORD; + typedef uint32 DWORD; #endif #ifndef SIGQUIT #define SIGQUIT 3 #endif -#ifdef min -#undef min +#ifndef min +#define min(a, b) ((a < b) ? a : b) #endif -#ifdef max -#undef max +#ifndef max +#define max(a, b) ((a > b) ? a : b) #endif #if COMPILER == COMPILER_MICROSOFT @@ -120,12 +107,11 @@ # define COMPILER_VERSION_OUT "%u" #elif COMPILER == COMPILER_GNU # define COMPILER_NAME "GCC" -# ifdef __GNUC_PATCHLEVEL__ -# define COMPILER_VERSION STRINGIZE(__GNUC__) "." STRINGIZE(__GNUC_MINOR__) "." STRINGIZE(__GNUC_PATCHLEVEL__) -# else -# define COMPILER_VERSION STRINGIZE(__GNUC__) "." STRINGIZE(__GNUC_MINOR__) +# ifndef __GNUC_PATCHLEVEL__ +# define __GNUC_PATCHLEVEL__ 0 # endif -# define COMPILER_VERSION_OUT "%s" +# define COMPILER_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_OUT "%u" // TODO: add more compilers here when necessary #else # define COMPILER_NAME "unknown"