From: TimePath Date: Sat, 5 Sep 2015 01:47:29 +0000 (+1000) Subject: Document intent X-Git-Tag: xonotic-v0.8.2~1931^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1e2d8682cb9eec160fa9def1b8434a9d385f0d88;p=xonotic%2Fxonotic-data.pk3dir.git Document intent --- diff --git a/qcsrc/common/util-post.qh b/qcsrc/common/util-post.qh index dd20cf8f5..f796b6ebd 100644 --- a/qcsrc/common/util-post.qh +++ b/qcsrc/common/util-post.qh @@ -3,12 +3,15 @@ [[alias("self")]] entity __self; -#define WITH(type, name, value, block) do { \ +// Can't wrap with do-while as block may contain continue or break +#define WITH(type, name, value, block) { \ type __with_save = (name); \ name = (value); \ LAMBDA(block) \ name = __with_save; \ -} while (0) +} do { } while (0) + +// Transition from global 'self' to local 'this' // Step 1: auto oldself #if 1 @@ -33,6 +36,7 @@ entity getself() { return self; } #endif // Step 4: enable when possible +// TODO: Remove SELFPARAM in favor of a parameter #if 0 #define SELFPARAM() noref const entity this = __self #define self this