]> granicus.if.org Git - strace/commitdiff
mpers.awk: declare local variables consistently
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 31 Aug 2017 09:54:24 +0000 (09:54 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 31 Aug 2017 09:54:24 +0000 (09:54 +0000)
* mpers.awk (compare_indices): Make c1 and c2 variables local.
(enter): Make item variable local.
(what_is): Make loc_diff, returned_size, and to_return local.

mpers.awk

index 92a1dfa04037708d172c9bcdb5e0ad3ae412f5bb..705ee642eff81d040df9ae4fbda4072b19d90734 100644 (file)
--- a/mpers.awk
+++ b/mpers.awk
@@ -27,7 +27,9 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-function compare_indices(i1, v1, i2, v2) {
+function compare_indices(i1, v1, i2, v2, \
+                        c1, c2)
+{
        c1 = strtonum(sprintf("%s", i1))
        c2 = strtonum(sprintf("%s", i2))
        if (c1 < c2)
@@ -53,7 +55,8 @@ function array_seq(array_idx)
        array[array_idx]["seq"] = index_seq
        return index_seq
 }
-function enter(array_idx)
+function enter(array_idx,
+              item)
 {
        if (array_idx in called) {
                printf("%s: index loop detected:", FILENAME) > "/dev/stderr"
@@ -78,8 +81,9 @@ function update_upper_bound(idx, val, \
        array[idx]["count"] = count * val
        array[idx]["upper_bound"] = array[idx]["upper_bound"] "[" val "]"
 }
-function what_is(what_idx, type_idx, special, item, \
-                location, prev_location, prev_returned_size)
+function what_is(what_idx, \
+                item, loc_diff, location, prev_location, prev_returned_size, \
+                returned_size, special, to_return, type_idx)
 {
        enter(what_idx)
        special = array_get(what_idx, "special")