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

Krzysztof Kozlowski <[email protected]>
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 afcede57b0d8..cdeb1a1a24df 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 */
@@ -210,7 +210,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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.