diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-11 14:31:00 +0200 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-19 12:53:25 +0200 |
commit | 418f64b18cc7acce8797a54ff0873f1bb2196845 (patch) | |
tree | 672849035d5f3a87c0689431076907d57707f412 | |
parent | f0140ffbe387ffa13c6ecbfe2dddf1826505f16b (diff) | |
download | neard-418f64b18cc7acce8797a54ff0873f1bb2196845.tar.gz |
unit: do not shadow global 'uri' variable (-Wshadow)
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 <krzysztof.kozlowski@canonical.com>
-rw-r--r-- | unit/test-ndef-parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/unit/test-ndef-parse.c b/unit/test-ndef-parse.c index 67de3f2..f8b3b7b 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); |