diff options
author | Haru <haru@dotalux.com> | 2016-02-19 18:46:18 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-03-20 18:32:07 +0100 |
commit | 8c9e9668cef87ab9595bde6608de424072cc752d (patch) | |
tree | 3645ce8adc6146a867ffd564006d2d8e0b7b1eef /src | |
parent | 138956dcf9415353a4f67de6bc66efa23a04e61c (diff) | |
download | hercules-8c9e9668cef87ab9595bde6608de424072cc752d.tar.gz hercules-8c9e9668cef87ab9595bde6608de424072cc752d.tar.bz2 hercules-8c9e9668cef87ab9595bde6608de424072cc752d.tar.xz hercules-8c9e9668cef87ab9595bde6608de424072cc752d.zip |
Added const qualifier to the value argument of script->setd_sub
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/map/npc.c | 2 | ||||
-rw-r--r-- | src/map/script.c | 8 | ||||
-rw-r--r-- | src/map/script.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index 2b1a541d8..93981e312 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -3567,7 +3567,7 @@ int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const c } st = script->alloc_state(ev->nd->u.scr.script, ev->pos, sd->bl.id, ev->nd->bl.id); - script->setd_sub(st, NULL, ".@atcmd_command$", 0, (void *)command, NULL); + script->setd_sub(st, NULL, ".@atcmd_command$", 0, command, NULL); len = strlen(message); if (len) { diff --git a/src/map/script.c b/src/map/script.c index 804fdd844..3482165f8 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3358,7 +3358,7 @@ int set_var(struct map_session_data *sd, char *name, void *val) return script->set_reg(NULL, sd, reference_uid(script->add_str(name),0), name, val, NULL); } -void setd_sub(struct script_state *st, struct map_session_data *sd, const char *varname, int elem, void *value, struct reg_db *ref) +void setd_sub(struct script_state *st, struct map_session_data *sd, const char *varname, int elem, const void *value, struct reg_db *ref) { script->set_reg(st, sd, reference_uid(script->add_str(varname),elem), varname, value, ref); } @@ -15923,10 +15923,10 @@ BUILDIN(setd) } } - if( is_string_variable(varname) ) { - script->setd_sub(st, sd, varname, elem, (void *)script_getstr(st, 3), NULL); + if (is_string_variable(varname)) { + script->setd_sub(st, sd, varname, elem, script_getstr(st, 3), NULL); } else { - script->setd_sub(st, sd, varname, elem, (void *)h64BPTRSIZE(script_getnum(st, 3)), NULL); + script->setd_sub(st, sd, varname, elem, (const void *)h64BPTRSIZE(script_getnum(st, 3)), NULL); } return true; diff --git a/src/map/script.h b/src/map/script.h index 9eb473f03..b8e9d1997 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -692,7 +692,7 @@ struct script_interface { int (*add_str) (const char* p); const char* (*get_str) (int id); int (*search_str) (const char* p); - void (*setd_sub) (struct script_state *st, struct map_session_data *sd, const char *varname, int elem, void *value, struct reg_db *ref); + void (*setd_sub) (struct script_state *st, struct map_session_data *sd, const char *varname, int elem, const void *value, struct reg_db *ref); void (*attach_state) (struct script_state* st); /* */ struct script_queue *(*queue) (int idx); |