Run astyle
Change-Id: Iba20bab3093f15339760d4f782cc6d6e89156ab0
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/argument.cpp b/argument.cpp
index 27c307e..42abd99 100644
--- a/argument.cpp
+++ b/argument.cpp
@@ -22,7 +22,7 @@
ArgumentParser::ArgumentParser(int argc, char** argv)
{
int option = 0;
- while(-1 != (option = getopt_long(argc, argv, optionstr, options, NULL)))
+ while (-1 != (option = getopt_long(argc, argv, optionstr, options, NULL)))
{
if ((option == '?') || (option == 'h'))
{
@@ -31,10 +31,15 @@
}
auto i = &options[0];
- while ((i->val != option) && (i->val != 0)) ++i;
+ while ((i->val != option) && (i->val != 0))
+ {
+ ++i;
+ }
if (i->val)
+ {
arguments[i->name] = (i->has_arg ? optarg : true_string);
+ }
}
}
diff --git a/directory.cpp b/directory.cpp
index 82d4d6a..361688d 100644
--- a/directory.cpp
+++ b/directory.cpp
@@ -39,14 +39,20 @@
bool Directory::next(std::string& name)
{
- if (!dirp) return false;
+ if (!dirp)
+ {
+ return false;
+ }
dirent entry;
dirent* result;
auto rc = readdir_r(dirp, &entry, &result);
- if ((rc) || (NULL == result)) return false;
+ if ((rc) || (NULL == result))
+ {
+ return false;
+ }
name = entry.d_name;
return true;
diff --git a/hwmon.hpp b/hwmon.hpp
index 494d38e..505c625 100644
--- a/hwmon.hpp
+++ b/hwmon.hpp
@@ -5,19 +5,19 @@
namespace hwmon
{
- using namespace std::literals;
+using namespace std::literals;
- namespace entry
- {
- static const std::string input = "input"s;
- }
+namespace entry
+{
+static const std::string input = "input"s;
+}
- namespace type
- {
- static const std::string fan = "fan"s;
- static const std::string temp = "temp"s;
- static const std::string volt = "in"s;
- }
+namespace type
+{
+static const std::string fan = "fan"s;
+static const std::string temp = "temp"s;
+static const std::string volt = "in"s;
+}
}
#endif
diff --git a/readd.cpp b/readd.cpp
index 7d494df..684e447 100644
--- a/readd.cpp
+++ b/readd.cpp
@@ -53,10 +53,10 @@
// ensure the objects all exist?
// Polling loop.
- while(true)
+ while (true)
{
// Iterate through all the sensors.
- for(auto& i : *sensors)
+ for (auto& i : *sensors)
{
if (i.second.find(hwmon::entry::input) != i.second.end())
{
diff --git a/sensorcache.hpp b/sensorcache.hpp
index 64333d8..15a1d7c 100644
--- a/sensorcache.hpp
+++ b/sensorcache.hpp
@@ -7,13 +7,16 @@
{
public:
typedef std::map<std::pair<std::string, std::string>,
- int> container_t;
+ int> container_t;
bool update(const container_t::key_type& k,
const container_t::mapped_type& v)
{
auto& i = container[k];
- if (v == i) return false;
+ if (v == i)
+ {
+ return false;
+ }
else
{
i = v;
diff --git a/sensorset.cpp b/sensorset.cpp
index 9c4a89c..708e3a5 100644
--- a/sensorset.cpp
+++ b/sensorset.cpp
@@ -29,13 +29,16 @@
Directory d(path);
std::string file;
- while(d.next(file))
+ while (d.next(file))
{
std::smatch match;
std::regex_search(file, match, sensors_regex);
- if (match.size() != sensor_regex_match_count) continue;
+ if (match.size() != sensor_regex_match_count)
+ {
+ continue;
+ }
- container[make_pair(match[1],match[2])].emplace(match[3]);
+ container[make_pair(match[1], match[2])].emplace(match[3]);
}
}
diff --git a/sensorset.hpp b/sensorset.hpp
index beb8446..fdd708a 100644
--- a/sensorset.hpp
+++ b/sensorset.hpp
@@ -9,7 +9,7 @@
{
public:
typedef std::map<std::pair<std::string, std::string>,
- std::set<std::string>> container_t;
+ std::set<std::string>> container_t;
SensorSet(const std::string& path);