refactor(core): Clean-up

- use "#pragma once" instead of the regular include guard
- fix errors and warnings reported by cppcheck
This commit is contained in:
Michael Carlberg
2016-05-31 05:58:58 +02:00
parent d0499d4d15
commit 39d3f61497
81 changed files with 588 additions and 730 deletions

View File

@ -89,9 +89,10 @@ bool CpuModule::read_values()
std::ifstream in(PATH_CPU_INFO);
std::string str;
while (std::getline(in, str) && str.find("cpu") == 0) {
while (std::getline(in, str) && str.compare(0, 3, "cpu") == 0) {
// skip the accumulated line
if (str.find("cpu ") == 0) continue;
if (str.compare(0, 4, "cpu ") == 0)
continue;
auto values = string::split(str, ' ');
auto cpu = std::make_unique<CpuTime>();