Commit [060693] Maximize Restore History

cleaning code

raffa505 raffa505 2014-02-14

added LUNI Server/SUtil/MemWrp.cpp
changed LUNI Server/SUtil/Ref.h
changed LUNI Server/SUtil/SUtil.vcxproj
changed LUNI Server/SUtil/SUtil.vcxproj.filters
changed LUNI Server/LUNI Server.v12.suo
changed LUNI Server/LUNI Server.vcxproj
changed LUNI Server/LUNI Server.vcxproj.filters
changed LUNI Server/main.cpp
copied LUNI Server/SUtil/Export.h -> LUNI Server/SUtil/MemWrp.h
copied LUNI Server/IniReader.cpp -> LUNI Server/SUtil/IniReader.cpp
copied LUNI Server/IniReader.h -> LUNI Server/SUtil/IniReader.h
LUNI Server/SUtil/MemWrp.cpp Diff Switch to side-by-side view
Loading...
LUNI Server/SUtil/Ref.h Diff Switch to side-by-side view
Loading...
LUNI Server/SUtil/SUtil.vcxproj Diff Switch to side-by-side view
Loading...
LUNI Server/SUtil/SUtil.vcxproj.filters Diff Switch to side-by-side view
Loading...
LUNI Server/LUNI Server.v12.suo Diff Switch to side-by-side view
Loading...
LUNI Server/LUNI Server.vcxproj Diff Switch to side-by-side view
Loading...
LUNI Server/LUNI Server.vcxproj.filters Diff Switch to side-by-side view
Loading...
LUNI Server/main.cpp Diff Switch to side-by-side view
Loading...
LUNI Server/SUtil/Export.h to LUNI Server/SUtil/MemWrp.h
--- a/LUNI Server/SUtil/Export.h
+++ b/LUNI Server/SUtil/MemWrp.h
@@ -1,5 +1,20 @@
-#if defined(_WIN32) && !(defined(__GNUC__)  || defined(__GCCXML__)) && !defined(_RAKNET_LIB) && defined(_RAKNET_DLL)
-#define SUtil_DLL_EXPORT __declspec(dllexport)
-#else
-#define SUtil_DLL_EXPORT  
+#ifndef _SUtil_MemWrp_H
+#define _SUtil_MemWrp_H
+
+#include "Common.h"
+
+class MemWrp {
+	private:
+	uint numref;
+	public:
+	void* content;
+
+	MemWrp(void* content);
+
+	void AddRef();
+	uint RemoveRef();
+
+	destructor MemWrp();
+};
+
 #endif
LUNI Server/IniReader.cpp to LUNI Server/SUtil/IniReader.cpp
--- a/LUNI Server/IniReader.cpp
+++ b/LUNI Server/SUtil/IniReader.cpp
@@ -14,7 +14,7 @@
 	char szResult[255];
 	char szDefault[255];
 	float fltResult;
-	sprintf(szDefault, "%f", fltDefaultValue);
+	sprintf_s(szDefault, "%f", fltDefaultValue);
 	GetPrivateProfileString(szSection, szKey, szDefault, szResult, 255, m_szFileName);
 	fltResult = atof(szResult);
 	return fltResult;
@@ -23,7 +23,7 @@
 	char szResult[255];
 	char szDefault[255];
 	bool bolResult;
-	sprintf(szDefault, "%s", bolDefaultValue ? "True" : "False");
+	sprintf_s(szDefault, "%s", bolDefaultValue ? "True" : "False");
 	GetPrivateProfileString(szSection, szKey, szDefault, szResult, 255, m_szFileName);
 	bolResult = (strcmp(szResult, "True") == 0 ||
 		strcmp(szResult, "true") == 0) ? true : false;
LUNI Server/IniReader.h to LUNI Server/SUtil/IniReader.h
--- a/LUNI Server/IniReader.h
+++ b/LUNI Server/SUtil/IniReader.h
@@ -2,12 +2,12 @@
 #define INIREADER_H
 class CIniReader {
 	public:
-	CIniReader(char* szFileName);
-	int ReadInteger(char* szSection, char* szKey, int iDefaultValue);
-	float ReadFloat(char* szSection, char* szKey, float fltDefaultValue);
-	bool ReadBoolean(char* szSection, char* szKey, bool bolDefaultValue);
-	char* ReadString(char* szSection, char* szKey, const char* szDefaultValue);
+		CIniReader(char* szFileName);
+		int ReadInteger(char* szSection, char* szKey, int iDefaultValue);
+		float ReadFloat(char* szSection, char* szKey, float fltDefaultValue);
+		bool ReadBoolean(char* szSection, char* szKey, bool bolDefaultValue);
+		char* ReadString(char* szSection, char* szKey, const char* szDefaultValue);
 	private:
-	char m_szFileName[255];
+		char m_szFileName[255];
 };
 #endif