summaryrefslogtreecommitdiff
path: root/src/map/guild.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-04 17:08:44 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-04 17:08:44 +0300
commit3732bd4a6b708651f6b4bcd32d6beb2b7f49c478 (patch)
tree83155915c35c72d018108231437248cc78d5060d /src/map/guild.c
parent0bd30a0fac1db1b478b3173a22a81bd5249113f8 (diff)
parent9147fe9473b26ee32aafed65fd02b03f11397629 (diff)
downloadhercules-3732bd4a6b708651f6b4bcd32d6beb2b7f49c478.tar.gz
hercules-3732bd4a6b708651f6b4bcd32d6beb2b7f49c478.tar.bz2
hercules-3732bd4a6b708651f6b4bcd32d6beb2b7f49c478.tar.xz
hercules-3732bd4a6b708651f6b4bcd32d6beb2b7f49c478.zip
Merge pull request #1210 from HerculesWS/wcast_qual
Added -Wcast-qual compiler flag
Diffstat (limited to 'src/map/guild.c')
-rw-r--r--src/map/guild.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index 13acfc0db..39d580bb7 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -178,7 +178,7 @@ struct guild* guild_search(int guild_id)
struct guild* guild_searchname(char* str)
{
struct guild* g;
- DBIterator *iter = db_iterator(guild->db);
+ struct DBIterator *iter = db_iterator(guild->db);
nullpo_retr(NULL, str);
for( g = dbi_first(iter); dbi_exists(iter); g = dbi_next(iter) )
@@ -201,7 +201,7 @@ struct guild_castle* guild_castle_search(int gcid)
struct guild_castle* guild_mapindex2gc(short map_index)
{
struct guild_castle* gc;
- DBIterator *iter = db_iterator(guild->castle_db);
+ struct DBIterator *iter = db_iterator(guild->castle_db);
for( gc = dbi_first(iter); dbi_exists(iter); gc = dbi_next(iter) )
{
@@ -282,7 +282,8 @@ void guild_makemember(struct guild_member *m,struct map_session_data *sd)
* Server cache to be flushed to inter the Guild EXP
* @see DBApply
*/
-int guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap) {
+int guild_payexp_timer_sub(union DBKey key, struct DBData *data, va_list ap)
+{
int i;
struct guild_expcache *c;
struct guild *g;
@@ -318,7 +319,7 @@ int guild_payexp_timer(int tid, int64 tick, int id, intptr_t data) {
* Taken from party_send_xy_timer_sub. [Skotlex]
* @see DBApply
*/
-int guild_send_xy_timer_sub(DBKey key, DBData *data, va_list ap)
+int guild_send_xy_timer_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct guild *g = DB->data2ptr(data);
int i;
@@ -423,7 +424,7 @@ int guild_npc_request_info(int guild_id,const char *event)
if( event && *event )
{
struct eventlist *ev;
- DBData prev;
+ struct DBData prev;
ev=(struct eventlist *)aCalloc(sizeof(struct eventlist),1);
memcpy(ev->name,event,strlen(event));
//The one in the db (if present) becomes the next event from this.
@@ -481,7 +482,7 @@ int guild_recv_info(const struct guild *sg)
{
struct guild *g,before;
int i,bm,m;
- DBData data;
+ struct DBData data;
struct map_session_data *sd;
bool guild_new = false;
struct channel_data *aChSysSave = NULL;
@@ -1224,7 +1225,7 @@ int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
}
}
{// update guardians (mobs)
- DBIterator* iter = db_iterator(guild->castle_db);
+ struct DBIterator *iter = db_iterator(guild->castle_db);
struct guild_castle* gc;
for( gc = (struct guild_castle*)dbi_first(iter) ; dbi_exists(iter); gc = (struct guild_castle*)dbi_next(iter) )
{
@@ -1262,7 +1263,7 @@ int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
/**
* @see DBCreateData
*/
-DBData create_expcache(DBKey key, va_list args)
+struct DBData create_expcache(union DBKey key, va_list args)
{
struct guild_expcache *c;
struct map_session_data *sd = va_arg(args, struct map_session_data*);
@@ -1720,7 +1721,7 @@ int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id
* Notification for the guild disbanded
* @see DBApply
*/
-int guild_broken_sub(DBKey key, DBData *data, va_list ap)
+int guild_broken_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct guild *g = DB->data2ptr(data);
int guild_id=va_arg(ap,int);
@@ -1746,7 +1747,7 @@ int guild_broken_sub(DBKey key, DBData *data, va_list ap)
* Invoked on Castles when a guild is broken. [Skotlex]
* @see DBApply
*/
-int castle_guild_broken_sub(DBKey key, DBData *data, va_list ap)
+int castle_guild_broken_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct guild_castle *gc = DB->data2ptr(data);
int guild_id = va_arg(ap, int);
@@ -1955,7 +1956,7 @@ void guild_castle_map_init(void)
if (num > 0) {
struct guild_castle* gc = NULL;
int *castle_ids, *cursor;
- DBIterator* iter = NULL;
+ struct DBIterator *iter = NULL;
CREATE(castle_ids, int, num);
cursor = castle_ids;
@@ -2153,7 +2154,7 @@ int guild_checkcastles(struct guild *g)
{
int nb_cas = 0;
struct guild_castle* gc = NULL;
- DBIterator *iter = db_iterator(guild->castle_db);
+ struct DBIterator *iter = db_iterator(guild->castle_db);
for (gc = dbi_first(iter); dbi_exists(iter); gc = dbi_next(iter)) {
if (gc->guild_id == g->guild_id) {
@@ -2222,7 +2223,8 @@ void guild_flag_remove(struct npc_data *nd) {
/**
* @see DBApply
*/
-int eventlist_db_final(DBKey key, DBData *data, va_list ap) {
+int eventlist_db_final(union DBKey key, struct DBData *data, va_list ap)
+{
struct eventlist *next = NULL;
struct eventlist *current = DB->data2ptr(data);
while (current != NULL) {
@@ -2236,7 +2238,8 @@ int eventlist_db_final(DBKey key, DBData *data, va_list ap) {
/**
* @see DBApply
*/
-int guild_expcache_db_final(DBKey key, DBData *data, va_list ap) {
+int guild_expcache_db_final(union DBKey key, struct DBData *data, va_list ap)
+{
ers_free(guild->expcache_ers, DB->data2ptr(data));
return 0;
}
@@ -2244,7 +2247,8 @@ int guild_expcache_db_final(DBKey key, DBData *data, va_list ap) {
/**
* @see DBApply
*/
-int guild_castle_db_final(DBKey key, DBData *data, va_list ap) {
+int guild_castle_db_final(union DBKey key, struct DBData *data, va_list ap)
+{
struct guild_castle* gc = DB->data2ptr(data);
if( gc->temp_guardians )
aFree(gc->temp_guardians);
@@ -2283,8 +2287,9 @@ void do_init_guild(bool minimal) {
timer->add_interval(timer->gettick()+GUILD_SEND_XY_INVERVAL,guild->send_xy_timer,0,0,GUILD_SEND_XY_INVERVAL);
}
-void do_final_guild(void) {
- DBIterator *iter = db_iterator(guild->db);
+void do_final_guild(void)
+{
+ struct DBIterator *iter = db_iterator(guild->db);
struct guild *g;
for( g = dbi_first(iter); dbi_exists(iter); g = dbi_next(iter) ) {