summaryrefslogtreecommitdiff
path: root/src/map/script.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-08-27 12:50:01 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-08-27 12:53:45 -0700
commit99c9ab6b3c6b0a877b454346addd57d18d1ea07e (patch)
tree0a1f409b3b9d5fc59384c2b623f4bfea0f6844b5 /src/map/script.cpp
parent9951ad78c80e144c166a7d476cad7ffdf84332a9 (diff)
downloadtmwa-99c9ab6b3c6b0a877b454346addd57d18d1ea07e.tar.gz
tmwa-99c9ab6b3c6b0a877b454346addd57d18d1ea07e.tar.bz2
tmwa-99c9ab6b3c6b0a877b454346addd57d18d1ea07e.tar.xz
tmwa-99c9ab6b3c6b0a877b454346addd57d18d1ea07e.zip
The downside of hiding a loop in a macro
Diffstat (limited to 'src/map/script.cpp')
-rw-r--r--src/map/script.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/map/script.cpp b/src/map/script.cpp
index c099339..d5eb379 100644
--- a/src/map/script.cpp
+++ b/src/map/script.cpp
@@ -1818,16 +1818,18 @@ int getarraysize(ScriptState *st, SIR reg)
{
if (u.str[0])
c = i;
- continue;
+ goto continue_outer;
}
CASE (const ScriptDataInt&, u)
{
if (u.numi)
c = i;
- continue;
+ goto continue_outer;
}
}
abort();
+ continue_outer:
+ ;
}
return c + 1;
}
@@ -4362,46 +4364,38 @@ void run_func(ScriptState *st)
CASE (const ScriptDataInt&, u)
{
PRINTF(" int(%d)"_fmt, u.numi);
- break;
}
CASE (const ScriptDataRetInfo&, u)
{
PRINTF(" retinfo(%p)"_fmt, static_cast<const void *>(u.script));
- break;
}
CASE (const ScriptDataParam&, u)
{
PRINTF(" param(%d)"_fmt, u.reg.sp());
- break;
}
CASE (const ScriptDataVariable&, u)
{
PRINTF(" name(%s)[%d]"_fmt, variable_names.outtern(u.reg.base()), u.reg.index());
- break;
}
CASE (const ScriptDataArg&, u)
{
(void)u;
PRINTF(" arg"_fmt);
- break;
}
CASE (const ScriptDataPos&, u)
{
(void)u;
PRINTF(" pos(%d)"_fmt, u.numi);
- break;
}
CASE (const ScriptDataStr&, u)
{
(void)u;
PRINTF(" str(%s)"_fmt, u.str);
- break;
}
CASE (const ScriptDataFuncRef&, u)
{
(void)u;
PRINTF(" func(%s)"_fmt, builtin_functions[u.numi].name);
- break;
}
}
}