summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-06-05 01:49:44 +0200
committerHaru <haru@dotalux.com>2015-06-19 12:38:08 +0200
commitf2fbdc16a14d07e0895cc09eeba689bc556481d2 (patch)
tree76c299f94ef60fa6007321b8c403ebc93d8027c1
parent080980071b952141275526f1745d8d74c10e4deb (diff)
downloadhercules-f2fbdc16a14d07e0895cc09eeba689bc556481d2.tar.gz
hercules-f2fbdc16a14d07e0895cc09eeba689bc556481d2.tar.bz2
hercules-f2fbdc16a14d07e0895cc09eeba689bc556481d2.tar.xz
hercules-f2fbdc16a14d07e0895cc09eeba689bc556481d2.zip
Cleaned up some #includes
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/char/HPMchar.c27
-rw-r--r--src/char/char.c3
-rw-r--r--src/char/char.h1
-rw-r--r--src/char/geoip.h1
-rw-r--r--src/char/int_auction.c2
-rw-r--r--src/char/int_auction.h1
-rw-r--r--src/char/int_elemental.c1
-rw-r--r--src/char/int_guild.c1
-rw-r--r--src/char/int_guild.h1
-rw-r--r--src/char/int_homun.c1
-rw-r--r--src/char/int_mail.c1
-rw-r--r--src/char/int_mercenary.c2
-rw-r--r--src/char/int_party.c1
-rw-r--r--src/char/int_party.h1
-rw-r--r--src/char/int_pet.c1
-rw-r--r--src/char/int_quest.c4
-rw-r--r--src/char/int_storage.c1
-rw-r--r--src/char/inter.c1
-rw-r--r--src/char/inter.h5
-rw-r--r--src/char/loginif.c1
-rw-r--r--src/char/loginif.h4
-rw-r--r--src/char/mapif.h11
-rw-r--r--src/char/pincode.c1
-rw-r--r--src/char/pincode.h4
-rw-r--r--src/common/HPM.c1
-rw-r--r--src/common/cbasetypes.h1
-rw-r--r--src/common/conf.h2
-rw-r--r--src/common/core.c3
-rw-r--r--src/common/core.h2
-rw-r--r--src/common/grfio.c1
-rw-r--r--src/common/malloc.c2
-rw-r--r--src/common/mapindex.c3
-rw-r--r--src/common/mapindex.h1
-rw-r--r--src/common/md5calc.c5
-rw-r--r--src/common/mmo.h3
-rw-r--r--src/common/mutex.c1
-rw-r--r--src/common/random.c2
-rw-r--r--src/common/showmsg.c2
-rw-r--r--src/common/socket.c2
-rw-r--r--src/common/socket.h2
-rw-r--r--src/common/sql.c1
-rw-r--r--src/common/sysinfo.c1
-rw-r--r--src/common/timer.c1
-rw-r--r--src/common/utils.c4
-rw-r--r--src/common/utils.h1
-rw-r--r--src/login/HPMlogin.c12
-rw-r--r--src/login/account_sql.c3
-rw-r--r--src/login/ipban_sql.c4
-rw-r--r--src/login/login.c2
-rw-r--r--src/login/login.h2
-rw-r--r--src/login/loginlog_sql.c1
-rw-r--r--src/map/HPMmap.c8
-rw-r--r--src/map/atcommand.h3
-rw-r--r--src/map/battleground.c1
-rw-r--r--src/map/battleground.h9
-rw-r--r--src/map/channel.h4
-rw-r--r--src/map/chrif.c15
-rw-r--r--src/map/chrif.h6
-rw-r--r--src/map/clif.h28
-rw-r--r--src/map/elemental.h3
-rw-r--r--src/map/homunculus.h3
-rw-r--r--src/map/instance.c1
-rw-r--r--src/map/instance.h1
-rw-r--r--src/map/itemdb.h118
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/mapreg.h2
-rw-r--r--src/map/mercenary.h2
-rw-r--r--src/map/mob.h4
-rw-r--r--src/map/npc.c1
-rw-r--r--src/test/test_spinlock.c3
-rw-r--r--src/tool/mapcache.c3
71 files changed, 170 insertions, 188 deletions
diff --git a/src/char/HPMchar.c b/src/char/HPMchar.c
index a159b0351..05429fbb8 100644
--- a/src/char/HPMchar.c
+++ b/src/char/HPMchar.c
@@ -7,24 +7,35 @@
#include "common/HPM.h"
#include "common/cbasetypes.h"
+
+#if 0 // TODO (HPMDataCheck is disabled for the time being)
+#include "char/char.h"
+#include "char/geoip.h"
+#include "char/inter.h"
+#include "char/int_auction.h"
+#include "char/int_elemental.h"
+#include "char/int_guild.h"
+#include "char/int_homun.h"
+#include "char/int_mail.h"
+#include "char/int_mercenary.h"
+#include "char/int_party.h"
+#include "char/int_pet.h"
+#include "char/int_quest.h"
+#include "char/int_storage.h"
+#include "char/loginif.h"
+#include "char/mapif.h"
+#include "char/pincode.h"
#include "common/conf.h"
#include "common/db.h"
#include "common/des.h"
#include "common/ers.h"
-#include "common/malloc.h"
#include "common/mapindex.h"
#include "common/mmo.h"
-#include "common/showmsg.h"
#include "common/socket.h"
#include "common/strlib.h"
#include "common/sysinfo.h"
-
#include "common/HPMDataCheck.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
+#endif
bool HPM_char_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr) {
/* record address */
diff --git a/src/char/char.c b/src/char/char.c
index 3435728f3..5e3c34684 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -36,6 +36,7 @@
#include "common/showmsg.h"
#include "common/socket.h"
#include "common/strlib.h"
+#include "common/sql.h"
#include "common/timer.h"
#include "common/utils.h"
@@ -43,9 +44,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/types.h>
-#include <time.h>
#ifndef WIN32
# include <unistd.h>
#endif
diff --git a/src/char/char.h b/src/char/char.h
index be04dbe21..0f351ca8c 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -8,6 +8,7 @@
#include "common/cbasetypes.h"
#include "common/core.h" // CORE_ST_LAST
#include "common/db.h"
+#include "common/mmo.h"
enum E_CHARSERVER_ST {
CHARSERVER_ST_RUNNING = CORE_ST_LAST,
diff --git a/src/char/geoip.h b/src/char/geoip.h
index cb980fdb7..4d39011aa 100644
--- a/src/char/geoip.h
+++ b/src/char/geoip.h
@@ -15,6 +15,7 @@ struct s_geoip {
bool active;
};
+
/**
* geoip interface
**/
diff --git a/src/char/int_auction.c b/src/char/int_auction.c
index 6b2a9fe73..8d51777fb 100644
--- a/src/char/int_auction.c
+++ b/src/char/int_auction.c
@@ -10,6 +10,7 @@
#include "char/int_mail.h"
#include "char/inter.h"
#include "char/mapif.h"
+#include "common/cbasetypes.h"
#include "common/db.h"
#include "common/malloc.h"
#include "common/mmo.h"
@@ -22,7 +23,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
struct inter_auction_interface inter_auction_s;
diff --git a/src/char/int_auction.h b/src/char/int_auction.h
index 80e5fbc8a..610042b9a 100644
--- a/src/char/int_auction.h
+++ b/src/char/int_auction.h
@@ -4,6 +4,7 @@
#ifndef CHAR_INT_AUCTION_H
#define CHAR_INT_AUCTION_H
+#include "common/db.h"
#include "common/mmo.h"
#ifdef HERCULES_CORE
diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c
index e894c866d..eff84c57d 100644
--- a/src/char/int_elemental.c
+++ b/src/char/int_elemental.c
@@ -20,7 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
struct inter_elemental_interface inter_elemental_s;
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index b61b276f1..96a78203f 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -22,7 +22,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#define GS_MEMBER_UNMODIFIED 0x00
#define GS_MEMBER_MODIFIED 0x01
diff --git a/src/char/int_guild.h b/src/char/int_guild.h
index fe7d28ca4..eb4c930fc 100644
--- a/src/char/int_guild.h
+++ b/src/char/int_guild.h
@@ -4,6 +4,7 @@
#ifndef CHAR_INT_GUILD_H
#define CHAR_INT_GUILD_H
+#include "common/db.h"
#include "common/mmo.h"
enum {
diff --git a/src/char/int_homun.c b/src/char/int_homun.c
index aab585d4c..2ec589eaf 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -20,7 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
struct inter_homunculus_interface inter_homunculus_s;
diff --git a/src/char/int_mail.c b/src/char/int_mail.c
index c7740d20a..0d46339e0 100644
--- a/src/char/int_mail.c
+++ b/src/char/int_mail.c
@@ -20,7 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
struct inter_mail_interface inter_mail_s;
diff --git a/src/char/int_mercenary.c b/src/char/int_mercenary.c
index 6516c7325..02082aa13 100644
--- a/src/char/int_mercenary.c
+++ b/src/char/int_mercenary.c
@@ -9,6 +9,7 @@
#include "char/char.h"
#include "char/inter.h"
#include "char/mapif.h"
+#include "common/cbasetypes.h"
#include "common/malloc.h"
#include "common/mmo.h"
#include "common/nullpo.h"
@@ -20,7 +21,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
struct inter_mercenary_interface inter_mercenary_s;
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 899ac86ef..71f2817b4 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -22,7 +22,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
struct inter_party_interface inter_party_s;
diff --git a/src/char/int_party.h b/src/char/int_party.h
index df2289982..99ee5b13e 100644
--- a/src/char/int_party.h
+++ b/src/char/int_party.h
@@ -4,6 +4,7 @@
#ifndef CHAR_INT_PARTY_H
#define CHAR_INT_PARTY_H
+#include "common/db.h"
#include "common/mmo.h"
//Party Flags on what to save/delete.
diff --git a/src/char/int_pet.c b/src/char/int_pet.c
index 169bae407..22fe2dcc2 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.c
@@ -20,7 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
struct inter_pet_interface inter_pet_s;
diff --git a/src/char/int_quest.c b/src/char/int_quest.c
index 05655725a..cf9b9c172 100644
--- a/src/char/int_quest.c
+++ b/src/char/int_quest.c
@@ -9,7 +9,7 @@
#include "char/char.h"
#include "char/inter.h"
#include "char/mapif.h"
-#include "common/db.h"
+#include "common/cbasetypes.h"
#include "common/malloc.h"
#include "common/mmo.h"
#include "common/nullpo.h"
@@ -17,11 +17,9 @@
#include "common/socket.h"
#include "common/sql.h"
#include "common/strlib.h"
-#include "common/timer.h"
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
struct inter_quest_interface inter_quest_s;
diff --git a/src/char/int_storage.c b/src/char/int_storage.c
index cbe7cb5d1..a12d9fe17 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -20,7 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#define STORAGE_MEMINC 16
diff --git a/src/char/inter.c b/src/char/inter.c
index 9707ea710..ca041d581 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -31,7 +31,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#define WISDATA_TTL (60*1000) // Wis data Time To Live (60 seconds)
#define WISDELLIST_MAX 256 // Number of elements in the list Delete data Wis
diff --git a/src/char/inter.h b/src/char/inter.h
index 2bf8d0847..2e89a685b 100644
--- a/src/char/inter.h
+++ b/src/char/inter.h
@@ -5,11 +5,12 @@
#ifndef CHAR_INTER_H
#define CHAR_INTER_H
-#include "char.h"
-
#include "common/cbasetypes.h"
+#include "common/db.h"
#include "common/sql.h"
+#include <stdarg.h>
+
struct accreg;
#ifdef HERCULES_CORE
diff --git a/src/char/loginif.c b/src/char/loginif.c
index e90c471e2..881c8f2ac 100644
--- a/src/char/loginif.c
+++ b/src/char/loginif.c
@@ -10,6 +10,7 @@
#include "char/mapif.h"
#include "common/cbasetypes.h"
#include "common/core.h"
+#include "common/db.h"
#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/socket.h"
diff --git a/src/char/loginif.h b/src/char/loginif.h
index 66ca046eb..548eaff02 100644
--- a/src/char/loginif.h
+++ b/src/char/loginif.h
@@ -5,7 +5,9 @@
#ifndef CHAR_LOGINIF_H
#define CHAR_LOGINIF_H
-#include "char/char.h"
+#include "common/cbasetypes.h"
+
+struct char_session_data;
/**
* loginif interface
diff --git a/src/char/mapif.h b/src/char/mapif.h
index 8a95c8233..6b015d155 100644
--- a/src/char/mapif.h
+++ b/src/char/mapif.h
@@ -5,16 +5,9 @@
#ifndef CHAR_MAPIF_H
#define CHAR_MAPIF_H
-#include "char/char.h"
+#include "common/cbasetypes.h"
+#include "common/mmo.h"
-struct s_elemental;
-struct s_homunculus;
-struct s_mercenary;
-struct s_pet;
-struct guild_storage;
-struct storage_data;
-struct quest;
-struct mail_message;
struct WisData;
/**
diff --git a/src/char/pincode.c b/src/char/pincode.c
index 885a3d1a1..43958af8a 100644
--- a/src/char/pincode.c
+++ b/src/char/pincode.c
@@ -8,6 +8,7 @@
#include "char/char.h"
#include "common/cbasetypes.h"
+#include "common/db.h"
#include "common/mmo.h"
#include "common/nullpo.h"
#include "common/random.h"
diff --git a/src/char/pincode.h b/src/char/pincode.h
index 678448964..01f6c7bf9 100644
--- a/src/char/pincode.h
+++ b/src/char/pincode.h
@@ -5,7 +5,9 @@
#ifndef CHAR_PINCODE_H
#define CHAR_PINCODE_H
-#include "char/char.h"
+#include "common/cbasetypes.h"
+
+struct char_session_data;
enum PincodeResponseCode {
PINCODE_OK = 0,
diff --git a/src/common/HPM.c b/src/common/HPM.c
index 2b508e233..5a0fe16dc 100644
--- a/src/common/HPM.c
+++ b/src/common/HPM.c
@@ -10,6 +10,7 @@
#include "common/conf.h"
#include "common/console.h"
#include "common/core.h"
+#include "common/db.h"
#include "common/malloc.h"
#include "common/mmo.h"
#include "common/showmsg.h"
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index a0fa77fb5..ce8fc6bcf 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -97,6 +97,7 @@
#include <inttypes.h>
#include <stdint.h>
#include <limits.h>
+#include <time.h>
// temporary fix for bugreport:4961 (unintended conversion from signed to unsigned)
// (-20 >= UCHAR_MAX) returns true
diff --git a/src/common/conf.h b/src/common/conf.h
index 771725cf4..1889aeb3a 100644
--- a/src/common/conf.h
+++ b/src/common/conf.h
@@ -7,7 +7,7 @@
#include "common/cbasetypes.h"
-#include "libconfig/libconfig.h"
+#include <libconfig/libconfig.h>
/**
* The libconfig interface -- specially for plugins, but we enforce it throughout the core to be consistent
diff --git a/src/common/core.c b/src/common/core.c
index 5a410add1..e663c4e4c 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -9,6 +9,7 @@
#include "common/cbasetypes.h"
#include "common/console.h"
+#include "common/db.h"
#include "common/malloc.h"
#include "common/mmo.h"
#include "common/random.h"
@@ -20,7 +21,6 @@
#ifndef MINICORE
# include "common/HPM.h"
# include "common/conf.h"
-# include "common/db.h"
# include "common/ers.h"
# include "common/socket.h"
# include "common/sql.h"
@@ -37,7 +37,6 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
/// Called when a terminate signal is received.
void (*shutdown_callback)(void) = NULL;
diff --git a/src/common/core.h b/src/common/core.h
index d96e8506a..c2a8d9e58 100644
--- a/src/common/core.h
+++ b/src/common/core.h
@@ -6,8 +6,6 @@
#define COMMON_CORE_H
#include "common/cbasetypes.h"
-#include "common/db.h"
-#include "common/mmo.h"
/* so that developers with --enable-debug can raise signals from any section of the code they'd like */
#ifdef DEBUG
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 00d6ffc89..614678da8 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -16,7 +16,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/stat.h>
#include <zlib.h>
diff --git a/src/common/malloc.c b/src/common/malloc.c
index 008fd0930..ec0467495 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -6,6 +6,7 @@
#include "malloc.h"
+#include "common/cbasetypes.h"
#include "common/core.h"
#include "common/showmsg.h"
#include "common/sysinfo.h"
@@ -13,7 +14,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
struct malloc_interface iMalloc_s;
diff --git a/src/common/mapindex.c b/src/common/mapindex.c
index 42b46246d..18aa413cc 100644
--- a/src/common/mapindex.c
+++ b/src/common/mapindex.c
@@ -6,15 +6,14 @@
#include "mapindex.h"
+#include "common/cbasetypes.h"
#include "common/db.h"
-#include "common/malloc.h"
#include "common/mmo.h"
#include "common/showmsg.h"
#include "common/strlib.h"
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
/* mapindex.c interface source */
struct mapindex_interface mapindex_s;
diff --git a/src/common/mapindex.h b/src/common/mapindex.h
index 408078ceb..c334e7cca 100644
--- a/src/common/mapindex.h
+++ b/src/common/mapindex.h
@@ -5,6 +5,7 @@
#ifndef COMMON_MAPINDEX_H
#define COMMON_MAPINDEX_H
+#include "common/cbasetypes.h"
#include "common/db.h"
#include "common/mmo.h"
diff --git a/src/common/md5calc.c b/src/common/md5calc.c
index e27b64504..e594c364f 100644
--- a/src/common/md5calc.c
+++ b/src/common/md5calc.c
@@ -10,16 +10,13 @@
#include "md5calc.h"
+#include "common/cbasetypes.h"
#include "common/random.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifndef UINT_MAX
-#define UINT_MAX 4294967295U
-#endif
-
// Global variable
static unsigned int *pX;
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 94a4b06da..3e497c667 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -7,9 +7,6 @@
#include "config/core.h"
#include "common/cbasetypes.h"
-#include "common/db.h"
-
-#include <time.h>
// server->client protocol version
// 0 - pre-?
diff --git a/src/common/mutex.c b/src/common/mutex.c
index 59c04d4f0..5dfb3d01c 100644
--- a/src/common/mutex.c
+++ b/src/common/mutex.c
@@ -14,7 +14,6 @@
#include "common/winapi.h"
#else
#include <pthread.h>
-#include <time.h>
#include <sys/time.h>
#endif
diff --git a/src/common/random.c b/src/common/random.c
index 70257fcb6..a4d7c5d34 100644
--- a/src/common/random.c
+++ b/src/common/random.c
@@ -5,8 +5,6 @@
#include "random.h"
-#include <time.h> // time
-
#include "common/cbasetypes.h" // for WIN32
#include "common/showmsg.h"
#include "common/timer.h" // gettick
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index 3eb7ba0af..01dc0b01a 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -15,8 +15,6 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h> // atexit
-#include <string.h>
-#include <time.h>
#ifdef WIN32
# include "common/winapi.h"
diff --git a/src/common/socket.c b/src/common/socket.c
index aa575f1a6..17c31db50 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -11,6 +11,7 @@
#include "common/HPM.h"
#include "common/cbasetypes.h"
+#include "common/db.h"
#include "common/malloc.h"
#include "common/mmo.h"
#include "common/showmsg.h"
@@ -19,7 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/types.h>
#ifdef WIN32
diff --git a/src/common/socket.h b/src/common/socket.h
index 94f86759b..bd5d9baa2 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -7,8 +7,6 @@
#include "common/cbasetypes.h"
-#include <time.h>
-
#ifdef WIN32
# include "common/winapi.h"
typedef long in_addr_t;
diff --git a/src/common/sql.c b/src/common/sql.c
index 9dc8144bf..a93092533 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -17,7 +17,6 @@
#endif
#include <mysql.h>
#include <stdlib.h> // strtoul
-#include <string.h> // strlen/strnlen/memcpy/memset
void hercules_mysql_error_handler(unsigned int ecode);
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index 33ffc43f3..a27357e7e 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -16,7 +16,6 @@
#include <stdio.h> // fopen
#include <stdlib.h> // atoi
#ifdef WIN32
-# include <string.h> // strlen
# include <windows.h>
#else
# include <unistd.h>
diff --git a/src/common/timer.c b/src/common/timer.c
index 42eb892ad..06309642e 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -22,7 +22,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
struct timer_interface timer_s;
diff --git a/src/common/utils.c b/src/common/utils.c
index 865b3575b..07e2e9fdf 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -8,7 +8,6 @@
#include "common/cbasetypes.h"
#include "common/core.h"
-#include "common/malloc.h"
#include "common/mmo.h"
#include "common/showmsg.h"
#include "common/socket.h"
@@ -21,15 +20,12 @@
# endif /* F_OK */
#else
# include <dirent.h>
-# include <sys/stat.h>
# include <unistd.h>
#endif
#include <math.h> // floor()
-#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/stat.h> // cache purposes [Ind/Hercules]
struct HCache_interface HCache_s;
diff --git a/src/common/utils.h b/src/common/utils.h
index 57113aea0..0ac818468 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -8,7 +8,6 @@
#include "common/cbasetypes.h"
#include <stdio.h> // FILE*
-#include <time.h>
/* [HCache] 1-byte key to ensure our method is the latest, we can modify to ensure the method matches */
#define HCACHE_KEY 'k'
diff --git a/src/login/HPMlogin.c b/src/login/HPMlogin.c
index c9e0e094c..0a7729da8 100644
--- a/src/login/HPMlogin.c
+++ b/src/login/HPMlogin.c
@@ -7,24 +7,20 @@
#include "common/HPM.h"
#include "common/cbasetypes.h"
+
+#if 0 // TODO (HPMDataCheck is disabled for the time being)
#include "common/conf.h"
#include "common/db.h"
#include "common/des.h"
#include "common/ers.h"
-#include "common/malloc.h"
#include "common/mapindex.h"
#include "common/mmo.h"
-#include "common/showmsg.h"
#include "common/socket.h"
#include "common/strlib.h"
#include "common/sysinfo.h"
-
+#include "login/login.h"
#include "common/HPMDataCheck.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
+#endif
bool HPM_login_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr) {
/* record address */
diff --git a/src/login/account_sql.c b/src/login/account_sql.c
index 8696666e3..3f72e6867 100644
--- a/src/login/account_sql.c
+++ b/src/login/account_sql.c
@@ -7,6 +7,7 @@
#include "config/core.h" // CONSOLE_INPUT
#include "account.h"
+#include "common/cbasetypes.h"
#include "common/console.h"
#include "common/malloc.h"
#include "common/mmo.h"
@@ -15,10 +16,8 @@
#include "common/socket.h"
#include "common/sql.h"
#include "common/strlib.h"
-#include "common/timer.h"
#include <stdlib.h>
-#include <string.h>
/// global defines
#define ACCOUNT_SQL_DB_VERSION 20110114
diff --git a/src/login/ipban_sql.c b/src/login/ipban_sql.c
index 533ee3c4c..b4fce009d 100644
--- a/src/login/ipban_sql.c
+++ b/src/login/ipban_sql.c
@@ -9,16 +9,12 @@
#include "login/login.h"
#include "login/loginlog.h"
#include "common/cbasetypes.h"
-#include "common/db.h"
-#include "common/malloc.h"
#include "common/nullpo.h"
#include "common/sql.h"
-#include "common/socket.h"
#include "common/strlib.h"
#include "common/timer.h"
#include <stdlib.h>
-#include <string.h>
// global sql settings
static char global_db_hostname[32] = "127.0.0.1";
diff --git a/src/login/login.c b/src/login/login.c
index 9175bed56..1fdf2d198 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -11,6 +11,7 @@
#include "login/ipban.h"
#include "login/loginlog.h"
#include "common/HPM.h"
+#include "common/cbasetypes.h"
#include "common/core.h"
#include "common/db.h"
#include "common/malloc.h"
@@ -25,7 +26,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
struct login_interface login_s;
struct Login_Config login_config;
diff --git a/src/login/login.h b/src/login/login.h
index 5343b31a0..f05ff6d0f 100644
--- a/src/login/login.h
+++ b/src/login/login.h
@@ -5,7 +5,9 @@
#ifndef LOGIN_LOGIN_H
#define LOGIN_LOGIN_H
+#include "common/cbasetypes.h"
#include "common/core.h" // CORE_ST_LAST
+#include "common/db.h"
#include "common/mmo.h" // NAME_LENGTH,SEX_*
struct mmo_account;
diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c
index da9beda4f..da698e187 100644
--- a/src/login/loginlog_sql.c
+++ b/src/login/loginlog_sql.c
@@ -13,7 +13,6 @@
#include "common/sql.h"
#include "common/strlib.h"
-#include <string.h>
#include <stdlib.h> // exit
// global sql settings (in ipban_sql.c)
diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c
index 4b8c735fc..8e3048210 100644
--- a/src/map/HPMmap.c
+++ b/src/map/HPMmap.c
@@ -5,11 +5,6 @@
#include "HPMmap.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
#include "map/atcommand.h"
#include "map/battle.h"
#include "map/battleground.h"
@@ -63,6 +58,9 @@
#include "common/HPMDataCheck.h"
+#include <stdio.h>
+#include <stdlib.h>
+
struct HPM_atcommand_list {
//tracking currently not enabled
// - requires modifying how plugins calls atcommand creation
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index c9c70badb..88ddde8c2 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -6,9 +6,12 @@
#define MAP_ATCOMMAND_H
#include "map/pc_groups.h"
+#include "common/cbasetypes.h"
#include "common/conf.h"
#include "common/db.h"
+#include <stdarg.h>
+
/**
* Declarations
**/
diff --git a/src/map/battleground.c b/src/map/battleground.c
index 44f3664a4..0fe42110f 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -8,6 +8,7 @@
#include "map/battle.h"
#include "map/clif.h"
+#include "map/guild.h"
#include "map/homunculus.h"
#include "map/map.h"
#include "map/mapreg.h"
diff --git a/src/map/battleground.h b/src/map/battleground.h
index aaa76b5d2..a67deb722 100644
--- a/src/map/battleground.h
+++ b/src/map/battleground.h
@@ -5,10 +5,15 @@
#ifndef MAP_BATTLEGROUND_H
#define MAP_BATTLEGROUND_H
-#include "map/clif.h"
-#include "map/guild.h"
+#include "map/map.h" // EVENT_NAME_LENGTH
+#include "common/cbasetypes.h"
+#include "common/db.h"
#include "common/mmo.h" // struct party
+struct HPluginData;
+struct block_list;
+struct map_session_data;
+
/**
* Defines
**/
diff --git a/src/map/channel.h b/src/map/channel.h
index dbf9ba94f..de1779d96 100644
--- a/src/map/channel.h
+++ b/src/map/channel.h
@@ -4,11 +4,9 @@
#ifndef MAP_CHANNEL_H
#define MAP_CHANNEL_H
-#include "map/map.h"
#include "common/cbasetypes.h"
#include "common/db.h"
-
-#include <stdarg.h>
+#include "common/mmo.h"
/**
* Declarations
diff --git a/src/map/chrif.c b/src/map/chrif.c
index cc1f5db4b..41485d222 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -7,20 +7,21 @@
#include "config/core.h" // AUTOTRADE_PERSISTENCY, STATS_OPT_OUT
#include "chrif.h"
-#include "map/map.h"
#include "map/battle.h"
#include "map/clif.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/instance.h"
#include "map/intif.h"
+#include "map/map.h"
+#include "map/mercenary.h"
#include "map/npc.h"
#include "map/pc.h"
#include "map/pet.h"
+#include "map/quest.h"
#include "map/skill.h"
#include "map/status.h"
-#include "map/homunculus.h"
-#include "map/instance.h"
-#include "map/mercenary.h"
-#include "map/elemental.h"
-#include "map/quest.h"
#include "map/storage.h"
#include "common/HPM.h"
#include "common/cbasetypes.h"
@@ -34,9 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/types.h>
-#include <time.h>
struct chrif_interface chrif_s;
diff --git a/src/map/chrif.h b/src/map/chrif.h
index 022e4d957..cac965f74 100644
--- a/src/map/chrif.h
+++ b/src/map/chrif.h
@@ -5,12 +5,12 @@
#ifndef MAP_CHRIF_H
#define MAP_CHRIF_H
-#include "map/map.h" //TBL_stuff
+#include "map/map.h" //TBL_PC
#include "common/cbasetypes.h"
#include "common/db.h"
-#include <time.h>
-
+struct eri;
+struct map_session_data;
struct status_change_entry;
/**
diff --git a/src/map/clif.h b/src/map/clif.h
index 2ba881a31..66dd13304 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -8,7 +8,6 @@
#include "map/map.h"
#include "map/packets_struct.h"
#include "common/cbasetypes.h"
-#include "common/db.h"
#include "common/mmo.h"
#include <stdarg.h>
@@ -16,29 +15,28 @@
/**
* Declarations
**/
+struct battleground_data;
+struct channel_data;
+struct chat_data;
+struct eri;
+struct flooritem_data;
+struct guild;
+struct homun_data;
struct item;
struct item_data;
-struct unit_data;
struct map_session_data;
-struct homun_data;
struct mercenary_data;
-struct pet_data;
struct mob_data;
struct npc_data;
-struct chat_data;
-struct flooritem_data;
-struct skill_unit;
-struct s_vending;
-struct party;
+struct party_booking_ad_info;
struct party_data;
-struct guild;
-struct battleground_data;
+struct pet_data;
struct quest;
-struct party_booking_ad_info;
-struct view_data;
-struct eri;
+struct s_vending;
struct skill_cd;
-struct channel_data;
+struct skill_unit;
+struct unit_data;
+struct view_data;
/**
* Defines
diff --git a/src/map/elemental.h b/src/map/elemental.h
index 67b1e3f3a..582e1059c 100644
--- a/src/map/elemental.h
+++ b/src/map/elemental.h
@@ -7,8 +7,11 @@
#include "map/status.h" // struct status_data, struct status_change
#include "map/unit.h" // struct unit_data
+#include "common/cbasetypes.h"
#include "common/mmo.h" // NAME_LENGTH
+#include <stdarg.h>
+
/**
* Defines
**/
diff --git a/src/map/homunculus.h b/src/map/homunculus.h
index 387efbf29..32e48b1e9 100644
--- a/src/map/homunculus.h
+++ b/src/map/homunculus.h
@@ -5,11 +5,12 @@
#ifndef MAP_HOMUNCULUS_H
#define MAP_HOMUNCULUS_H
-#include "map/pc.h"
#include "map/status.h" // struct status_data, struct status_change
#include "map/unit.h" // struct unit_data
#include "common/mmo.h"
+struct map_session_data;
+
#define MAX_HOM_SKILL_REQUIRE 5
#define homdb_checkid(id) ((id) >= HM_CLASS_BASE && (id) <= HM_CLASS_MAX)
#define homun_alive(x) ((x) && (x)->homunculus.vaporize == HOM_ST_ACTIVE && (x)->battle_status.hp > 0)
diff --git a/src/map/instance.c b/src/map/instance.c
index 255722f58..f5688d02c 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -9,6 +9,7 @@
#include "map/channel.h"
#include "map/clif.h"
+#include "map/guild.h"
#include "map/map.h"
#include "map/npc.h"
#include "map/party.h"
diff --git a/src/map/instance.h b/src/map/instance.h
index 88e586ab1..e17d6866f 100644
--- a/src/map/instance.h
+++ b/src/map/instance.h
@@ -9,6 +9,7 @@
#include "common/cbasetypes.h"
#include "common/mmo.h" // struct point
+struct HPluginData;
struct block_list;
struct map_session_data;
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 8d220d58f..624080c3a 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -5,18 +5,14 @@
#ifndef MAP_ITEMDB_H
#define MAP_ITEMDB_H
-#include "map/map.h"
+/* #include "map/map.h" */
#include "common/cbasetypes.h"
#include "common/conf.h"
#include "common/db.h"
#include "common/mmo.h" // ITEM_NAME_LENGTH
#include "common/sql.h"
-/**
- * Declarations
- **/
-struct item_group;
-struct item_package;
+struct script_code;
/**
* Defines
@@ -371,6 +367,61 @@ enum ItemNouseRestrictions {
INR_ALL = 0x1 ///< Sum of all the above values
};
+struct item_combo {
+ struct script_code *script;
+ unsigned short nameid[MAX_ITEMS_PER_COMBO];/* nameid array */
+ unsigned char count;
+ unsigned short id;/* id of this combo */
+};
+
+struct item_group {
+ unsigned short id;
+ unsigned short *nameid;
+ unsigned short qty;
+};
+
+struct item_chain_entry {
+ unsigned short id;
+ unsigned short rate;
+ struct item_chain_entry *next;
+};
+
+struct item_chain {
+ struct item_chain_entry *items;
+ unsigned short qty;
+};
+
+struct item_package_rand_entry {
+ unsigned short id;
+ unsigned short qty;
+ unsigned short rate;
+ unsigned short hours;
+ unsigned int announce : 1;
+ unsigned int named : 1;
+ struct item_package_rand_entry *next;
+};
+
+struct item_package_must_entry {
+ unsigned short id;
+ unsigned short qty;
+ unsigned short hours;
+ unsigned int announce : 1;
+ unsigned int named : 1;
+};
+
+struct item_package_rand_group {
+ struct item_package_rand_entry *random_list;
+ unsigned short random_qty;
+};
+
+struct item_package {
+ unsigned short id;
+ struct item_package_rand_group *random_groups;
+ struct item_package_must_entry *must_items;
+ unsigned short random_qty;
+ unsigned short must_qty;
+};
+
struct item_data {
uint16 nameid;
char name[ITEM_NAME_LENGTH],jname[ITEM_NAME_LENGTH];
@@ -440,61 +491,6 @@ struct item_data {
unsigned int hdatac;
};
-struct item_combo {
- struct script_code *script;
- unsigned short nameid[MAX_ITEMS_PER_COMBO];/* nameid array */
- unsigned char count;
- unsigned short id;/* id of this combo */
-};
-
-struct item_group {
- unsigned short id;
- unsigned short *nameid;
- unsigned short qty;
-};
-
-struct item_chain_entry {
- unsigned short id;
- unsigned short rate;
- struct item_chain_entry *next;
-};
-
-struct item_chain {
- struct item_chain_entry *items;
- unsigned short qty;
-};
-
-struct item_package_rand_entry {
- unsigned short id;
- unsigned short qty;
- unsigned short rate;
- unsigned short hours;
- unsigned int announce : 1;
- unsigned int named : 1;
- struct item_package_rand_entry *next;
-};
-
-struct item_package_must_entry {
- unsigned short id;
- unsigned short qty;
- unsigned short hours;
- unsigned int announce : 1;
- unsigned int named : 1;
-};
-
-struct item_package_rand_group {
- struct item_package_rand_entry *random_list;
- unsigned short random_qty;
-};
-
-struct item_package {
- unsigned short id;
- struct item_package_rand_group *random_groups;
- struct item_package_must_entry *must_items;
- unsigned short random_qty;
- unsigned short must_qty;
-};
-
#define itemdb_name(n) (itemdb->search(n)->name)
#define itemdb_jname(n) (itemdb->search(n)->jname)
#define itemdb_type(n) (itemdb->search(n)->type)
diff --git a/src/map/map.h b/src/map/map.h
index 81a9a0940..8d879cd56 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -15,6 +15,7 @@
#include "common/mmo.h"
#include "common/sql.h"
+#include <stdio.h>
#include <stdarg.h>
struct mob_data;
diff --git a/src/map/mapreg.h b/src/map/mapreg.h
index d38edaff5..cafd25b64 100644
--- a/src/map/mapreg.h
+++ b/src/map/mapreg.h
@@ -9,6 +9,8 @@
#include "common/cbasetypes.h"
#include "common/db.h"
+struct eri;
+
/** Container for a mapreg value */
struct mapreg_save {
int64 uid; ///< Unique ID
diff --git a/src/map/mercenary.h b/src/map/mercenary.h
index 873d77659..29a2c6ba0 100644
--- a/src/map/mercenary.h
+++ b/src/map/mercenary.h
@@ -8,6 +8,8 @@
#include "map/unit.h" // struct unit_data
#include "common/cbasetypes.h"
+struct map_session_data;
+
// number of cells that a mercenary can walk to from it's master before being warped
#define MAX_MER_DISTANCE 15
diff --git a/src/map/mob.h b/src/map/mob.h
index d3fdb7185..85d2bf9b8 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -5,9 +5,9 @@
#ifndef MAP_MOB_H
#define MAP_MOB_H
-#include "map/map.h" // struct status_data, struct view_data, struct mob_skill
+#include "map/map.h" // struct block_list
#include "map/status.h" // struct status_data, struct status_change
-#include "map/unit.h" // struct unit_data
+#include "map/unit.h" // struct unit_data, view_data
#include "common/cbasetypes.h"
#include "common/mmo.h" // struct item
diff --git a/src/map/npc.c b/src/map/npc.c
index 7bc5be383..8114cacaa 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -10,6 +10,7 @@
#include "map/battle.h"
#include "map/chat.h"
#include "map/clif.h"
+#include "map/guild.h"
#include "map/instance.h"
#include "map/intif.h"
#include "map/itemdb.h"
diff --git a/src/test/test_spinlock.c b/src/test/test_spinlock.c
index ace894e9b..4f235907d 100644
--- a/src/test/test_spinlock.c
+++ b/src/test/test_spinlock.c
@@ -1,7 +1,8 @@
#define HERCULES_CORE
-#include "common/core.h"
#include "common/atomic.h"
+#include "common/cbasetypes.h"
+#include "common/core.h"
#include "common/thread.h"
#include "common/spinlock.h"
#include "common/showmsg.h"
diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c
index 6aa9bf273..356cdd352 100644
--- a/src/tool/mapcache.c
+++ b/src/tool/mapcache.c
@@ -3,8 +3,6 @@
#define HERCULES_CORE
-#include "config/core.h" // RENEWAL
-
#include "common/cbasetypes.h"
#include "common/core.h"
#include "common/grfio.h"
@@ -16,7 +14,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#ifndef _WIN32
#include <unistd.h>
#endif