summaryrefslogtreecommitdiff
path: root/src/char/int_homun.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-01-07 03:41:22 +0100
committerHaru <haru@dotalux.com>2016-02-24 20:57:34 +0100
commit9aa8a3b09ee2c491b55259ee433af7f39308ca37 (patch)
treef23571319dc25bdcb7efd56df9fc1eab6be32588 /src/char/int_homun.c
parent931d716e1000b50a66b012815a412619d16fc957 (diff)
downloadhercules-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/char/int_homun.c')
-rw-r--r--src/char/int_homun.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/char/int_homun.c b/src/char/int_homun.c
index 95374a978..1377bfbd8 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -49,7 +49,7 @@ void inter_homunculus_sql_final(void)
return;
}
-void mapif_homunculus_created(int fd, int account_id, struct s_homunculus *sh, unsigned char flag)
+void mapif_homunculus_created(int fd, int account_id, const struct s_homunculus *sh, unsigned char flag)
{
nullpo_retv(sh);
WFIFOHEAD(fd, sizeof(struct s_homunculus)+9);
@@ -97,7 +97,7 @@ void mapif_homunculus_saved(int fd, int account_id, bool flag)
WFIFOSET(fd, 7);
}
-void mapif_homunculus_renamed(int fd, int account_id, int char_id, unsigned char flag, char* name)
+void mapif_homunculus_renamed(int fd, int account_id, int char_id, unsigned char flag, const char *name)
{
nullpo_retv(name);
WFIFOHEAD(fd, NAME_LENGTH+12);
@@ -279,7 +279,7 @@ bool mapif_homunculus_delete(int homun_id)
return true;
}
-bool mapif_homunculus_rename(char *name)
+bool mapif_homunculus_rename(const char *name)
{
int i;
@@ -302,10 +302,15 @@ bool mapif_homunculus_rename(char *name)
}
-void mapif_parse_homunculus_create(int fd, int len, int account_id, struct s_homunculus* phd)
+void mapif_parse_homunculus_create(int fd, int len, int account_id, const struct s_homunculus *phd)
{
- bool result = mapif->homunculus_create(phd);
- mapif->homunculus_created(fd, account_id, phd, result);
+ struct s_homunculus shd;
+ bool result;
+
+ memcpy(&shd, phd, sizeof(shd));
+
+ result = mapif->homunculus_create(&shd);
+ mapif->homunculus_created(fd, account_id, &shd, result);
}
void mapif_parse_homunculus_delete(int fd, int homun_id)
@@ -321,13 +326,13 @@ void mapif_parse_homunculus_load(int fd, int account_id, int homun_id)
mapif->homunculus_loaded(fd, account_id, ( result ? &hd : NULL ));
}
-void mapif_parse_homunculus_save(int fd, int len, int account_id, struct s_homunculus* phd)
+void mapif_parse_homunculus_save(int fd, int len, int account_id, const struct s_homunculus *phd)
{
bool result = mapif->homunculus_save(phd);
mapif->homunculus_saved(fd, account_id, result);
}
-void mapif_parse_homunculus_rename(int fd, int account_id, int char_id, char* name)
+void mapif_parse_homunculus_rename(int fd, int account_id, int char_id, const char *name)
{
bool result = mapif->homunculus_rename(name);
mapif->homunculus_renamed(fd, account_id, char_id, result, name);