diff options
author | Haru <haru@dotalux.com> | 2016-01-07 03:41:22 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-02-24 20:57:34 +0100 |
commit | 9aa8a3b09ee2c491b55259ee433af7f39308ca37 (patch) | |
tree | f23571319dc25bdcb7efd56df9fc1eab6be32588 /src/map/intif.c | |
parent | 931d716e1000b50a66b012815a412619d16fc957 (diff) | |
download | hercules-9aa8a3b09ee2c491b55259ee433af7f39308ca37.tar.gz hercules-9aa8a3b09ee2c491b55259ee433af7f39308ca37.tar.bz2 hercules-9aa8a3b09ee2c491b55259ee433af7f39308ca37.tar.xz hercules-9aa8a3b09ee2c491b55259ee433af7f39308ca37.zip |
Added const qualifier to several variable/argument pointers
- This is necessary for compatibility with a const RFIFOP.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/intif.c')
-rw-r--r-- | src/map/intif.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/map/intif.c b/src/map/intif.c index 9722b8f9a..e508b7b09 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -132,7 +132,7 @@ int intif_delete_petdata(int pet_id) return 1; } -int intif_rename(struct map_session_data *sd, int type, char *name) +int intif_rename(struct map_session_data *sd, int type, const char *name) { if (intif->CheckForCharServer()) return 1; @@ -231,7 +231,7 @@ int intif_main_message(struct map_session_data* sd, const char* message) } // The transmission of Wisp/Page to inter-server (player not found on this server) -int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, size_t mes_len) +int intif_wis_message(struct map_session_data *sd, const char *nick, const char *mes, size_t mes_len) { if (intif->CheckForCharServer()) return 0; @@ -463,7 +463,7 @@ int intif_send_guild_storage(int account_id,struct guild_storage *gstor) } // Party creation request -int intif_create_party(struct party_member *member,char *name,int item,int item2) +int intif_create_party(struct party_member *member, const char *name, int item, int item2) { if (intif->CheckForCharServer()) return 0; @@ -956,7 +956,7 @@ int intif_homunculus_requestdelete(int homun_id) // Wisp/Page reception // rewritten by [Yor] void intif_parse_WisMessage(int fd) { struct map_session_data* sd; - char *wisp_source; + const char *wisp_source; char name[NAME_LENGTH]; int id, i; @@ -1308,15 +1308,19 @@ void intif_parse_GuildBasicInfoChanged(int fd) { case GBI_SKILLPOINT: g->skill_point = RFIFOL(fd,10); break; case GBI_SKILLLV: { int idx, max; - struct guild_skill *gs = (struct guild_skill *)RFIFOP(fd,10); + const struct guild_skill *p_gs = (struct guild_skill *)RFIFOP(fd,10); + struct guild_skill *gs = NULL; - idx = gs->id - GD_SKILLBASE; + idx = p_gs->id - GD_SKILLBASE; Assert_retv(idx >= 0 && idx < MAX_GUILDSKILL); + + gs = &g->skill[idx]; + memcpy(gs, p_gs, sizeof(*gs)); + max = guild->skill_get_max(gs->id); - if( gs->lv > max ) + if (gs->lv > max) gs->lv = max; - memcpy(&(g->skill[idx]), gs, sizeof(g->skill[idx])); break; } } @@ -1527,7 +1531,7 @@ void intif_parse_QuestLog(int fd) { sd->quest_log = NULL; } } else { - struct quest *received = (struct quest *)RFIFOP(fd, 8); + const struct quest *received = (struct quest *)RFIFOP(fd, 8); int i, k = num_received; if (sd->quest_log) { RECREATE(sd->quest_log, struct quest, num_received); @@ -1876,7 +1880,7 @@ void intif_parse_AuctionResults(int fd) { struct map_session_data *sd = map->charid2sd(RFIFOL(fd,4)); short count = RFIFOW(fd,8); short pages = RFIFOW(fd,10); - uint8* data = RFIFOP(fd,12); + const uint8 *data = RFIFOP(fd,12); if( sd == NULL ) return; |