]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
reduce scope of variables
authorAmadeusz Sławiński <amade@asmblr.net>
Wed, 22 Feb 2017 14:04:34 +0000 (15:04 +0100)
committerAmadeusz Sławiński <amade@asmblr.net>
Wed, 22 Feb 2017 14:04:34 +0000 (15:04 +0100)
qcsrc/common/util.qc

index 16467f3fac087edea71ed29375f6d4f9d642ac1d..0a371ff0004c7fc9430cbec14668c4a77ccb222e 100644 (file)
@@ -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")
                        {