diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-01-09 00:18:53 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-01-09 00:43:27 -0800 |
commit | f0a87e4f7f5377498960429e96be5dff183c8326 (patch) | |
tree | 2661728f73f3c163e971d94cd123ef6e378264aa /src/map/script.cpp | |
parent | f2fd4885c2a906414e0f36acf95d252e5a9d5805 (diff) | |
download | tmwa-f0a87e4f7f5377498960429e96be5dff183c8326.tar.gz tmwa-f0a87e4f7f5377498960429e96be5dff183c8326.tar.bz2 tmwa-f0a87e4f7f5377498960429e96be5dff183c8326.tar.xz tmwa-f0a87e4f7f5377498960429e96be5dff183c8326.zip |
Make incoming packets read-only
Diffstat (limited to 'src/map/script.cpp')
-rw-r--r-- | src/map/script.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map/script.cpp b/src/map/script.cpp index eca91e6..a82cd66 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -941,7 +941,7 @@ const ScriptCode *parse_script(const char *src, int line) exit(1); } set_label(l, script_pos); - strdb_insert(scriptlabel_db, (const char*)p, script_pos); // 外部用label db登録 + strdb_insert(scriptlabel_db, p, script_pos); // 外部用label db登録 *tmpp = c; p = tmpp + 1; continue; @@ -1373,7 +1373,8 @@ void builtin_callfunc(ScriptState *st) const ScriptCode *scr; const char *str = conv_str(st, &(st->stack->stack_data[st->start + 2])); - if ((scr = (const ScriptCode *)strdb_search(script_get_userfunc_db(), str))) + // note: strdb_search returns a void *; but ScriptCode is really const + if ((scr = static_cast<const ScriptCode *>(strdb_search(script_get_userfunc_db(), str)))) { int j = 0; #if 0 @@ -5082,7 +5083,7 @@ void mapregstr_db_final(db_key_t, db_val_t data) static void userfunc_db_final(db_key_t key, db_val_t data) { - free((char*)key.s); + free(key.ms); free(data); } |