Fixed sign conversion warnings in catch_reporter_console

This commit is contained in:
wmbat 2023-12-05 20:03:37 -05:00
parent 0520ff4436
commit ef2202b41b

View File

@ -297,7 +297,7 @@ class TablePrinter {
std::ostream& m_os; std::ostream& m_os;
std::vector<ColumnInfo> m_columnInfos; std::vector<ColumnInfo> m_columnInfos;
ReusableStringStream m_oss; ReusableStringStream m_oss;
int m_currentColumn = -1; std::size_t m_currentColumn = 0;
bool m_isOpen = false; bool m_isOpen = false;
public: public:
@ -345,11 +345,10 @@ public:
const auto strSize = colStr.size(); const auto strSize = colStr.size();
tp.m_oss.str(""); tp.m_oss.str("");
tp.open(); tp.open();
if (tp.m_currentColumn == static_cast<int>(tp.m_columnInfos.size() - 1)) { if (tp.m_currentColumn == tp.m_columnInfos.size()) {
tp.m_currentColumn = -1; tp.m_currentColumn = 0;
tp.m_os << '\n'; tp.m_os << '\n';
} }
tp.m_currentColumn++;
auto colInfo = tp.m_columnInfos[tp.m_currentColumn]; auto colInfo = tp.m_columnInfos[tp.m_currentColumn];
auto padding = (strSize + 1 < colInfo.width) auto padding = (strSize + 1 < colInfo.width)
@ -365,7 +364,7 @@ public:
friend TablePrinter& operator<< (TablePrinter& tp, RowBreak) { friend TablePrinter& operator<< (TablePrinter& tp, RowBreak) {
if (tp.m_currentColumn > 0) { if (tp.m_currentColumn > 0) {
tp.m_os << '\n'; tp.m_os << '\n';
tp.m_currentColumn = -1; tp.m_currentColumn = 0;
} }
return tp; return tp;
} }