From ff07e78eefa511c7ae363a00bf9fbc761240552e Mon Sep 17 00:00:00 2001 From: ultramage Date: Thu, 10 Jul 2008 08:27:03 +0000 Subject: Renamed 'struct storage' to 'struct storage_data' (to make 'storage' available as a variable name). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12932 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 2 +- src/map/charcommand.c | 4 ++-- src/map/clif.c | 6 +++--- src/map/clif.h | 8 ++++---- src/map/intif.c | 16 ++++++++-------- src/map/intif.h | 2 +- src/map/storage.c | 42 +++++++++++++++++++++--------------------- src/map/storage.h | 8 ++++---- 8 files changed, 44 insertions(+), 44 deletions(-) (limited to 'src/map') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 1bdbf0697..b47665bf5 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1155,7 +1155,7 @@ int atcommand_storage(const int fd, struct map_session_data* sd, const char* com *------------------------------------------*/ int atcommand_guildstorage(const int fd, struct map_session_data* sd, const char* command, const char* message) { - struct storage *stor; //changes from Freya/Yor + struct storage_data *stor; //changes from Freya/Yor nullpo_retr(-1, sd); if (!sd->status.guild_id) { diff --git a/src/map/charcommand.c b/src/map/charcommand.c index cd2c31749..50cdf5b60 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -606,7 +606,7 @@ int charcommand_effect(const int fd, struct map_session_data* sd, const char* co *------------------------------------------*/ int charcommand_storagelist(const int fd, struct map_session_data* sd, const char* command, const char* message) { - struct storage *stor; + struct storage_data *stor; struct map_session_data *pl_sd; struct item_data *item_data, *item_temp; int i, j, count, counter, counter2; @@ -1643,7 +1643,7 @@ int charcommand_storage(const int fd, struct map_session_data* sd, const char* c *------------------------------------------*/ int charcommand_guildstorage(const int fd, struct map_session_data* sd, const char* command, const char* message) { - struct storage *stor; //changes from Freya/Yor + struct storage_data *stor; //changes from Freya/Yor char character[NAME_LENGTH]; struct map_session_data *pl_sd; diff --git a/src/map/clif.c b/src/map/clif.c index fec866dc0..3033717c5 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1868,7 +1868,7 @@ void clif_equiplist(struct map_session_data *sd) } //Unified storage function which sends all of the storage (requires two packets, one for equipable items and one for stackable ones. [Skotlex] -void clif_storagelist(struct map_session_data *sd,struct storage *stor) +void clif_storagelist(struct map_session_data *sd,struct storage_data *stor) { struct item_data *id; int i,n,ne,fd=sd->fd; @@ -3184,7 +3184,7 @@ void clif_tradecompleted(struct map_session_data* sd, int fail) /*========================================== * カプラ倉庫のアイテム数を更新 *------------------------------------------*/ -int clif_updatestorageamount(struct map_session_data *sd,struct storage *stor) +int clif_updatestorageamount(struct map_session_data *sd,struct storage_data *stor) { int fd; @@ -3204,7 +3204,7 @@ int clif_updatestorageamount(struct map_session_data *sd,struct storage *stor) /*========================================== * カプラ倉庫にアイテムを追加する *------------------------------------------*/ -int clif_storageitemadded(struct map_session_data *sd,struct storage *stor,int index,int amount) +int clif_storageitemadded(struct map_session_data *sd,struct storage_data *stor,int index,int amount) { int view,fd; diff --git a/src/map/clif.h b/src/map/clif.h index 4cf738ec9..500c385af 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -6,7 +6,7 @@ #include "../common/cbasetypes.h" //#include "../common/mmo.h" -struct storage; +struct storage_data; struct guild_storage; //#include "map.h" struct block_list; @@ -192,9 +192,9 @@ void clif_tradecompleted(struct map_session_data* sd, int fail); // storage #include "storage.h" -void clif_storagelist(struct map_session_data *sd,struct storage *stor); -int clif_updatestorageamount(struct map_session_data *sd,struct storage *stor); -int clif_storageitemadded(struct map_session_data *sd,struct storage *stor,int index,int amount); +void clif_storagelist(struct map_session_data *sd,struct storage_data *stor); +int clif_updatestorageamount(struct map_session_data *sd,struct storage_data *stor); +int clif_storageitemadded(struct map_session_data *sd,struct storage_data *stor,int index,int amount); int clif_storageitemremoved(struct map_session_data *sd,int index,int amount); int clif_storageclose(struct map_session_data *sd); void clif_guildstoragelist(struct map_session_data *sd,struct guild_storage *stor); diff --git a/src/map/intif.c b/src/map/intif.c index e90b5985f..99e054119 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -338,16 +338,16 @@ int intif_request_storage(int account_id) return 0; } // 倉庫データ送信 -int intif_send_storage(struct storage *stor) +int intif_send_storage(struct storage_data *stor) { if (CheckForCharServer()) return 0; nullpo_retr(0, stor); - WFIFOHEAD(inter_fd,sizeof(struct storage)+8); + WFIFOHEAD(inter_fd,sizeof(struct storage_data)+8); WFIFOW(inter_fd,0) = 0x3011; - WFIFOW(inter_fd,2) = sizeof(struct storage)+8; + WFIFOW(inter_fd,2) = sizeof(struct storage_data)+8; WFIFOL(inter_fd,4) = stor->account_id; - memcpy( WFIFOP(inter_fd,8),stor, sizeof(struct storage) ); + memcpy( WFIFOP(inter_fd,8),stor, sizeof(struct storage_data) ); WFIFOSET(inter_fd,WFIFOW(inter_fd,2)); return 0; } @@ -971,7 +971,7 @@ int intif_parse_Registers(int fd) // 倉庫データ受信 int intif_parse_LoadStorage(int fd) { - struct storage *stor; + struct storage_data *stor; struct map_session_data *sd; sd=map_id2sd( RFIFOL(fd,4) ); @@ -990,13 +990,13 @@ int intif_parse_LoadStorage(int fd) ShowWarning("intif_parse_LoadStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id); return 1; } - if (RFIFOW(fd,2)-8 != sizeof(struct storage)) { - ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage)); + if (RFIFOW(fd,2)-8 != sizeof(struct storage_data)) { + ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage_data)); return 1; } if(battle_config.save_log) ShowInfo("intif_openstorage: %d\n",RFIFOL(fd,4) ); - memcpy(stor,RFIFOP(fd,8),sizeof(struct storage)); + memcpy(stor,RFIFOP(fd,8),sizeof(struct storage_data)); stor->dirty=0; stor->storage_status=1; sd->state.storage_flag = 1; diff --git a/src/map/intif.h b/src/map/intif.h index c4fe34f20..be0bc8d72 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -25,7 +25,7 @@ int intif_saveregistry(struct map_session_data *sd, int type); int intif_request_registry(struct map_session_data *sd, int flag); int intif_request_storage(int account_id); -int intif_send_storage(struct storage *stor); +int intif_send_storage(struct storage_data *stor); int intif_request_guild_storage(int account_id, int guild_id); int intif_send_guild_storage(int account_id, struct guild_storage *gstor); diff --git a/src/map/storage.c b/src/map/storage.c index c2e4bf5f7..541c28e4c 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -44,7 +44,7 @@ int storage_comp_item(const void *_i1, const void *_i2) return i1->nameid - i2->nameid; } -void storage_sortitem (struct storage *stor) +void storage_sortitem (struct storage_data *stor) { nullpo_retv(stor); qsort(stor->storage_, MAX_STORAGE, sizeof(struct item), storage_comp_item); @@ -83,7 +83,7 @@ static int storage_reconnect_sub(DBKey key,void *data,va_list ap) } else { //Account Storage - struct storage* stor = (struct storage*) data; + struct storage_data* stor = (struct storage_data*) data; if (stor->dirty && stor->storage_status == 0) //Save closed storages. storage_storage_save(stor->account_id, stor->dirty==2?1:0); } @@ -99,20 +99,20 @@ void do_reconnect_storage(void) static void* create_storage(DBKey key, va_list args) { - struct storage *stor; - stor = (struct storage *) aCallocA (sizeof(struct storage), 1); + struct storage_data *stor; + stor = (struct storage_data *) aCallocA (sizeof(struct storage_data), 1); stor->account_id = key.i; return stor; } -struct storage *account2storage(int account_id) +struct storage_data *account2storage(int account_id) { - return (struct storage*)idb_ensure(storage_db,account_id,create_storage); + return (struct storage_data*)idb_ensure(storage_db,account_id,create_storage); } // Just to ask storage, without creation -struct storage *account2storage2(int account_id) +struct storage_data *account2storage2(int account_id) { - return (struct storage*)idb_get(storage_db, account_id); + return (struct storage_data*)idb_get(storage_db, account_id); } int storage_delete(int account_id) @@ -129,7 +129,7 @@ int storage_delete(int account_id) *------------------------------------------*/ int storage_storageopen(struct map_session_data *sd) { - struct storage *stor; + struct storage_data *stor; nullpo_retr(0, sd); if(sd->state.storage_flag) @@ -141,7 +141,7 @@ int storage_storageopen(struct map_session_data *sd) return 1; } - if((stor = (struct storage*)idb_get(storage_db,sd->status.account_id)) == NULL) + if((stor = (struct storage_data*)idb_get(storage_db,sd->status.account_id)) == NULL) { //Request storage. intif_request_storage(sd->status.account_id); return 2; @@ -175,7 +175,7 @@ int compare_item(struct item *a, struct item *b) /*========================================== * Internal add-item function. *------------------------------------------*/ -static int storage_additem(struct map_session_data *sd,struct storage *stor,struct item *item_data,int amount) +static int storage_additem(struct map_session_data *sd,struct storage_data *stor,struct item *item_data,int amount) { struct item_data *data; int i; @@ -224,7 +224,7 @@ static int storage_additem(struct map_session_data *sd,struct storage *stor,stru /*========================================== * Internal del-item function *------------------------------------------*/ -static int storage_delitem(struct map_session_data *sd,struct storage *stor,int n,int amount) +static int storage_delitem(struct map_session_data *sd,struct storage_data *stor,int n,int amount) { if(stor->storage_[n].nameid==0 || stor->storage_[n].amountstatus.account_id)); @@ -278,7 +278,7 @@ int storage_storageadd(struct map_session_data *sd,int index,int amount) *------------------------------------------*/ int storage_storageget(struct map_session_data *sd,int index,int amount) { - struct storage *stor; + struct storage_data *stor; int flag; nullpo_retr(0, sd); @@ -306,7 +306,7 @@ int storage_storageget(struct map_session_data *sd,int index,int amount) *------------------------------------------*/ int storage_storageaddfromcart(struct map_session_data *sd,int index,int amount) { - struct storage *stor; + struct storage_data *stor; nullpo_retr(0, sd); nullpo_retr(0, stor=account2storage2(sd->status.account_id)); @@ -334,7 +334,7 @@ int storage_storageaddfromcart(struct map_session_data *sd,int index,int amount) *------------------------------------------*/ int storage_storagegettocart(struct map_session_data *sd,int index,int amount) { - struct storage *stor; + struct storage_data *stor; nullpo_retr(0, sd); nullpo_retr(0, stor=account2storage2(sd->status.account_id)); @@ -363,7 +363,7 @@ int storage_storagegettocart(struct map_session_data *sd,int index,int amount) *------------------------------------------*/ int storage_storageclose(struct map_session_data *sd) { - struct storage *stor; + struct storage_data *stor; nullpo_retr(0, sd); nullpo_retr(0, stor=account2storage2(sd->status.account_id)); @@ -386,7 +386,7 @@ int storage_storageclose(struct map_session_data *sd) *------------------------------------------*/ int storage_storage_quit(struct map_session_data *sd, int flag) { - struct storage *stor; + struct storage_data *stor; nullpo_retr(0, sd); nullpo_retr(0, stor=account2storage2(sd->status.account_id)); @@ -405,7 +405,7 @@ int storage_storage_quit(struct map_session_data *sd, int flag) void storage_storage_dirty(struct map_session_data *sd) { - struct storage *stor; + struct storage_data *stor; stor=account2storage2(sd->status.account_id); @@ -415,7 +415,7 @@ void storage_storage_dirty(struct map_session_data *sd) int storage_storage_save(int account_id, int final) { - struct storage *stor; + struct storage_data *stor; stor=account2storage2(account_id); if(!stor) return 0; @@ -441,7 +441,7 @@ int storage_storage_save(int account_id, int final) //Ack from Char-server indicating the storage was saved. [Skotlex] int storage_storage_saved(int account_id) { - struct storage *stor; + struct storage_data *stor; if((stor=account2storage2(account_id)) == NULL) return 0; diff --git a/src/map/storage.h b/src/map/storage.h index 565495a9b..20257471a 100644 --- a/src/map/storage.h +++ b/src/map/storage.h @@ -5,7 +5,7 @@ #define _STORAGE_H_ //#include "../common/mmo.h" -struct storage; +struct storage_data; struct guild_storage; struct item; //#include "map.h" @@ -20,8 +20,8 @@ int storage_storageclose(struct map_session_data *sd); int do_init_storage(void); void do_final_storage(void); void do_reconnect_storage(void); -struct storage* account2storage(int account_id); -struct storage* account2storage2(int account_id); +struct storage_data* account2storage(int account_id); +struct storage_data* account2storage2(int account_id); int storage_storage_quit(struct map_session_data *sd, int flag); int storage_storage_save(int account_id, int final); int storage_storage_saved(int account_id); //Ack from char server that guild store was saved. @@ -43,7 +43,7 @@ int storage_guild_storagesaved(int guild_id); //Ack from char server that guild int storage_comp_item(const void *_i1, const void *_i2); //int storage_comp_item(const struct item* i1, const struct item* i2); -void storage_sortitem(struct storage* stor); +void storage_sortitem(struct storage_data* stor); void storage_gsortitem(struct guild_storage* gstor); #endif /* _STORAGE_H_ */ -- cgit v1.2.3-70-g09d2