cleanup: Reformat with clang
Also update required meson version to support
`get_variable` and remove deprecated get_pkgconfig_variable.
Change-Id: I1a0d5a9fce077d546cf56078b63c49ee52f1a816
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/entity_name.cpp b/entity_name.cpp
index 854b1dc..5ded4a0 100644
--- a/entity_name.cpp
+++ b/entity_name.cpp
@@ -82,7 +82,7 @@
reply.reserve(entityName.length() + sizeof(struct GetEntityNameReply));
reply.emplace_back(entityName.length()); /* entityNameLength */
reply.insert(reply.end(), entityName.begin(),
- entityName.end()); /* entityName */
+ entityName.end()); /* entityName */
return ::ipmi::responseSuccess(SysOEMCommands::SysEntityName, reply);
}
diff --git a/machine_name.cpp b/machine_name.cpp
index d17a592..4946cd6 100644
--- a/machine_name.cpp
+++ b/machine_name.cpp
@@ -57,7 +57,7 @@
reply.reserve(len);
reply.emplace_back(machineName->size()); /* machineNameLength */
reply.insert(reply.end(), machineName->begin(),
- machineName->end()); /* machineName */
+ machineName->end()); /* machineName */
return ::ipmi::responseSuccess(SysOEMCommands::SysMachineName, reply);
}
diff --git a/meson.build b/meson.build
index 578638b..e6c407d 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@
'google-ipmi-sys',
'cpp',
version: '0.1',
- meson_version: '>=0.57.0',
+ meson_version: '>=0.63.0',
default_options: [
'cpp_std=c++20',
'warning_level=3',
@@ -106,5 +106,5 @@
'gbmc-psu-hardreset.target',
'gbmc-psu-hardreset-pre.target',
'gbmc-psu-hardreset-time.service',
- install_dir: systemd_dep.get_variable(pkgconfig: 'systemdsystemunitdir'))
+ install_dir: systemd_dep.get_variable('systemdsystemunitdir'))
endif
diff --git a/pcie_bifurcation.cpp b/pcie_bifurcation.cpp
index 71c25cd..faa6bd9 100644
--- a/pcie_bifurcation.cpp
+++ b/pcie_bifurcation.cpp
@@ -66,7 +66,7 @@
reply.reserve(bifurcation.size() + sizeof(struct PcieBifurcationReply));
reply.emplace_back(bifurcation.size()); /* bifurcationLength */
reply.insert(reply.end(), bifurcation.begin(),
- bifurcation.end()); /* bifurcation */
+ bifurcation.end()); /* bifurcation */
return ::ipmi::responseSuccess(SysOEMCommands::SysPCIeSlotBifurcation,
reply);
diff --git a/pcie_i2c.cpp b/pcie_i2c.cpp
index 2c7af4d..8a8b839 100644
--- a/pcie_i2c.cpp
+++ b/pcie_i2c.cpp
@@ -102,7 +102,7 @@
reply.emplace_back(i2c_bus_number); /* i2c_bus_number */
reply.emplace_back(pcie_slot_name.length()); /* pcie_slot_name length */
reply.insert(reply.end(), pcie_slot_name.begin(),
- pcie_slot_name.end()); /* pcie_slot_name */
+ pcie_slot_name.end()); /* pcie_slot_name */
return ::ipmi::responseSuccess(SysOEMCommands::SysPcieSlotI2cBusMapping,
reply);
diff --git a/test/handler_unittest.cpp b/test/handler_unittest.cpp
index 5af16ad..a95d1df 100644
--- a/test/handler_unittest.cpp
+++ b/test/handler_unittest.cpp
@@ -205,11 +205,11 @@
StrEq("GetManagedObjects")))
.WillOnce(DoAll(SetArgPointee<1>(method), Return(0)));
- EXPECT_CALL(mock, sd_bus_call(_, // sd_bus *bus,
- method, // sd_bus_message *m
- _, // uint64_t timeout
- NotNull(), // sd_bus_error *ret_error
- NotNull())) // sd_bus_message **reply
+ EXPECT_CALL(mock, sd_bus_call(_, // sd_bus *bus,
+ method, // sd_bus_message *m
+ _, // uint64_t timeout
+ NotNull(), // sd_bus_error *ret_error
+ NotNull())) // sd_bus_message **reply
.WillOnce(DoAll(SetArgPointee<3>(SD_BUS_ERROR_NULL),
SetArgPointee<4>(msg), // reply
Return(0)));
@@ -395,11 +395,11 @@
Pointee(Eq<uint64_t>(num_bytes))))))
.WillOnce(Return(1));
- EXPECT_CALL(mock, sd_bus_call(_, // sd_bus *bus,
- method, // sd_bus_message *m
- _, // uint64_t timeout
- NotNull(), // sd_bus_error *ret_error
- NotNull())) // sd_bus_message **reply
+ EXPECT_CALL(mock, sd_bus_call(_, // sd_bus *bus,
+ method, // sd_bus_message *m
+ _, // uint64_t timeout
+ NotNull(), // sd_bus_error *ret_error
+ NotNull())) // sd_bus_message **reply
.WillOnce(DoAll(SetArgPointee<3>(SD_BUS_ERROR_NULL),
SetArgPointee<4>(msg), // reply
Return(sd_bus_call_return_value)));
@@ -420,7 +420,7 @@
EXPECT_CALL(mock, sd_bus_message_at_end(msg, 0))
.WillOnce(Return(0));
- const uint8_t byte = (data >> (8 * i)) & 0xff;
+ const uint8_t byte = (i >= 8) ? 0 : (data >> (8 * i)) & 0xff;
EXPECT_CALL(mock, sd_bus_message_read_basic(msg, SD_BUS_TYPE_BYTE,
NotNull()))
.WillOnce(DoAll(AssignReadVal<uint8_t>(byte), Return(1)));