diff options
author | Jeroen Vermeulen <jtv@precisiontranslationtools.com> | 2015-03-29 14:10:51 +0300 |
---|---|---|
committer | Jeroen Vermeulen <jtv@precisiontranslationtools.com> | 2015-03-29 14:10:51 +0300 |
commit | 789a2e2bc32eb94beca02fadcbab0780707a260c (patch) | |
tree | 99fbe7d317006856a6706c0ed148fecc6d9704d1 /moses/Syntax | |
parent | 6fa57a1dacdc985ebadc0294805f299856fa7bad (diff) |
Fix some compile warnings (gcc 4.9.2).
Mostly signed/unsigned comparisons and reordered member
initializations; also a few unused variables.
There are more, but if I chip away at them for a while, who knows, it
may catch on and warnings may eventually become socially stigmatizing.
:)
Diffstat (limited to 'moses/Syntax')
-rw-r--r-- | moses/Syntax/Cube.cpp | 4 | ||||
-rw-r--r-- | moses/Syntax/F2S/RuleMatcherHyperTree-inl.h | 5 | ||||
-rw-r--r-- | moses/Syntax/S2T/Parsers/Scope3Parser/Parser-inl.h | 2 | ||||
-rw-r--r-- | moses/Syntax/S2T/Parsers/Scope3Parser/TailLatticeSearcher.h | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/moses/Syntax/Cube.cpp b/moses/Syntax/Cube.cpp index 0249291d3..6cbf72903 100644 --- a/moses/Syntax/Cube.cpp +++ b/moses/Syntax/Cube.cpp @@ -56,7 +56,7 @@ void Cube::CreateNeighbours(const std::vector<int> &coordinates) // Create each neighbour along the vertex stack dimensions. for (std::size_t i = 0; i < coordinates.size()-1; ++i) { - int x = coordinates[i]; + const std::size_t x = coordinates[i]; if (m_bundle.stacks[i]->size() > x+1) { ++tmpCoordinates[i]; CreateNeighbour(tmpCoordinates); @@ -64,7 +64,7 @@ void Cube::CreateNeighbours(const std::vector<int> &coordinates) } } // Create the neighbour along the translation dimension. - int x = coordinates.back(); + const std::size_t x = coordinates.back(); if (m_bundle.translations->GetSize() > x+1) { ++tmpCoordinates.back(); CreateNeighbour(tmpCoordinates); diff --git a/moses/Syntax/F2S/RuleMatcherHyperTree-inl.h b/moses/Syntax/F2S/RuleMatcherHyperTree-inl.h index d7ce2cf7c..74f2347a6 100644 --- a/moses/Syntax/F2S/RuleMatcherHyperTree-inl.h +++ b/moses/Syntax/F2S/RuleMatcherHyperTree-inl.h @@ -190,8 +190,9 @@ int RuleMatcherHyperTree<Callback>::SubSeqLength(const HyperPath::NodeSeq &seq, int pos) { int length = 0; - while (pos != seq.size() && seq[pos] != HyperPath::kComma) { - ++pos; + HyperPath::NodeSeq::size_type curpos = pos; + while (curpos != seq.size() && seq[curpos] != HyperPath::kComma) { + ++curpos; ++length; } return length; diff --git a/moses/Syntax/S2T/Parsers/Scope3Parser/Parser-inl.h b/moses/Syntax/S2T/Parsers/Scope3Parser/Parser-inl.h index f50cee3a0..24135c734 100644 --- a/moses/Syntax/S2T/Parsers/Scope3Parser/Parser-inl.h +++ b/moses/Syntax/S2T/Parsers/Scope3Parser/Parser-inl.h @@ -163,7 +163,7 @@ void Scope3Parser<Callback>::RecordPatternApplicationSpans( for (int j = std::max(e1, i+minSpan-1); j <= e2; ++j) { std::size_t span = j-i+1; assert(span >= 1); - if (span < minSpan) { + if (span < std::size_t(minSpan)) { continue; } if (m_maxChartSpan && span > m_maxChartSpan) { diff --git a/moses/Syntax/S2T/Parsers/Scope3Parser/TailLatticeSearcher.h b/moses/Syntax/S2T/Parsers/Scope3Parser/TailLatticeSearcher.h index 4e48429ab..4f815c78d 100644 --- a/moses/Syntax/S2T/Parsers/Scope3Parser/TailLatticeSearcher.h +++ b/moses/Syntax/S2T/Parsers/Scope3Parser/TailLatticeSearcher.h @@ -58,7 +58,7 @@ private: const int absStart = m_ranges[0].minStart + offset; const int minWidth = std::max(1, range.minEnd - absStart + 1); - const int maxWidth = range.maxEnd - absStart + 1; + const std::size_t maxWidth = range.maxEnd - absStart + 1; const std::vector<std::vector<const PVertex *> > &innerVec = m_lattice[offset][nonTermIndex+1]; |