drop struct keyword for non-packed objects
As a style decision, struct is often used with packed structures to
indicate they are used like C-structs. Cleanup this codebase to not use
the extra struct keyword throughout.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I2f83bb1989e4d1f2f843ba3e45fb82e04f0fa61c
diff --git a/sensors/builder.cpp b/sensors/builder.cpp
index de7e020..f4257ad 100644
--- a/sensors/builder.cpp
+++ b/sensors/builder.cpp
@@ -43,7 +43,7 @@
static constexpr bool deferSignals = true;
SensorManager
- buildSensors(const std::map<std::string, struct conf::SensorConfig>& config,
+ buildSensors(const std::map<std::string, conf::SensorConfig>& config,
sdbusplus::bus::bus& passive, sdbusplus::bus::bus& host)
{
SensorManager mgmr(passive, host);
@@ -56,7 +56,7 @@
std::unique_ptr<WriteInterface> wi;
std::string name = it.first;
- const struct conf::SensorConfig* info = &it.second;
+ const conf::SensorConfig* info = &it.second;
std::cerr << "Sensor: " << name << " " << info->type << " ";
std::cerr << info->readPath << " " << info->writePath << "\n";
diff --git a/sensors/builder.hpp b/sensors/builder.hpp
index bea3bd0..955307a 100644
--- a/sensors/builder.hpp
+++ b/sensors/builder.hpp
@@ -16,7 +16,7 @@
* Build the sensors and associate them with a SensorManager.
*/
SensorManager
- buildSensors(const std::map<std::string, struct conf::SensorConfig>& config,
+ buildSensors(const std::map<std::string, conf::SensorConfig>& config,
sdbusplus::bus::bus& passive, sdbusplus::bus::bus& host);
} // namespace pid_control
diff --git a/sensors/buildjson.cpp b/sensors/buildjson.cpp
index 2bfc143..c320fe1 100644
--- a/sensors/buildjson.cpp
+++ b/sensors/buildjson.cpp
@@ -99,10 +99,9 @@
}
} // namespace conf
-std::map<std::string, struct conf::SensorConfig>
- buildSensorsFromJson(const json& data)
+std::map<std::string, conf::SensorConfig> buildSensorsFromJson(const json& data)
{
- std::map<std::string, struct conf::SensorConfig> config;
+ std::map<std::string, conf::SensorConfig> config;
auto sensors = data["sensors"];
/* TODO: If no sensors, this is invalid, and we should except here or during
@@ -110,7 +109,7 @@
*/
for (const auto& sensor : sensors)
{
- config[sensor["name"]] = sensor.get<struct conf::SensorConfig>();
+ config[sensor["name"]] = sensor.get<conf::SensorConfig>();
}
return config;
diff --git a/sensors/buildjson.hpp b/sensors/buildjson.hpp
index ee82381..2075d30 100644
--- a/sensors/buildjson.hpp
+++ b/sensors/buildjson.hpp
@@ -20,7 +20,7 @@
* @param[in] data - the json data
* @return a map of sensors.
*/
-std::map<std::string, struct conf::SensorConfig>
+std::map<std::string, conf::SensorConfig>
buildSensorsFromJson(const json& data);
} // namespace pid_control
diff --git a/sensors/host.cpp b/sensors/host.cpp
index e05ac37..53f114e 100644
--- a/sensors/host.cpp
+++ b/sensors/host.cpp
@@ -86,7 +86,7 @@
std::lock_guard<std::mutex> guard(_lock);
/* This doesn't sanity check anything, that's the caller's job. */
- struct ReadReturn r = {_value, _updated};
+ ReadReturn r = {_value, _updated};
return r;
}