Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorMaksim Andrianov <maksimandrianov1@gmail.com>2018-06-21 15:49:50 +0300
committerMaksim Andrianov <maksimandrianov1@gmail.com>2018-06-25 17:56:31 +0300
commit036be1ebad980f832fd01ba42b5a7c2ca16d8f1e (patch)
treee81c5d6f73501b0b76a8c65323b6353bb152d6be /base
parentcecc0650d3fad90441c5b7586ff6f0ce46f3ac5e (diff)
Fixed warn: comparison between signed and unsigned integer expressions
Diffstat (limited to 'base')
-rw-r--r--base/base_tests/stl_helpers_test.cpp4
-rw-r--r--base/levenshtein_dfa.cpp5
2 files changed, 6 insertions, 3 deletions
diff --git a/base/base_tests/stl_helpers_test.cpp b/base/base_tests/stl_helpers_test.cpp
index 424007c40f..59f8315455 100644
--- a/base/base_tests/stl_helpers_test.cpp
+++ b/base/base_tests/stl_helpers_test.cpp
@@ -91,7 +91,7 @@ UNIT_TEST(LessBy)
std::vector<Value> v = {{2, 2}, {0, 4}, {3, 1}, {4, 0}, {1, 3}};
std::sort(v.begin(), v.end(), my::LessBy(&Value::first));
- for (size_t i = 0; i < v.size(); ++i)
+ for (int i = 0; i < static_cast<int>(v.size()); ++i)
TEST_EQUAL(i, v[i].first, ());
std::vector<Value const *> pv;
@@ -99,7 +99,7 @@ UNIT_TEST(LessBy)
pv.push_back(&p);
std::sort(pv.begin(), pv.end(), my::LessBy(&Value::second));
- for (size_t i = 0; i < pv.size(); ++i)
+ for (int i = 0; i < static_cast<int>(pv.size()); ++i)
TEST_EQUAL(i, pv[i]->second, ());
}
diff --git a/base/levenshtein_dfa.cpp b/base/levenshtein_dfa.cpp
index 9c0b09b00c..82da404b61 100644
--- a/base/levenshtein_dfa.cpp
+++ b/base/levenshtein_dfa.cpp
@@ -8,6 +8,7 @@
#include <set>
#include <sstream>
#include <vector>
+#include <iterator>
namespace strings
{
@@ -200,7 +201,9 @@ LevenshteinDFA::LevenshteinDFA(UniString const & s, size_t prefixSize,
m_alphabet.assign(s.begin(), s.end());
CHECK_LESS_OR_EQUAL(prefixSize, s.size(), ());
- for (auto it = s.begin(); std::distance(it, s.begin()) < prefixSize; ++it)
+ auto pSize = static_cast<typename std::iterator_traits<
+ UniString::iterator>::difference_type>(prefixSize);
+ for (auto it = s.begin(); std::distance(it, s.begin()) < pSize; ++it)
{
for (auto const & misprints : prefixMisprints)
{