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

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/moses
diff options
context:
space:
mode:
authorJeroen Vermeulen <jtv@precisiontranslationtools.com>2015-03-29 14:10:51 +0300
committerJeroen Vermeulen <jtv@precisiontranslationtools.com>2015-03-29 14:10:51 +0300
commit789a2e2bc32eb94beca02fadcbab0780707a260c (patch)
tree99fbe7d317006856a6706c0ed148fecc6d9704d1 /moses
parent6fa57a1dacdc985ebadc0294805f299856fa7bad (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')
-rw-r--r--moses/FF/WordTranslationFeature.cpp2
-rw-r--r--moses/LM/Ken.cpp4
-rw-r--r--moses/PDTAimp.cpp1
-rw-r--r--moses/Syntax/Cube.cpp4
-rw-r--r--moses/Syntax/F2S/RuleMatcherHyperTree-inl.h5
-rw-r--r--moses/Syntax/S2T/Parsers/Scope3Parser/Parser-inl.h2
-rw-r--r--moses/Syntax/S2T/Parsers/Scope3Parser/TailLatticeSearcher.h2
-rw-r--r--moses/ThreadPool.cpp3
-rw-r--r--moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp2
9 files changed, 12 insertions, 13 deletions
diff --git a/moses/FF/WordTranslationFeature.cpp b/moses/FF/WordTranslationFeature.cpp
index 4c0233885..05883df12 100644
--- a/moses/FF/WordTranslationFeature.cpp
+++ b/moses/FF/WordTranslationFeature.cpp
@@ -22,8 +22,8 @@ WordTranslationFeature::WordTranslationFeature(const std::string &line)
,m_simple(true)
,m_sourceContext(false)
,m_targetContext(false)
- ,m_ignorePunctuation(false)
,m_domainTrigger(false)
+ ,m_ignorePunctuation(false)
{
VERBOSE(1, "Initializing feature " << GetScoreProducerDescription() << " ...");
ReadParameters();
diff --git a/moses/LM/Ken.cpp b/moses/LM/Ken.cpp
index 41cc3e04a..e86275050 100644
--- a/moses/LM/Ken.cpp
+++ b/moses/LM/Ken.cpp
@@ -169,9 +169,9 @@ template <class Model> LanguageModelKen<Model>::LanguageModelKen(const LanguageM
:LanguageModel(copy_from.GetArgLine()),
m_ngram(copy_from.m_ngram),
// TODO: don't copy this.
- m_lmIdLookup(copy_from.m_lmIdLookup),
+ m_beginSentenceFactor(copy_from.m_beginSentenceFactor),
m_factorType(copy_from.m_factorType),
- m_beginSentenceFactor(copy_from.m_beginSentenceFactor)
+ m_lmIdLookup(copy_from.m_lmIdLookup)
{
}
diff --git a/moses/PDTAimp.cpp b/moses/PDTAimp.cpp
index 1b9e789ce..6770a5c17 100644
--- a/moses/PDTAimp.cpp
+++ b/moses/PDTAimp.cpp
@@ -222,7 +222,6 @@ void PDTAimp::CacheSource(ConfusionNet const& src)
TRACE_ERR("\n");
}
- typedef StringTgtCand::Tokens sPhrase;
typedef std::map<StringTgtCand::Tokens,TScores> E2Costs;
std::map<Range,E2Costs> cov2cand;
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];
diff --git a/moses/ThreadPool.cpp b/moses/ThreadPool.cpp
index 1113cef9d..cba459697 100644
--- a/moses/ThreadPool.cpp
+++ b/moses/ThreadPool.cpp
@@ -57,9 +57,8 @@ void ThreadPool::Execute()
if (task) {
// must read from task before run. otherwise task may be deleted by main thread
// race condition
- bool del = task->DeleteAfterExecution();
+ task->DeleteAfterExecution();
task->Run();
- // if (del) delete task; // not needed any more, since we use shared ptrs.
}
m_threadAvailable.notify_all();
} while (!m_stopped);
diff --git a/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp b/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp
index 3ecfe8f19..1ca9dce67 100644
--- a/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp
+++ b/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp
@@ -392,10 +392,10 @@ TO_STRING_BODY(PhraseDictionaryFuzzyMatch);
// friend
ostream& operator<<(ostream& out, const PhraseDictionaryFuzzyMatch& phraseDict)
{
+ /*
typedef PhraseDictionaryNodeMemory::TerminalMap TermMap;
typedef PhraseDictionaryNodeMemory::NonTerminalMap NonTermMap;
- /*
const PhraseDictionaryNodeMemory &coll = phraseDict.m_collection;
for (NonTermMap::const_iterator p = coll.m_nonTermMap.begin(); p != coll.m_nonTermMap.end(); ++p) {
const Word &sourceNonTerm = p->first.first;