From 2a0bb108d02755aec142c9523b99f87f956eea7a Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Mon, 28 Nov 2016 10:06:14 -0600 Subject: [PATCH] dnp3-gen: rename index variable to point_index Gcc 4.6 will warning with -Wshadow for a local variable named "index" as has a function named "index". Newer versions of gcc handle this case. --- scripts/dnp3-gen/dnp3-gen.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/dnp3-gen/dnp3-gen.py b/scripts/dnp3-gen/dnp3-gen.py index 29d7ae2e59..67cee0e2bc 100755 --- a/scripts/dnp3-gen/dnp3-gen.py +++ b/scripts/dnp3-gen/dnp3-gen.py @@ -363,7 +363,7 @@ static int DNP3DecodeObjectG{{object.group}}V{{object.variation}}(const uint8_t DNP3ObjectG{{object.group}}V{{object.variation}} *object = NULL; int bytes = (count / 8) + 1; uint32_t prefix = 0; - int index = start; + int point_index = start; if (!DNP3ReadPrefix(buf, len, prefix_code, &prefix)) { goto error; @@ -392,13 +392,13 @@ static int DNP3DecodeObjectG{{object.group}}V{{object.variation}}(const uint8_t #error "Unhandled field width: {{object.fields[0].width}}" {% endif %} - if (!DNP3AddPoint(points, object, index, prefix_code, prefix)) { + if (!DNP3AddPoint(points, object, point_index, prefix_code, prefix)) { goto error; } object = NULL; count--; - index++; + point_index++; } } @@ -418,7 +418,7 @@ static int DNP3DecodeObjectG{{object.group}}V{{object.variation}}(const uint8_t { DNP3ObjectG{{object.group}}V{{object.variation}} *object = NULL; uint32_t prefix = 0; - uint32_t index = start; + uint32_t point_index = start; {% if object._track_offset %} uint32_t offset; {% endif %} @@ -558,12 +558,12 @@ static int DNP3DecodeObjectG{{object.group}}V{{object.variation}}(const uint8_t {% endif %} {% endfor %} - if (!DNP3AddPoint(points, object, index, prefix_code, prefix)) { + if (!DNP3AddPoint(points, object, point_index, prefix_code, prefix)) { goto error; } object = NULL; - index++; + point_index++; } return 1;