From 99c9ab6b3c6b0a877b454346addd57d18d1ea07e Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Wed, 27 Aug 2014 12:50:01 -0700 Subject: The downside of hiding a loop in a macro --- src/map/script.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/map/script.cpp') 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(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; } } } -- cgit v1.2.3-60-g2f50