diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-01-08 19:00:34 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-01-08 19:54:26 -0800 |
commit | f2fd4885c2a906414e0f36acf95d252e5a9d5805 (patch) | |
tree | 918bff247135e9223a5126f1b85f4ae4fc9ba1aa /src/map/script.cpp | |
parent | 3e42921c657bc93094f0c7d96855aae9b0be5a7e (diff) | |
download | tmwa-f2fd4885c2a906414e0f36acf95d252e5a9d5805.tar.gz tmwa-f2fd4885c2a906414e0f36acf95d252e5a9d5805.tar.bz2 tmwa-f2fd4885c2a906414e0f36acf95d252e5a9d5805.tar.xz tmwa-f2fd4885c2a906414e0f36acf95d252e5a9d5805.zip |
Improve warning management more
Diffstat (limited to 'src/map/script.cpp')
-rw-r--r-- | src/map/script.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/map/script.cpp b/src/map/script.cpp index 25db80b..eca91e6 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -46,7 +46,9 @@ ScriptCode *script_buf; static int script_pos, script_size; +static char *str_buf; +static int str_pos, str_size; static struct str_data_t @@ -59,7 +61,9 @@ struct str_data_t int val; int next; } *str_data; +static int str_num = LABEL_START, str_data_size; +static int str_hash[16]; static @@ -449,7 +453,8 @@ void disp_error_message(const char *mes, const char *pos_) { const char *linestart = p; char *lineend = const_cast<char *>(strchr(p, '\n')); - char c; + // always initialized, but clang is not smart enough + char c = '\0'; if (lineend) { c = *lineend; @@ -2374,6 +2379,7 @@ void builtin_strcharinfo(ScriptState *st) // indexed by the equip_* in db/const.txt // TODO change to use EQUIP +static EPOS equip[10] = { EPOS::HAT, @@ -4128,7 +4134,7 @@ void builtin_message(ScriptState *st) const char *player = conv_str(st, &(st->stack->stack_data[st->start + 2])); const char *msg = conv_str(st, &(st->stack->stack_data[st->start + 3])); - if ((pl_sd = map_nick2sd((char *) player)) == NULL) + if ((pl_sd = map_nick2sd(player)) == NULL) return; clif_displaymessage(pl_sd->fd, msg); @@ -4741,7 +4747,7 @@ void run_script_main(const ScriptCode *script, int pos_, int, int, break; case ScriptCode::POS: case ScriptCode::NAME: - push_val(stack, c, (*(int *)(script + st->pos)) & 0xffffff); + push_val(stack, c, (*(const int *)(script + st->pos)) & 0xffffff); st->pos += 3; break; case ScriptCode::ARG: |