mpers.awk: declare local variables consistently

* 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.
This commit is contained in:
2017-08-31 09:54:24 +00:00
parent bfe513073d
commit fd3447b51e

View File

@@ -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")