[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 6bfd541 1/3: Explicitly qualify std::size_t i
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 6bfd541 1/3: Explicitly qualify std::size_t if it must be used at all |
Date: |
Sun, 17 Jun 2018 20:08:36 -0400 (EDT) |
branch: master
commit 6bfd5415f5f209cbe9a59dcf307b847e323bbafc
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Explicitly qualify std::size_t if it must be used at all
---
input_sequence_entry.cpp | 2 +-
ledger_pdf_generator_wx.cpp | 6 +++---
main_wx_test.cpp | 5 ++---
wx_test_calculation_summary.cpp | 8 ++++----
4 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/input_sequence_entry.cpp b/input_sequence_entry.cpp
index 062dcfc..7d53d04 100644
--- a/input_sequence_entry.cpp
+++ b/input_sequence_entry.cpp
@@ -789,7 +789,7 @@ void InputSequenceEditor::set_tab_order()
order.push_back(get_field_win(Col_Add, row));
}
- for(size_t i = 1; i < order.size(); ++i)
+ for(int i = 1; i < lmi::ssize(order); ++i)
{
order[i]->MoveAfterInTabOrder(order[i - 1]);
}
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 50ab650..cb5e59b 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -776,7 +776,7 @@ class pdf_illustration : protected html_interpolator
html_interpolator const& get_interpolator() const {return *this;}
// Helper for abbreviating a string to at most the given length (in bytes).
- static std::string abbreviate_if_necessary(std::string s, size_t len)
+ static std::string abbreviate_if_necessary(std::string s, std::size_t len)
{
if(len < s.length() && 3 < len)
{
@@ -790,7 +790,7 @@ class pdf_illustration : protected html_interpolator
// variables have the name based on the name of the original variable with
// "Abbrev" and "len" appended to it and their value is at most "len" bytes
// long.
- void add_abbreviated_variable(std::string const& var, size_t len)
+ void add_abbreviated_variable(std::string const& var, std::size_t len)
{
add_variable
(var + "Abbrev" + std::to_string(len)
@@ -852,7 +852,7 @@ class pdf_illustration : protected html_interpolator
,!invar.ContractNumber.empty()
);
- size_t const full_abbrev_length = 30;
+ std::size_t const full_abbrev_length = 30;
add_abbreviated_variable("MasterContractNumber", full_abbrev_length);
add_abbreviated_variable("MasterContractNumber", full_abbrev_length /
2);
add_abbreviated_variable("ContractNumber", full_abbrev_length);
diff --git a/main_wx_test.cpp b/main_wx_test.cpp
index 191c937..ebbd00e 100644
--- a/main_wx_test.cpp
+++ b/main_wx_test.cpp
@@ -23,6 +23,7 @@
#include "alert.hpp"
#include "assert_lmi.hpp"
+#include "bourn_cast.hpp"
#include "docmanager_ex.hpp"
#include "force_linking.hpp"
#include "handle_exceptions.hpp" // stealth_exception
@@ -586,17 +587,15 @@ wxWindow* wx_test_focus_controller_child(MvcController&
dialog, char const* name
{
// We found the notebook, now we can use it to make the page
// containing the target window current.
- for(size_t n = 0; n < book->GetPageCount(); ++n)
+ for(int n = 0; n < bourn_cast<int>(book->GetPageCount()); ++n)
{
if(book->GetPage(n) == maybe_page)
{
book->SetSelection(n);
wxYield();
-
break;
}
}
-
break;
}
diff --git a/wx_test_calculation_summary.cpp b/wx_test_calculation_summary.cpp
index 0bf1cde..d0f9822 100644
--- a/wx_test_calculation_summary.cpp
+++ b/wx_test_calculation_summary.cpp
@@ -201,7 +201,7 @@ void check_calculation_summary_columns
ill.close();
// Find the start of the table after the separating line.
- size_t pos = html.find("<hr>\n<table");
+ std::size_t pos = html.find("<hr>\n<table");
LMI_ASSERT(pos != wxString::npos);
pos = html.find("\n<td", pos);
@@ -215,12 +215,12 @@ void check_calculation_summary_columns
{
LMI_ASSERT_EQUAL(wxString(html, pos, 3), "<td");
- pos = html.find(">", pos); // end of the <td> tag
+ pos = html.find(">", pos); // end of the <td> tag
LMI_ASSERT(pos != wxString::npos);
- ++pos; // <td> tag contents
+ ++pos; // <td> tag contents
- size_t const next = html.find("\n", pos); // the next line start
+ std::size_t const next = html.find("\n", pos); // the next line start
LMI_ASSERT(next != wxString::npos);
// Extract the column title from the rest of the line.