diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2022-08-19 17:34:12 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2022-08-19 17:34:55 +0200 |
commit | 2effe9775db423d61d8a2bdd15c40e6015bac6f5 (patch) | |
tree | c39246dbbd85c66987dd8c2c071648f2da7eaede /src/dal | |
parent | 109b602701578b9f2b29282f84bf2757544f8d32 (diff) | |
download | manaserv-2effe9775db423d61d8a2bdd15c40e6015bac6f5.tar.gz manaserv-2effe9775db423d61d8a2bdd15c40e6015bac6f5.tar.bz2 manaserv-2effe9775db423d61d8a2bdd15c40e6015bac6f5.tar.xz manaserv-2effe9775db423d61d8a2bdd15c40e6015bac6f5.zip |
Apply C++11 fixits
modernize-loop-convert
modernize-deprecated-headers
Diffstat (limited to 'src/dal')
-rw-r--r-- | src/dal/recordset.cpp | 21 | ||||
-rw-r--r-- | src/dal/sqlitedataprovider.cpp | 2 |
2 files changed, 6 insertions, 17 deletions
diff --git a/src/dal/recordset.cpp b/src/dal/recordset.cpp index 49c245cd..69104933 100644 --- a/src/dal/recordset.cpp +++ b/src/dal/recordset.cpp @@ -161,27 +161,16 @@ std::ostream &operator<<(std::ostream &out, const RecordSet &rhs) // print the field names first. if (rhs.mHeaders.size() > 0) { out << "|"; - for (auto it = rhs.mHeaders.begin(); - it != rhs.mHeaders.end(); - ++it) - { - out << (*it) << "|"; - } + for (const auto &header : rhs.mHeaders) + out << header << "|"; out << std::endl << std::endl; } // and then print every line. - for (auto it = rhs.mRows.begin(); - it != rhs.mRows.end(); - ++it) - { + for (const auto &row : rhs.mRows) { out << "|"; - for (auto it2 = (*it).begin(); - it2 != (*it).end(); - ++it2) - { - out << (*it2) << "|"; - } + for (const auto &element : row) + out << element << "|"; out << std::endl; } diff --git a/src/dal/sqlitedataprovider.cpp b/src/dal/sqlitedataprovider.cpp index 4aa7eca0..787088d1 100644 --- a/src/dal/sqlitedataprovider.cpp +++ b/src/dal/sqlitedataprovider.cpp @@ -26,7 +26,7 @@ #include "utils/logger.h" #include <stdexcept> -#include <limits.h> +#include <climits> // sqlite3_int64 is the preferred new datatype for 64-bit int values. // see: http://www.sqlite.org/capi3ref.html#sqlite3_int64 |