kopia lustrzana https://gitlab.com/tomaszg/geostat
Minor cppcheck fixes
rodzic
72dc1292da
commit
70d6da5747
|
@ -50,10 +50,10 @@ static std::string string_mangle(const std::string& str) {
|
|||
return tmp;
|
||||
}
|
||||
|
||||
void show_histogram(const pCaches& fcc, std::string Cache::*ptr, const std::string& caption, bool html, bool sort_by_val) {
|
||||
void show_histogram(const pCaches& cc, std::string Cache::*ptr, const std::string& caption, bool html, bool sort_by_val) {
|
||||
std::map<std::string, int> histogram;
|
||||
|
||||
for (auto el : fcc)
|
||||
for (auto el : cc)
|
||||
histogram[el->*ptr]++;
|
||||
|
||||
show_histogram(histogram, caption, html, sort_by_val);
|
||||
|
|
|
@ -440,12 +440,12 @@ int main(int argc, char** argv) {
|
|||
for (int i = y_min; i <= y_max; i++) { // i -> years in rows
|
||||
std::cout << "<tr><th>" << i + 1900 << "</th> ";
|
||||
for (int j = 1; j <= 12; j++) { // j -> months in cols
|
||||
std::map<int, int> dates;
|
||||
std::map<int, int> days_count;
|
||||
for (auto el : cc) {
|
||||
if (el.date_tm.tm_mon == j - 1 && el.date_tm.tm_year == i)
|
||||
dates[el.date_tm.tm_mday]++;
|
||||
days_count[el.date_tm.tm_mday]++;
|
||||
}
|
||||
std::cout << "<td style=\"--percent: " << dates.size() * 100 / max << "%\"><span>" << dates.size() << "</span></td>";
|
||||
std::cout << "<td style=\"--percent: " << days_count.size() * 100 / max << "%\"><span>" << days_count.size() << "</span></td>";
|
||||
}
|
||||
std::cout << "</tr>\n";
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue