diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2017-08-26 11:41:25 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2017-08-26 11:41:25 +0300 |
commit | 5ac7b56bdc8085f6d5e63a8ad694cec355528263 (patch) | |
tree | ba0bee882b8d3445d5d183426e738324af4a7566 /moses | |
parent | eb8979a0e220df14f1d25944cf4995a46bbed3a3 (diff) |
compile error on gcc 7.1.1
Diffstat (limited to 'moses')
-rw-r--r-- | moses/TranslationModel/CompactPT/PhraseTableCreator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/moses/TranslationModel/CompactPT/PhraseTableCreator.cpp b/moses/TranslationModel/CompactPT/PhraseTableCreator.cpp index d590ef9b3..8a4bf7d7e 100644 --- a/moses/TranslationModel/CompactPT/PhraseTableCreator.cpp +++ b/moses/TranslationModel/CompactPT/PhraseTableCreator.cpp @@ -579,10 +579,10 @@ void PhraseTableCreator::EncodeTargetPhraseREnc(std::vector<std::string>& s, if(r < bestRank) { bestRank = r; bestSrcPos = *it; - bestDiff = abs(*it-i); - } else if(r == bestRank && unsigned(abs(*it-i)) < bestDiff) { + bestDiff = abs((long)*it-(long)i); + } else if(r == bestRank && unsigned(abs((long)*it-(long)i)) < bestDiff) { bestSrcPos = *it; - bestDiff = abs(*it-i); + bestDiff = abs((long)*it-(long)i); } } } |