From a2306446c86b3333e69b082e41ae76ba71a42d9d Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 24 Mar 2011 13:57:13 -0700 Subject: Optimize common objects, and adjust other objects accordingly. Major changes still need to be made to each of the servers. --- src/tool/Makefile | 10 ++++------ src/tool/eathena-monitor.c | 6 +++--- src/tool/itemfrob.c | 7 +------ src/tool/mapfrob.c | 7 +------ src/tool/marriage-info.c | 6 +----- src/tool/moneycount/mmo.h | 15 --------------- src/tool/skillfrob.c | 5 ----- 7 files changed, 10 insertions(+), 46 deletions(-) (limited to 'src/tool') diff --git a/src/tool/Makefile b/src/tool/Makefile index 87393fb..8d51c25 100644 --- a/src/tool/Makefile +++ b/src/tool/Makefile @@ -1,15 +1,13 @@ include ../../make.defs -COBJS=../common/timer.o ../common/malloc.o ../common/socket.o ../common/lock.o ../common/db.o ../char/int_storage.o ../char/inter.o ../char/int_party.o ../char/int_guild.o -MOBJS=../common/socket.o ../common/timer.o ../common/db.o ../common/lock.o ../common/malloc.o ../char/int_guild.o ../char/int_party.o ../char/int_storage.o ../char/inter.o +OBJS =../common/timer.o ../common/socket.o ../common/db.o ../common/lock.o ../char/inter.o ../char/int_guild.o ../char/int_party.o ../char/int_storage.o all: adduser itemfrob mapfrob marriage-info eathena-monitor adduser: adduser.o ../common/socket.o -itemfrob: itemfrob.o ${COBJS} -mapfrob: mapfrob.o ${COBJS} -marriage-info: marriage-info.o ${MOBJS} +itemfrob: itemfrob.o ${OBJS} +mapfrob: mapfrob.o ${OBJS} +marriage-info: marriage-info.o ${OBJS} eathena-monitor: eathena-monitor.c - $(CC) $(CFLAGS) -o eathena-monitor eathena-monitor.c clean: rm -f adduser itemfrob mapfrob marriage-info eathena-monitor diff --git a/src/tool/eathena-monitor.c b/src/tool/eathena-monitor.c index 04a48cf..6e26706 100644 --- a/src/tool/eathena-monitor.c +++ b/src/tool/eathena-monitor.c @@ -27,7 +27,7 @@ #define SKIP_BLANK(ptr) ptr += skip_blank(ptr) -inline size_t skip_blank(const char* ptr) { +static inline size_t skip_blank(const char* ptr) { size_t i = 0; while ( (ptr[i] == ' ') || @@ -39,7 +39,7 @@ inline size_t skip_blank(const char* ptr) { } #define GOTO_EQL(ptr) ptr += goto_eql(ptr) -inline size_t goto_eql(const char* ptr) { +static inline size_t goto_eql(const char* ptr) { size_t i = 0; while ( (ptr[i] != '\0') && @@ -51,7 +51,7 @@ inline size_t goto_eql(const char* ptr) { } #define GOTO_EOL(ptr) ptr += goto_newline(ptr) -inline size_t goto_newline(const char* ptr) { +static inline size_t goto_newline(const char* ptr) { size_t i = 0; while ( (ptr[i] != '\0') && diff --git a/src/tool/itemfrob.c b/src/tool/itemfrob.c index bc9ff35..646ec73 100644 --- a/src/tool/itemfrob.c +++ b/src/tool/itemfrob.c @@ -4,6 +4,7 @@ #include #include #include "../common/mmo.h" +// Yes, this is intentional #include "../char/char.c" // Well, this is not terribly elegant, but I don't have that much time. @@ -37,7 +38,6 @@ int mmo_char_convert () fprintf (ofp, "%s" RETCODE, line); } } - fcloseall (); return 0; } @@ -128,8 +128,3 @@ int main (int argc, char *argv[]) return 0; } - -/* satisfy linker */ -void set_termfunc (void (*termfunc) (void)) -{ -}; diff --git a/src/tool/mapfrob.c b/src/tool/mapfrob.c index d410878..11983eb 100644 --- a/src/tool/mapfrob.c +++ b/src/tool/mapfrob.c @@ -4,6 +4,7 @@ #include #include #include "../common/mmo.h" +// Yes, this is intentional #include "../char/char.c" // Well, this is not terribly elegant, but I don't have that much time. @@ -63,7 +64,6 @@ int mmo_char_convert () fprintf (ofp, "%s" RETCODE, line); } } - fcloseall (); return 0; } @@ -127,8 +127,3 @@ int main (int argc, char *argv[]) return 0; } - -/* satisfy linker */ -void set_termfunc (void (*termfunc) (void)) -{ -}; diff --git a/src/tool/marriage-info.c b/src/tool/marriage-info.c index 9b91955..4d7cbc3 100644 --- a/src/tool/marriage-info.c +++ b/src/tool/marriage-info.c @@ -9,6 +9,7 @@ src/char/int_party.o src/char/int_storage.o src/char/inter.o #include #include "../login/login.h" #include "../common/mmo.h" +// Yes, this is intentional #include "../char/char.c" int mode; @@ -442,7 +443,6 @@ int mmo_char_dump() mmo_check_dumpworthy(&char_dat); } } - fcloseall(); return 0; } @@ -480,7 +480,3 @@ int main(int argc,char *argv[]) return 0; } - - -/* satisfy linker */ -void set_termfunc(void (*termfunc)(void)) {}; diff --git a/src/tool/moneycount/mmo.h b/src/tool/moneycount/mmo.h index 640065a..c7ab21f 100644 --- a/src/tool/moneycount/mmo.h +++ b/src/tool/moneycount/mmo.h @@ -310,20 +310,5 @@ enum }; -#ifndef LCCWIN32 -#ifndef strcmpi -#define strcmpi strcasecmp -#endif -#ifndef stricmp -#define stricmp strcasecmp -#endif -#ifndef strncmpi -#define strncmpi strncasecmp -#endif -#ifndef strnicmp -#define strnicmp strncasecmp -#endif -#endif - #endif // _MMO_H_ diff --git a/src/tool/skillfrob.c b/src/tool/skillfrob.c index ea68660..c7b6bb6 100644 --- a/src/tool/skillfrob.c +++ b/src/tool/skillfrob.c @@ -78,8 +78,3 @@ int main (int argc, char *argv[]) return 0; } - -/* satisfy linker */ -void set_termfunc (void (*termfunc) (void)) -{ -}; -- cgit v1.2.3-60-g2f50