From aa2b91126827e6460a86ba0622a1f41328a7303e Mon Sep 17 00:00:00 2001 From: ultramage Date: Fri, 5 Jan 2007 15:57:01 +0000 Subject: - Major reconfiguration of the trunk VS8 project files, read the changelog for details - Also removed some deprecated code that was causing linking conflicts - And fixed a missing md5calc reference in stable's VS8 files git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9619 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 17 ++++ src/common/utils.c | 89 ------------------- src/common/utils.h | 10 --- vcproj-8/char-server_sql.vcproj | 105 +++++++++++++++-------- vcproj-8/char-server_txt.vcproj | 29 ++++--- vcproj-8/login-server_sql.vcproj | 74 ++++++++++------ vcproj-8/login-server_txt.vcproj | 84 +++++++++++------- vcproj-8/map-server_sql.vcproj | 179 +++++++++++++++++++++++++-------------- vcproj-8/map-server_txt.vcproj | 34 +++++--- 9 files changed, 343 insertions(+), 278 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 36e0ce80b..a68b2f8fa 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,23 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2007/01/05 + * Also discarded some veeery old utils code that has got equivalents + in the std libs (and therefore is silently causing a nasty collision). + * Major reconfiguration of the VS8 project files. [ultramage] + - Removed the migration binding to a VS71 template. + - Disabled the setting that defines char -> unsigned char (non-conformant). + - Switched all projects to use the common C runtime library DLL + instead of linking the static version to each exe. + - Enabled edit&continue on the TXT version (SQL already had it). + - Reconfigured the linker to use only the really required dependencies. + - Enabled full optimization and whole program optimization, + with additional speed-improving settings for the release build. + - Set the compiler/linker to produce detailed debug information even for release builds + (no performance penalty because the debug info is stored in a separate .pdb file!). + - I tested all 4 build combinations and it works for me, and it should work for you. + - There is still one very useful thing missing - setting the working dir to '..'. + I don't know how to do that, tho' since VS stores it in a separate user file. 2007/01/04 * Fixed old @go bug (it ignored einbech) [Lupus] * Added Au{R}oN's updated version of the effect list. diff --git a/src/common/utils.c b/src/common/utils.c index 25ada1ce5..c06e57083 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -51,95 +51,6 @@ void dump(unsigned char *buffer, int num) printf("\n"); } -//NOTE: There is no need to use this function as the standard sqrt is plenty fast as it is. [Skotlex] -int newt_sqrt(int input) -{ - int new_value, value = input/2, count = 0; - if (!value) //Division by zero fix, pointed out by Shinomori. [Skotlex] - return input; - do - { - new_value = (value + input/value)>>1; - if (abs(value - new_value) <= 1) - return new_value; - value = new_value; - } - while (count++ < 25); - return new_value; -} - -#if defined(_WIN32) && !defined(MINGW) -char *rindex(char *str, char c) -{ - char *sptr; - - sptr = str; - while(*sptr) - ++sptr; - if (c == '\0') - return(sptr); - while(str != sptr) - if (*sptr-- == c) - return(++sptr); - return(NULL); -} - -int strcasecmp(const char *arg1, const char *arg2) -{ - int chk, i; - - if (arg1 == NULL || arg2 == NULL) { - ShowError("strcasecmp: received a NULL pointer, %p or %p.\n", arg1, arg2); - return (0); - } - - for (i = 0; arg1[i] || arg2[i]; i++) - if ((chk = LOWER(arg1[i]) - LOWER(arg2[i])) != 0) - return (chk); /* not equal */ - - return (0); -} - -int strncasecmp(const char *arg1, const char *arg2, size_t n) -{ - int chk, i; - - if (arg1 == NULL || arg2 == NULL) { - ShowError("strncasecmp(): received a NULL pointer, %p or %p.\n", arg1, arg2); - return (0); - } - - for (i = 0; (arg1[i] || arg2[i]) && (n > 0); i++, n--) - if ((chk = LOWER(arg1[i]) - LOWER(arg2[i])) != 0) - return (chk); /* not equal */ - - return (0); -} - -void str_upper(char *name) -{ - - int len = (int)strlen(name); - while (len--) { - if (*name >= 'a' && *name <= 'z') - *name -= ('a' - 'A'); - name++; - } -} - -void str_lower(char *name) -{ - int len = (int)strlen(name); - - while (len--) { - if (*name >= 'A' && *name <= 'Z') - *name += ('a' - 'A'); - name++; - } -} - -#endif - // Allocate a StringBuf [MouseJstr] struct StringBuf * StringBuf_Malloc() { diff --git a/src/common/utils.h b/src/common/utils.h index 120224852..efd477c9b 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -13,17 +13,7 @@ #define LOWER(c) (((c)>='A' && (c) <= 'Z') ? ((c)+('a'-'A')) : (c)) #define UPPER(c) (((c)>='a' && (c) <= 'z') ? ((c)+('A'-'a')) : (c) ) -/* strcasecmp -> stricmp -> str_cmp */ -#if defined(_WIN32) && !defined(MINGW) - int strcasecmp(const char *arg1, const char *arg2); - int strncasecmp(const char *arg1, const char *arg2, size_t n); - void str_upper(char *name); - void str_lower(char *name); - char *rindex(char *str, char c); -#endif - void dump(unsigned char *buffer, int num); -int newt_sqrt(int value); //Newton aproximation for getting a fast sqrt. struct StringBuf { char *buf_; diff --git a/vcproj-8/char-server_sql.vcproj b/vcproj-8/char-server_sql.vcproj index 3cbd1240f..c60607bf5 100644 --- a/vcproj-8/char-server_sql.vcproj +++ b/vcproj-8/char-server_sql.vcproj @@ -46,8 +46,9 @@ GeneratePreprocessedFile="0" MinimalRebuild="true" BasicRuntimeChecks="3" - RuntimeLibrary="1" - DefaultCharIsUnsigned="true" + RuntimeLibrary="3" + EnableFunctionLevelLinking="true" + DefaultCharIsUnsigned="false" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" @@ -65,13 +66,14 @@ /> @@ -125,18 +127,21 @@ /> + > + RelativePath="..\src\char_sql\char.h" + > + RelativePath="..\src\common\core.h" + > + RelativePath="..\src\common\db.h" + > + RelativePath="..\src\common\graph.h" + > + RelativePath="..\src\common\grfio.h" + > + RelativePath="..\src\char_sql\int_guild.h" + > + RelativePath="..\src\char_sql\int_homun.h" + > + RelativePath="..\src\char_sql\int_party.h" + > + RelativePath="..\src\char_sql\int_pet.h" + > + RelativePath="..\src\char_sql\int_storage.h" + > + RelativePath="..\src\char_sql\inter.h" + > + RelativePath="..\src\char_sql\itemdb.h" + > + RelativePath="..\src\common\lock.h" + > + RelativePath="..\src\common\malloc.h" + > + RelativePath="..\src\common\mapindex.h" + > + RelativePath="..\src\common\mmo.h" + > + RelativePath="..\src\common\nullpo.h" + > + RelativePath="..\src\common\plugin.h" + > + RelativePath="..\src\common\plugins.h" + > + RelativePath="..\src\common\showmsg.h" + > + RelativePath="..\src\common\socket.h" + > + RelativePath="..\src\common\strlib.h" + > + RelativePath="..\src\common\timer.h" + > + RelativePath="..\src\common\utils.h" + > + RelativePath="..\src\common\version.h" + > diff --git a/vcproj-8/char-server_txt.vcproj b/vcproj-8/char-server_txt.vcproj index 78622d919..4d2090a5e 100644 --- a/vcproj-8/char-server_txt.vcproj +++ b/vcproj-8/char-server_txt.vcproj @@ -1,7 +1,7 @@ @@ -124,18 +126,22 @@ /> @@ -132,13 +133,13 @@ AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql" PreprocessorDefinitions="WIN32;_WIN32;__WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION" RuntimeLibrary="0" - DefaultCharIsUnsigned="true" + DefaultCharIsUnsigned="false" UsePrecompiledHeader="0" PrecompiledHeaderThrough="" PrecompiledHeaderFile="" WarningLevel="3" Detect64BitPortabilityProblems="false" - DebugInformationFormat="0" + DebugInformationFormat="3" CompileAs="1" /> + > + RelativePath="..\src\common\core.h" + > + RelativePath="..\src\common\db.h" + > + RelativePath="..\src\common\graph.h" + > + RelativePath="..\src\common\grfio.h" + > + RelativePath="..\src\common\lock.h" + > + RelativePath="..\src\login_sql\login.h" + > + RelativePath="..\src\common\malloc.h" + > + RelativePath="..\src\common\md5calc.h" + > + RelativePath="..\src\common\mmo.h" + > + RelativePath="..\src\common\nullpo.h" + > + RelativePath="..\src\common\plugin.h" + > + RelativePath="..\src\common\plugins.h" + > + RelativePath="..\src\common\showmsg.h" + > + RelativePath="..\src\common\socket.h" + > + RelativePath="..\src\common\strlib.h" + > + RelativePath="..\src\common\timer.h" + > + RelativePath="..\src\common\utils.h" + > + RelativePath="..\src\common\version.h" + > diff --git a/vcproj-8/login-server_txt.vcproj b/vcproj-8/login-server_txt.vcproj index 74aa6b510..157a8340d 100644 --- a/vcproj-8/login-server_txt.vcproj +++ b/vcproj-8/login-server_txt.vcproj @@ -20,7 +20,6 @@ OutputDirectory="Debug-login" IntermediateDirectory="Debug-login" ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="2" > @@ -112,8 +112,8 @@ OutputDirectory="Release-login" IntermediateDirectory="Release-login" ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="2" + WholeProgramOptimization="1" > + > + RelativePath="..\src\common\core.h" + > + RelativePath="..\src\common\db.h" + > + RelativePath="..\src\common\graph.h" + > + RelativePath="..\src\common\grfio.h" + > + RelativePath="..\src\common\lock.h" + > + RelativePath="..\src\login\login.h" + > + RelativePath="..\src\common\malloc.h" + > + RelativePath="..\src\common\md5calc.h" + > + RelativePath="..\src\common\mmo.h" + > + RelativePath="..\src\common\nullpo.h" + > + RelativePath="..\src\common\plugin.h" + > + RelativePath="..\src\common\plugins.h" + > + RelativePath="..\src\common\showmsg.h" + > + RelativePath="..\src\common\socket.h" + > + RelativePath="..\src\common\strlib.h" + > + RelativePath="..\src\common\timer.h" + > + RelativePath="..\src\common\utils.h" + > + RelativePath="..\src\common\version.h" + > diff --git a/vcproj-8/map-server_sql.vcproj b/vcproj-8/map-server_sql.vcproj index 82223da5d..d318cc745 100644 --- a/vcproj-8/map-server_sql.vcproj +++ b/vcproj-8/map-server_sql.vcproj @@ -1,7 +1,7 @@ @@ -107,6 +108,7 @@ ConfigurationType="1" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="2" + WholeProgramOptimization="1" > + > + RelativePath="..\src\map\atcommand.h" + > + RelativePath="..\src\map\battle.h" + > + RelativePath="..\src\common\cbasetypes.h" + > + RelativePath="..\src\map\charcommand.h" + > + RelativePath="..\src\map\charsave.h" + > + RelativePath="..\src\map\chat.h" + > + RelativePath="..\src\map\chrif.h" + > + RelativePath="..\src\map\clif.h" + > + RelativePath="..\src\common\core.h" + > + RelativePath="..\src\map\date.h" + > + RelativePath="..\src\common\db.h" + > + RelativePath="..\src\common\ers.h" + > + RelativePath="..\src\common\graph.h" + > + RelativePath="..\src\common\grfio.h" + > + RelativePath="..\src\map\guild.h" + > + RelativePath="..\src\map\intif.h" + > + RelativePath="..\src\map\irc.h" + > + RelativePath="..\src\map\itemdb.h" + > + RelativePath="..\src\common\limits.h" + > + RelativePath="..\src\common\lock.h" + > + RelativePath="..\src\map\log.h" + > + RelativePath="..\src\map\mail.h" + > + RelativePath="..\src\common\malloc.h" + > + RelativePath="..\src\map\map.h" + > + RelativePath="..\src\common\mapindex.h" + > + RelativePath="..\src\map\mercenary.h" + > + RelativePath="..\src\common\mmo.h" + > + RelativePath="..\src\map\mob.h" + > + RelativePath="..\src\map\npc.h" + > + RelativePath="..\src\common\nullpo.h" + > + RelativePath="..\src\map\party.h" + > + RelativePath="..\src\map\pc.h" + > + RelativePath="..\src\map\pcre.h" + > + RelativePath="..\src\map\pet.h" + > + RelativePath="..\src\common\plugin.h" + > + RelativePath="..\src\common\plugins.h" + > + RelativePath="..\src\map\script.h" + > + RelativePath="..\src\common\showmsg.h" + > + RelativePath="..\src\map\skill.h" + > + RelativePath="..\src\common\socket.h" + > + RelativePath="..\src\map\status.h" + > + RelativePath="..\src\map\storage.h" + > + RelativePath="..\src\common\strlib.h" + > + RelativePath="..\src\common\timer.h" + > + RelativePath="..\src\map\trade.h" + > + RelativePath="..\src\map\unit.h" + > + RelativePath="..\src\common\utils.h" + > + RelativePath="..\src\map\vending.h" + > + RelativePath="..\src\common\version.h" + > diff --git a/vcproj-8/map-server_txt.vcproj b/vcproj-8/map-server_txt.vcproj index 16611dfb2..6fa4837eb 100644 --- a/vcproj-8/map-server_txt.vcproj +++ b/vcproj-8/map-server_txt.vcproj @@ -1,7 +1,7 @@ @@ -107,8 +108,8 @@ OutputDirectory="Release-map" IntermediateDirectory="Release-map" ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="2" + WholeProgramOptimization="1" >