Skip to content

Commit 56bdab5

Browse files
author
Andrew Gunnerson
committed
libmbdevice: schemas2cpp.cpp: Declare g_schemas in generated cpp file to avoid -Wshadow warning
Signed-off-by: Andrew Gunnerson <[email protected]>
1 parent d513f9c commit 56bdab5

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

libmbdevice/schemas/device.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,4 @@
261261
"block_devs"
262262
],
263263
"additionalProperties": false
264-
}
264+
}

libmbdevice/schemas/device_list.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
"items": {
88
"$ref": "device.json#"
99
}
10-
}
10+
}

libmbdevice/schemas2cpp.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,10 @@ int main(int argc, char *argv[])
315315
fprintf(fp.get(),
316316
"#include <array>\n"
317317
"#include <utility>\n"
318+
// Make -Wshadow happy
319+
"extern std::array<std::pair<const char *, const char *>, %zu> g_schemas;\n"
318320
"std::array<std::pair<const char *, const char *>, %zu> g_schemas{{\n",
319-
results.size());
321+
results.size(), results.size());
320322

321323
for (auto const &r : results) {
322324
fprintf(fp.get(), " { \"");

0 commit comments

Comments
 (0)