phosphor-ipmi-flash: Fix all C++ warnings
Change-Id: I89236b2dab88ca725e269bb8f5b2cbfd271e807a
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/bmc/firmware-handler/firmware_handler.cpp b/bmc/firmware-handler/firmware_handler.cpp
index f5f1023..afcfc81 100644
--- a/bmc/firmware-handler/firmware_handler.cpp
+++ b/bmc/firmware-handler/firmware_handler.cpp
@@ -94,7 +94,7 @@
* Per the design, this mean abort, and this will trigger whatever
* appropriate actions are required to abort the process.
*/
-bool FirmwareBlobHandler::deleteBlob(const std::string& path)
+bool FirmwareBlobHandler::deleteBlob(const std::string&)
{
switch (state)
{
@@ -554,7 +554,7 @@
* false at any other part. -- the lpc handler portion will know to return
* false.
*/
-bool FirmwareBlobHandler::writeMeta(uint16_t session, uint32_t offset,
+bool FirmwareBlobHandler::writeMeta(uint16_t session, uint32_t,
const std::vector<uint8_t>& data)
{
auto item = lookup.find(session);
@@ -586,8 +586,7 @@
* For this file to have opened, the other two must be closed, which means any
* out-of-band transport mechanism involved is closed.
*/
-bool FirmwareBlobHandler::commit(uint16_t session,
- const std::vector<uint8_t>& data)
+bool FirmwareBlobHandler::commit(uint16_t session, const std::vector<uint8_t>&)
{
auto item = lookup.find(session);
if (item == lookup.end())
@@ -753,7 +752,7 @@
}
}
-bool FirmwareBlobHandler::expire(uint16_t session)
+bool FirmwareBlobHandler::expire(uint16_t)
{
abortProcess();
return true;
@@ -763,9 +762,7 @@
* Currently, the design does not provide this with a function, however,
* it will likely change to support reading data back.
*/
-std::vector<uint8_t> FirmwareBlobHandler::read(uint16_t session,
- uint32_t offset,
- uint32_t requestedSize)
+std::vector<uint8_t> FirmwareBlobHandler::read(uint16_t, uint32_t, uint32_t)
{
return {};
}
diff --git a/bmc/firmware-handler/net_handler.cpp b/bmc/firmware-handler/net_handler.cpp
index 14ae4fb..3b77be5 100644
--- a/bmc/firmware-handler/net_handler.cpp
+++ b/bmc/firmware-handler/net_handler.cpp
@@ -138,7 +138,7 @@
return data;
}
-bool NetDataHandler::writeMeta(const std::vector<std::uint8_t>& configuration)
+bool NetDataHandler::writeMeta(const std::vector<std::uint8_t>&)
{
// TODO: have the host tool send the expected IP address that it will
// connect from
diff --git a/bmc/firmware-handler/pci_handler.cpp b/bmc/firmware-handler/pci_handler.cpp
index 1b6b7ff..d74c4a4 100644
--- a/bmc/firmware-handler/pci_handler.cpp
+++ b/bmc/firmware-handler/pci_handler.cpp
@@ -107,7 +107,7 @@
return results;
}
-bool PciDataHandler::writeMeta(const std::vector<std::uint8_t>& configuration)
+bool PciDataHandler::writeMeta(const std::vector<std::uint8_t>&)
{
/* PCI handler doesn't require configuration write, only read. */
return false;
diff --git a/bmc/firmware-handler/pci_nuvoton_handler.cpp b/bmc/firmware-handler/pci_nuvoton_handler.cpp
index 0a3f62e..dc79db5 100644
--- a/bmc/firmware-handler/pci_nuvoton_handler.cpp
+++ b/bmc/firmware-handler/pci_nuvoton_handler.cpp
@@ -80,7 +80,7 @@
return results;
}
-bool PciDataHandler::writeMeta(const std::vector<std::uint8_t>& configuration)
+bool PciDataHandler::writeMeta(const std::vector<std::uint8_t>&)
{
/* PCI handler doesn't require configuration write, only read. */
return false;
diff --git a/bmc/firmware-handler/test/firmware_close_unittest.cpp b/bmc/firmware-handler/test/firmware_close_unittest.cpp
index 2a722b6..04aec22 100644
--- a/bmc/firmware-handler/test/firmware_close_unittest.cpp
+++ b/bmc/firmware-handler/test/firmware_close_unittest.cpp
@@ -31,9 +31,11 @@
EXPECT_CALL(*hashImageMock, open(StrEq(hashBlobId), std::ios::out))
.WillOnce(Return(true));
- EXPECT_TRUE(handler->open(
- 0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::lpc,
- hashBlobId));
+ EXPECT_TRUE(
+ handler->open(0,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::lpc,
+ hashBlobId));
/* The active hash blob_id was added. */
auto currentBlobs = handler->getBlobIds();
@@ -59,9 +61,11 @@
EXPECT_CALL(*hashImageMock, open(StrEq(hashBlobId), std::ios::out))
.WillOnce(Return(true));
- EXPECT_TRUE(handler->open(
- 0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi,
- hashBlobId));
+ EXPECT_TRUE(
+ handler->open(0,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::ipmi,
+ hashBlobId));
/* The active hash blob_id was added. */
auto currentBlobs = handler->getBlobIds();
diff --git a/bmc/firmware-handler/test/firmware_commit_unittest.cpp b/bmc/firmware-handler/test/firmware_commit_unittest.cpp
index 8d6bfe2..7eaf718 100644
--- a/bmc/firmware-handler/test/firmware_commit_unittest.cpp
+++ b/bmc/firmware-handler/test/firmware_commit_unittest.cpp
@@ -51,8 +51,11 @@
EXPECT_CALL(*imageMock2, open("asdf", std::ios::out))
.WillOnce(Return(true));
- EXPECT_TRUE(handler->open(
- 0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi, "asdf"));
+ EXPECT_TRUE(
+ handler->open(0,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::ipmi,
+ "asdf"));
EXPECT_FALSE(handler->commit(0, {}));
}
@@ -68,9 +71,11 @@
EXPECT_CALL(*imageMock1, open(StrEq(hashBlobId), std::ios::out))
.WillOnce(Return(true));
- EXPECT_TRUE(handler->open(
- 0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi,
- hashBlobId));
+ EXPECT_TRUE(
+ handler->open(0,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::ipmi,
+ hashBlobId));
EXPECT_FALSE(handler->commit(0, {}));
}
diff --git a/bmc/firmware-handler/test/firmware_json_unittest.cpp b/bmc/firmware-handler/test/firmware_json_unittest.cpp
index 9e562c6..4dde694 100644
--- a/bmc/firmware-handler/test/firmware_json_unittest.cpp
+++ b/bmc/firmware-handler/test/firmware_json_unittest.cpp
@@ -4,6 +4,8 @@
#include <nlohmann/json.hpp>
+#include <filesystem>
+
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -13,7 +15,7 @@
{
using ::testing::IsEmpty;
-static constexpr auto TESTFNAME = "test.json";
+static constexpr auto TESTFNAME = "./test/test.json";
using json = nlohmann::json;
TEST(FirmwareJsonTest, InvalidHandlerType)
{
@@ -617,6 +619,7 @@
TEST(FirmwareJsonTest, BuildFromFile)
{
+ std::filesystem::create_directories("./test/");
std::ofstream testfile;
testfile.open(TESTFNAME, std::ios::out);
auto good = R"(
@@ -642,7 +645,7 @@
testfile << good.dump(4);
testfile.flush();
FirmwareHandlersBuilder b;
- auto h = b.buildHandlerConfigs("./");
+ auto h = b.buildHandlerConfigs("./test/");
EXPECT_EQ(h.size(), 1);
EXPECT_EQ(h[0].blobId, "/flash/image");
EXPECT_FALSE(h[0].handler == nullptr);
@@ -658,12 +661,13 @@
TEST(FirmwareJsonTest, BuildFromBadFile)
{
+ std::filesystem::create_directories("./test/");
std::ofstream testfile;
testfile.open(TESTFNAME, std::ios::out);
testfile << "{] a malformed json {{";
testfile.flush();
FirmwareHandlersBuilder b;
- auto h = b.buildHandlerConfigs("./");
+ auto h = b.buildHandlerConfigs("./test/");
EXPECT_THAT(h, IsEmpty());
if (std::remove(TESTFNAME) != 0)
{
diff --git a/bmc/firmware-handler/test/firmware_multiplebundle_unittest.cpp b/bmc/firmware-handler/test/firmware_multiplebundle_unittest.cpp
index 58f07c7..0a032e8 100644
--- a/bmc/firmware-handler/test/firmware_multiplebundle_unittest.cpp
+++ b/bmc/firmware-handler/test/firmware_multiplebundle_unittest.cpp
@@ -109,8 +109,8 @@
TriggerMock *biosPrepareMockPtr, *biosVerifyMockPtr, *biosUpdateMockPtr;
std::uint16_t session = 1;
- std::uint16_t flags =
- blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi;
+ std::uint16_t flags = static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::ipmi;
};
TEST_F(IpmiOnlyTwoFirmwaresTest, OpeningBiosAfterBlobFails)
diff --git a/bmc/firmware-handler/test/firmware_open_unittest.cpp b/bmc/firmware-handler/test/firmware_open_unittest.cpp
index 2d54c41..19376a3 100644
--- a/bmc/firmware-handler/test/firmware_open_unittest.cpp
+++ b/bmc/firmware-handler/test/firmware_open_unittest.cpp
@@ -42,14 +42,14 @@
0b101 << 8,
0b011 << 8,
/* Next 1 doesn't specify any transport */
- blobs::OpenFlags::write | 0b000 << 8,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) | 0b000 << 8,
/* Next 3 specify 2 reserved transport bits at the same time. This isn't
* allowed because older code expects these first 3 bits to be mutually
* exclusive.
*/
- blobs::OpenFlags::write | 0b110 << 8,
- blobs::OpenFlags::write | 0b101 << 8,
- blobs::OpenFlags::write | 0b011 << 8,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) | 0b110 << 8,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) | 0b101 << 8,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) | 0b011 << 8,
};
INSTANTIATE_TEST_CASE_P(WithFlags, FirmwareOpenFailTest,
diff --git a/bmc/firmware-handler/test/firmware_sessionstat_unittest.cpp b/bmc/firmware-handler/test/firmware_sessionstat_unittest.cpp
index 3753118..6f5aeee 100644
--- a/bmc/firmware-handler/test/firmware_sessionstat_unittest.cpp
+++ b/bmc/firmware-handler/test/firmware_sessionstat_unittest.cpp
@@ -27,8 +27,11 @@
*/
EXPECT_CALL(*imageMock, open("asdf", std::ios::out)).WillOnce(Return(true));
- EXPECT_TRUE(handler->open(
- 0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi, "asdf"));
+ EXPECT_TRUE(
+ handler->open(0,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::ipmi,
+ "asdf"));
int size = 512;
EXPECT_CALL(*imageMock, getSize()).WillOnce(Return(size));
@@ -36,7 +39,8 @@
blobs::BlobMeta meta;
EXPECT_TRUE(handler->stat(0, &meta));
EXPECT_EQ(meta.blobState,
- blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi);
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::ipmi);
EXPECT_EQ(meta.size, size);
EXPECT_EQ(meta.metadata.size(), 0);
}
@@ -50,8 +54,11 @@
EXPECT_CALL(*dataMock, open()).WillOnce(Return(true));
EXPECT_CALL(*imageMock, open("asdf", std::ios::out)).WillOnce(Return(true));
- EXPECT_TRUE(handler->open(
- 0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::lpc, "asdf"));
+ EXPECT_TRUE(
+ handler->open(0,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::lpc,
+ "asdf"));
int size = 512;
EXPECT_CALL(*imageMock, getSize()).WillOnce(Return(size));
@@ -61,7 +68,8 @@
blobs::BlobMeta meta;
EXPECT_TRUE(handler->stat(0, &meta));
EXPECT_EQ(meta.blobState,
- blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::lpc);
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::lpc);
EXPECT_EQ(meta.size, size);
EXPECT_EQ(meta.metadata.size(), mBytes.size());
EXPECT_EQ(meta.metadata[0], mBytes[0]);
diff --git a/bmc/firmware-handler/test/firmware_state_notyetstarted_tarball_unittest.cpp b/bmc/firmware-handler/test/firmware_state_notyetstarted_tarball_unittest.cpp
index 6a39d9d..a7875fa 100644
--- a/bmc/firmware-handler/test/firmware_state_notyetstarted_tarball_unittest.cpp
+++ b/bmc/firmware-handler/test/firmware_state_notyetstarted_tarball_unittest.cpp
@@ -84,8 +84,8 @@
TriggerMock* updateMockPtr;
std::uint16_t session = 1;
- std::uint16_t flags =
- blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi;
+ std::uint16_t flags = static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::ipmi;
};
TEST_F(FirmwareHandlerNotYetStartedUbitTest,
diff --git a/bmc/firmware-handler/test/firmware_state_uploadinprogress_unittest.cpp b/bmc/firmware-handler/test/firmware_state_uploadinprogress_unittest.cpp
index c1a27fe..65c368c 100644
--- a/bmc/firmware-handler/test/firmware_state_uploadinprogress_unittest.cpp
+++ b/bmc/firmware-handler/test/firmware_state_uploadinprogress_unittest.cpp
@@ -122,7 +122,8 @@
blobs::BlobMeta meta, expectedMeta = {};
expectedMeta.size = 32;
expectedMeta.blobState =
- blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi;
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::ipmi;
EXPECT_TRUE(handler->stat(session, &meta));
EXPECT_EQ(expectedMeta, meta);
}
diff --git a/bmc/firmware-handler/test/firmware_unittest.hpp b/bmc/firmware-handler/test/firmware_unittest.hpp
index 0d18bda..53fb58c 100644
--- a/bmc/firmware-handler/test/firmware_unittest.hpp
+++ b/bmc/firmware-handler/test/firmware_unittest.hpp
@@ -188,8 +188,8 @@
TriggerMock* updateMockPtr;
std::uint16_t session = 1;
- std::uint16_t flags =
- blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi;
+ std::uint16_t flags = static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::ipmi;
blobs::BlobMeta expectedIdleMeta = {0xff00, 0, {}};
diff --git a/bmc/firmware-handler/test/firmware_write_unittest.cpp b/bmc/firmware-handler/test/firmware_write_unittest.cpp
index 27899db..da1a371 100644
--- a/bmc/firmware-handler/test/firmware_write_unittest.cpp
+++ b/bmc/firmware-handler/test/firmware_write_unittest.cpp
@@ -31,8 +31,11 @@
/* Verify if data type ipmi, it calls write with the bytes. */
EXPECT_CALL(*imageMock, open("asdf", std::ios::out)).WillOnce(Return(true));
- EXPECT_TRUE(handler->open(
- 0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi, "asdf"));
+ EXPECT_TRUE(
+ handler->open(0,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::ipmi,
+ "asdf"));
std::vector<std::uint8_t> bytes = {0xaa, 0x55};
@@ -46,8 +49,11 @@
EXPECT_CALL(*dataMock, open()).WillOnce(Return(true));
EXPECT_CALL(*imageMock, open("asdf", std::ios::out)).WillOnce(Return(true));
- EXPECT_TRUE(handler->open(
- 0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::lpc, "asdf"));
+ EXPECT_TRUE(
+ handler->open(0,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::lpc,
+ "asdf"));
struct ExtChunkHdr request;
request.length = 4; /* number of bytes to read. */
@@ -69,8 +75,11 @@
EXPECT_CALL(*dataMock, open()).WillOnce(Return(true));
EXPECT_CALL(*imageMock, open("asdf", std::ios::out)).WillOnce(Return(true));
- EXPECT_TRUE(handler->open(
- 0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::lpc, "asdf"));
+ EXPECT_TRUE(
+ handler->open(0,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::lpc,
+ "asdf"));
struct ExtChunkHdr request;
request.length = 4; /* number of bytes to read. */
diff --git a/bmc/firmware-handler/test/firmware_writemeta_unittest.cpp b/bmc/firmware-handler/test/firmware_writemeta_unittest.cpp
index 3d86c0c..bdcc68b 100644
--- a/bmc/firmware-handler/test/firmware_writemeta_unittest.cpp
+++ b/bmc/firmware-handler/test/firmware_writemeta_unittest.cpp
@@ -25,8 +25,11 @@
{
EXPECT_CALL(*imageMock, open("asdf", std::ios::out)).WillOnce(Return(true));
- EXPECT_TRUE(handler->open(
- 0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::ipmi, "asdf"));
+ EXPECT_TRUE(
+ handler->open(0,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::ipmi,
+ "asdf"));
std::vector<std::uint8_t> bytes = {0xaa, 0x55};
@@ -38,8 +41,11 @@
EXPECT_CALL(*dataMock, open()).WillOnce(Return(true));
EXPECT_CALL(*imageMock, open("asdf", std::ios::out)).WillOnce(Return(true));
- EXPECT_TRUE(handler->open(
- 0, blobs::OpenFlags::write | FirmwareFlags::UpdateFlags::lpc, "asdf"));
+ EXPECT_TRUE(
+ handler->open(0,
+ static_cast<std::uint16_t>(blobs::OpenFlags::write) |
+ FirmwareFlags::UpdateFlags::lpc,
+ "asdf"));
std::vector<std::uint8_t> bytes = {0x01, 0x02, 0x03, 0x04};
diff --git a/bmc/version-handler/version_handler.cpp b/bmc/version-handler/version_handler.cpp
index f2ab881..0efdcf7 100644
--- a/bmc/version-handler/version_handler.cpp
+++ b/bmc/version-handler/version_handler.cpp
@@ -82,12 +82,12 @@
/**
* deleteBlob - does nothing, always fails
*/
-bool VersionBlobHandler::deleteBlob(const std::string& path)
+bool VersionBlobHandler::deleteBlob(const std::string&)
{
return false;
}
-bool VersionBlobHandler::stat(const std::string& path, blobs::BlobMeta* meta)
+bool VersionBlobHandler::stat(const std::string&, blobs::BlobMeta*)
{
return false;
}
diff --git a/bmc/version-handler/version_handler.hpp b/bmc/version-handler/version_handler.hpp
index 4a3d7d4..b0b9b52 100644
--- a/bmc/version-handler/version_handler.hpp
+++ b/bmc/version-handler/version_handler.hpp
@@ -49,17 +49,15 @@
const std::string& path) override;
std::vector<uint8_t> read(uint16_t session, uint32_t offset,
uint32_t requestedSize) override;
- bool write(uint16_t session, uint32_t offset,
- const std::vector<uint8_t>& data) override
+ bool write(uint16_t, uint32_t, const std::vector<uint8_t>&) override
{
return false; /* not supported */
};
- bool writeMeta(uint16_t session, uint32_t offset,
- const std::vector<uint8_t>& data) override
+ bool writeMeta(uint16_t, uint32_t, const std::vector<uint8_t>&) override
{
return false; /* not supported */
}
- bool commit(uint16_t session, const std::vector<uint8_t>& data) override
+ bool commit(uint16_t, const std::vector<uint8_t>&) override
{
return false; // not supported
}
diff --git a/cleanup/cleanup.cpp b/cleanup/cleanup.cpp
index baf5053..7f92d87 100644
--- a/cleanup/cleanup.cpp
+++ b/cleanup/cleanup.cpp
@@ -44,8 +44,7 @@
return {supported};
}
-bool FileCleanupHandler::commit(uint16_t session,
- const std::vector<uint8_t>& data)
+bool FileCleanupHandler::commit(uint16_t, const std::vector<uint8_t>&)
{
for (const auto& file : files)
{
diff --git a/cleanup/cleanup.hpp b/cleanup/cleanup.hpp
index 6ee8405..04e2d94 100644
--- a/cleanup/cleanup.hpp
+++ b/cleanup/cleanup.hpp
@@ -37,45 +37,41 @@
bool commit(uint16_t session, const std::vector<uint8_t>& data) override;
/* These methods return true without doing anything. */
- bool open(uint16_t session, uint16_t flags,
- const std::string& path) override
+ bool open(uint16_t, uint16_t, const std::string&) override
{
return true;
}
- bool close(uint16_t session) override
+ bool close(uint16_t) override
{
return true;
}
- bool expire(uint16_t session) override
+ bool expire(uint16_t) override
{
return true;
}
/* These methods are unsupported. */
- bool deleteBlob(const std::string& path) override
+ bool deleteBlob(const std::string&) override
{
return false;
}
- bool stat(const std::string& path, blobs::BlobMeta* meta) override
+ bool stat(const std::string&, blobs::BlobMeta*) override
{
return false;
}
- std::vector<uint8_t> read(uint16_t session, uint32_t offset,
- uint32_t requestedSize) override
+ std::vector<uint8_t> read(uint16_t, uint32_t, uint32_t) override
{
return {};
}
- bool write(uint16_t session, uint32_t offset,
- const std::vector<uint8_t>& data) override
+ bool write(uint16_t, uint32_t, const std::vector<uint8_t>&) override
{
return false;
}
- bool writeMeta(uint16_t session, uint32_t offset,
- const std::vector<uint8_t>& data) override
+ bool writeMeta(uint16_t, uint32_t, const std::vector<uint8_t>&) override
{
return false;
}
- bool stat(uint16_t session, blobs::BlobMeta* meta) override
+ bool stat(uint16_t, blobs::BlobMeta*) override
{
return false;
}
diff --git a/tools/pci.hpp b/tools/pci.hpp
index ae74e9d..33878c8 100644
--- a/tools/pci.hpp
+++ b/tools/pci.hpp
@@ -49,8 +49,7 @@
virtual ~PciAccessBridge();
virtual void write(const stdplus::span<const std::uint8_t> data) override;
- virtual void
- configure(const ipmi_flash::PciConfigResponse& configResp) override{};
+ virtual void configure(const ipmi_flash::PciConfigResponse&) override{};
std::size_t getDataLength() override
{
@@ -102,7 +101,7 @@
static constexpr int bar = 0;
static constexpr struct pci_id_match match
{
- vid, did, PCI_MATCH_ANY, PCI_MATCH_ANY
+ vid, did, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0
};
static constexpr pciaddr_t bridge = 0x04;
@@ -142,7 +141,7 @@
static constexpr int bar = 1;
static constexpr struct pci_id_match match
{
- vid, did, PCI_MATCH_ANY, PCI_MATCH_ANY
+ vid, did, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0
};
static constexpr std::size_t config = 0x0f000;
diff --git a/tools/test/tools_bt_unittest.cpp b/tools/test/tools_bt_unittest.cpp
index a5fab59..2ff5231 100644
--- a/tools/test/tools_bt_unittest.cpp
+++ b/tools/test/tools_bt_unittest.cpp
@@ -57,7 +57,7 @@
EXPECT_CALL(progMock, start(fakeFileSize));
EXPECT_CALL(sysMock, read(fd, NotNull(), _))
- .WillOnce(Invoke([&](int fd, void* buf, std::size_t count) {
+ .WillOnce(Invoke([&](int, void* buf, std::size_t count) {
EXPECT_TRUE(count > bytes.size());
std::memcpy(buf, bytes.data(), bytes.size());
return bytes.size();
@@ -110,7 +110,7 @@
EXPECT_CALL(progMock, start(fakeFileSize));
EXPECT_CALL(sysMock, read(fd, NotNull(), _))
- .WillOnce(Invoke([&](int fd, void* buf, std::size_t count) {
+ .WillOnce(Invoke([&](int, void* buf, std::size_t count) {
EXPECT_TRUE(count > bytes.size());
std::memcpy(buf, bytes.data(), bytes.size());
return bytes.size();
diff --git a/tools/test/tools_lpc_unittest.cpp b/tools/test/tools_lpc_unittest.cpp
index 7699609..b180df5 100644
--- a/tools/test/tools_lpc_unittest.cpp
+++ b/tools/test/tools_lpc_unittest.cpp
@@ -62,7 +62,7 @@
.WillOnce(Return(0));
EXPECT_CALL(ioMock, write(_, data.size(), _))
- .WillOnce(Invoke([&data](const std::size_t, const std::size_t length,
+ .WillOnce(Invoke([&data](const std::size_t, const std::size_t,
const void* const source) {
EXPECT_THAT(std::memcmp(source, data.data(), data.size()), 0);
return true;
diff --git a/tools/test/tools_pci_unittest.cpp b/tools/test/tools_pci_unittest.cpp
index 6906851..ca6b7ab 100644
--- a/tools/test/tools_pci_unittest.cpp
+++ b/tools/test/tools_pci_unittest.cpp
@@ -69,8 +69,7 @@
virtual ~Device() = default;
virtual const struct pci_id_match* getMatch() const = 0;
virtual struct pci_device getDevice() const = 0;
- virtual void expectSetup(PciAccessMock& pciMock,
- const struct pci_device& dev) const {};
+ virtual void expectSetup(PciAccessMock&, const struct pci_device&) const {};
virtual std::unique_ptr<PciBridgeIntf>
getBridge(PciAccess* pci, bool skipBridgeDisable = false) const = 0;
virtual std::string getName() const = 0;
@@ -140,7 +139,7 @@
private:
static constexpr struct pci_id_match match
{
- 0x1050, 0x0750, PCI_MATCH_ANY, PCI_MATCH_ANY
+ 0x1050, 0x0750, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0
};
};
@@ -187,7 +186,7 @@
private:
static constexpr struct pci_id_match match
{
- 0x1a03, 0x2000, PCI_MATCH_ANY, PCI_MATCH_ANY
+ 0x1a03, 0x2000, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0
};
};