From: Amadeusz Sławiński Date: Wed, 22 Feb 2017 14:04:34 +0000 (+0100) Subject: reduce scope of variables X-Git-Tag: xonotic-v0.8.5~2843^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1bf0b804f47ee8029fe98ee449786942a10cada8;p=xonotic%2Fxonotic-data.pk3dir.git reduce scope of variables --- diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 16467f3fa..0a371ff00 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -668,7 +668,6 @@ bool isCaretEscaped(string theText, float pos) int skipIncompleteTag(string theText, float pos, int len) { - int i = 0, ch = 0; int tag_start = -1; if(substring(theText, pos - 1, 1) == "^") @@ -676,7 +675,7 @@ int skipIncompleteTag(string theText, float pos, int len) if(isCaretEscaped(theText, pos - 1) || pos >= len) return 0; - ch = str2chr(theText, pos); + int ch = str2chr(theText, pos); if(ch >= '0' && ch <= '9') return 1; // ^[0-9] color code found else if (ch == 'x') @@ -686,7 +685,7 @@ int skipIncompleteTag(string theText, float pos, int len) } else { - for(i = 2; pos - i >= 0 && i <= 4; ++i) + for(int i = 2; pos - i >= 0 && i <= 4; ++i) { if(substring(theText, pos - i, 2) == "^x") {