[linux-nfc] [neard][PATCH v2 52/73] unit: do not shadow global 'uri' variable (-Wshadow)

Krzysztof Kozlowski <[email protected]> Mon, 19 Jul 2021 13:07:58 +0200
Newsgroups org.01.lists.linux-nfc,dev.linux.lists.oe-linux-nfc
Message-ID <[email protected]>
Fix -Wshadow warnings like:

    unit/test-ndef-parse.c: In function ‘test_ndef_single_sp’:
    unit/test-ndef-parse.c:291:32: error: declaration of ‘uri’ shadows a global declaration [-Werror=shadow]
      291 |  struct near_ndef_uri_payload *uri;
          |                                ^~~
    unit/test-ndef-parse.c:145:16: note: shadowed declaration is here
      145 | static uint8_t uri[] = {0xd1, 0x1, 0xa, 0x55, 0x1, 0x69, 0x6e, 0x74,
          |                ^~~

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
 unit/test-ndef-parse.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/unit/test-ndef-parse.c b/unit/test-ndef-parse.c
index 67de3f2e77bd..f8b3b7be3a4c 100644
--- a/unit/test-ndef-parse.c
+++ b/unit/test-ndef-parse.c
@@ -142,7 +142,7 @@ struct near_ndef_ac_payload {
 };
 
 /* http://www.intel.com URI NDEF */
-static uint8_t uri[] = {0xd1, 0x1, 0xa, 0x55, 0x1, 0x69, 0x6e, 0x74,
+static uint8_t test_uri[] = {0xd1, 0x1, 0xa, 0x55, 0x1, 0x69, 0x6e, 0x74,
 			0x65, 0x6c, 0x2e, 0x63, 0x6f, 0x6d};
 
 /* 'hello żółw' - UTF-8 - en-US Text NDEF */
@@ -203,7 +203,7 @@ static void test_ndef_uri(void)
 	GList *records;
 	struct near_ndef_record *record;
 
-	records = near_ndef_parse_msg(uri, sizeof(uri), NULL);
+	records = near_ndef_parse_msg(test_uri, sizeof(test_uri), NULL);
 
 	g_assert(records);
 	g_assert_cmpuint(g_list_length(records), ==, 1);
-- 
2.27.0
_______________________________________________
Linux-nfc mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s