openpower-pels: clean up various compile warnings
Compile warnings observed when compiling parts of the
openpower-pels (or corresponding tests) under stricter
compiler warning flags of Meson.
Issues fixed:
- many unused parameters
- invalid case fall-through
- excess semi-colons
- incorrect 'const' on return-by-value type
- removal of variable length array in test case
- uncaught return from 'system' call in test case
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I8af69184042cf8661d1307a02ecf3afcab4724a1
diff --git a/test/openpower-pels/stream_test.cpp b/test/openpower-pels/stream_test.cpp
index 361cfc5..d0582d7 100644
--- a/test/openpower-pels/stream_test.cpp
+++ b/test/openpower-pels/stream_test.cpp
@@ -129,9 +129,11 @@
std::vector<uint8_t> data{0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc};
Stream stream{data};
- uint8_t buf[data.size()];
- stream.read(buf, data.size());
+ auto buf = decltype(data)(data.size());
+ ASSERT_EQ(data.size(), buf.size());
+
+ stream.read(buf.data(), buf.size());
for (size_t i = 0; i < data.size(); i++)
{
@@ -142,7 +144,7 @@
}
stream.offset(6);
- stream.write(buf, 6);
+ stream.write(buf.data(), 6);
for (size_t i = 0; i < 6; i++)
{
EXPECT_EQ(buf[i], data[i + 6]);