[neard][PATCH v2 51/73] unit: do not shadow global 'text' variable (-Wshadow)

Krzysztof Kozlowski <[email protected]>
Newsgroups dev.linux.lists.oe-linux-nfc,org.01.lists.linux-nfc
Message-ID <[email protected]>
Fix -Wshadow warning:

unit/test-ndef-parse.c: In function ‘test_ndef_title_sp’:
unit/test-ndef-parse.c:194:33: error: declaration of ‘text’ shadows a global declaration [-Werror=shadow]
  194 |  struct near_ndef_text_payload *text;
      |                                 ^~~~
unit/test-ndef-parse.c:42:16: note: shadowed declaration is here
   42 | static uint8_t text[] = {0xd1, 0x1, 0x13, 0x54, 0x5, 0x65, 0x6e, 0x2d,
      |                ^~~~

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

diff --git a/unit/test-ndef-parse.c b/unit/test-ndef-parse.c
index 96288f29f44d..67de3f2e77bd 100644
--- a/unit/test-ndef-parse.c
+++ b/unit/test-ndef-parse.c
@@ -146,9 +146,9 @@ static uint8_t uri[] = {0xd1, 0x1, 0xa, 0x55, 0x1, 0x69, 0x6e, 0x74,
 			0x65, 0x6c, 0x2e, 0x63, 0x6f, 0x6d};
 
 /* 'hello żółw' - UTF-8 - en-US Text NDEF */
-static uint8_t text[] = {0xd1, 0x1, 0x13, 0x54, 0x5, 0x65, 0x6e, 0x2d,
-			 0x55, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0xc5,
-			 0xbc, 0xc3, 0xb3, 0xc5, 0x82, 0x77};
+static uint8_t text_utf8[] = {0xd1, 0x1, 0x13, 0x54, 0x5, 0x65, 0x6e, 0x2d,
+			0x55, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0xc5,
+			0xbc, 0xc3, 0xb3, 0xc5, 0x82, 0x77};
 
 /* 'hello żółw' - UTF-16 - en-US Text NDEF UTF-16 malformed*/
 static uint8_t text_utf16_invalid[] = {0xd1, 0x1, 0x19, 0x54, 0x85,
@@ -232,7 +232,7 @@ static void test_ndef_text(void)
 	GList *records;
 	struct near_ndef_record *record;
 
-	records = near_ndef_parse_msg(text, sizeof(text), NULL);
+	records = near_ndef_parse_msg(text_utf8, sizeof(text_utf8), NULL);
 
 	g_assert(records);
 	g_assert_cmpuint(g_list_length(records), ==, 1);
-- 
2.27.0
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.