Skip to content

Commit

Permalink
Fix a few compiler warnings (clang)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjwilliams committed Nov 27, 2015
1 parent b0e7d30 commit 7375d81
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 35 deletions.
8 changes: 4 additions & 4 deletions moses/BitmapContainer.cpp
Expand Up @@ -57,8 +57,8 @@ class HypothesisScoreOrdererWithDistortion
public:
HypothesisScoreOrdererWithDistortion(const Range* transOptRange,
const bool deterministic = false)
: m_transOptRange(transOptRange)
, m_deterministic(deterministic) {
: m_deterministic(deterministic)
, m_transOptRange(transOptRange) {
m_totalWeightDistortion = 0;
const StaticData &staticData = StaticData::Instance();

Expand Down Expand Up @@ -128,8 +128,8 @@ BackwardsEdge::BackwardsEdge(const BitmapContainer &prevBitmapContainer
, m_parent(parent)
, m_translations(translations)
, m_estimatedScores(estimatedScores)
, m_seenPosition()
, m_deterministic(deterministic)
, m_seenPosition()
{

// If either dimension is empty, we haven't got anything to do.
Expand Down Expand Up @@ -294,8 +294,8 @@ BitmapContainer::BitmapContainer(const Bitmap &bitmap
, bool deterministic)
: m_bitmap(bitmap)
, m_stack(stack)
, m_deterministic(deterministic)
, m_numStackInsertions(0)
, m_deterministic(deterministic)
{
m_hypotheses = HypothesisSet();
m_edges = BackwardsEdgeSet();
Expand Down
1 change: 0 additions & 1 deletion moses/ChartHypothesis.cpp
Expand Up @@ -257,7 +257,6 @@ void ChartHypothesis::CleanupArcList()
* so we'll keep all of arc list if nedd distinct n-best list
*/
AllOptions const& opts = StaticData::Instance().options();
const StaticData &staticData = StaticData::Instance();
size_t nBestSize = opts.nbest.nbest_size;
bool distinctNBest = (opts.nbest.only_distinct
|| opts.mbr.enabled
Expand Down
2 changes: 1 addition & 1 deletion moses/ChartHypothesisCollection.h
Expand Up @@ -29,7 +29,7 @@ namespace Moses
{

class ChartSearchGraphWriter;
class AllOptions;
struct AllOptions;

//! functor to compare (chart) hypotheses by (descending) score
class ChartHypothesisScoreOrderer
Expand Down
2 changes: 1 addition & 1 deletion moses/FF/StatefulFeatureFunction.h
Expand Up @@ -10,7 +10,7 @@ class FFState;

namespace Syntax
{
class SHyperedge;
struct SHyperedge;
}

/** base class for all stateful feature functions.
Expand Down
2 changes: 1 addition & 1 deletion moses/FF/StatelessFeatureFunction.h
Expand Up @@ -8,7 +8,7 @@ namespace Moses

namespace Syntax
{
class SHyperedge;
struct SHyperedge;
}

/** base class for all stateless feature functions.
Expand Down
2 changes: 1 addition & 1 deletion moses/Hypothesis.h
Expand Up @@ -50,7 +50,7 @@ class FFState;
class StatelessFeatureFunction;
class StatefulFeatureFunction;
class Manager;
class ReportingOptions;
struct ReportingOptions;

typedef std::vector<Hypothesis*> ArcList;

Expand Down
2 changes: 0 additions & 2 deletions moses/LM/BilingualLM.cpp
Expand Up @@ -248,8 +248,6 @@ void BilingualLM::getAllAlignments(const ChartHypothesis& cur_hypo, size_t featu
int source_word_mid_idx; //The word alignment

//Get source sent
const ChartManager& manager = cur_hypo.GetManager();
const Sentence& source_sent = static_cast<const Sentence&>(manager.GetSource());
const AlignmentInfo& alignments = targetPhrase.GetAlignTerm();

// get absolute position in source sentence for each source word in rule
Expand Down
4 changes: 2 additions & 2 deletions moses/Search.cpp
Expand Up @@ -10,11 +10,11 @@ namespace Moses
Search::Search(Manager& manager, const InputType &source)
: m_manager(manager)
, m_source(source)
, m_options(manager.options())
, m_inputPath()
, m_initialTransOpt()
, m_options(manager.options())
, interrupted_flag(0)
, m_bitmaps(source.GetSize(), source.m_sourceCompleted)
, interrupted_flag(0)
{
m_initialTransOpt.SetInputPath(m_inputPath);
}
Expand Down
1 change: 0 additions & 1 deletion moses/SearchNormal.cpp
Expand Up @@ -293,7 +293,6 @@ void SearchNormal::ExpandHypothesis(const Hypothesis &hypothesis,
float estimatedScore,
const Bitmap &bitmap)
{
const StaticData &staticData = StaticData::Instance();
SentenceStats &stats = m_manager.GetSentenceStats();

Hypothesis *newHypo;
Expand Down
1 change: 0 additions & 1 deletion moses/Sentence.cpp
Expand Up @@ -324,7 +324,6 @@ std::vector <ChartTranslationOptions*>
Sentence::
GetXmlChartTranslationOptions(AllOptions const& opts) const
{
const StaticData &staticData = StaticData::Instance();
std::vector <ChartTranslationOptions*> ret;

// XML Options
Expand Down
7 changes: 0 additions & 7 deletions moses/Syntax/F2S/HyperPathLoader.cpp
Expand Up @@ -9,13 +9,6 @@ namespace Syntax
namespace F2S
{

HyperPathLoader::HyperPathLoader(FactorDirection direction,
const std::vector<FactorType> &factorOrder)
: m_direction(direction)
, m_factorOrder(factorOrder)
{
}

void HyperPathLoader::Load(const StringPiece &s, HyperPath &path)
{
path.nodeSeqs.clear();
Expand Down
4 changes: 0 additions & 4 deletions moses/Syntax/F2S/HyperPathLoader.h
Expand Up @@ -30,8 +30,6 @@ namespace F2S
class HyperPathLoader
{
public:
HyperPathLoader(FactorDirection, const std::vector<FactorType> &);

void Load(const StringPiece &, HyperPath &);

private:
Expand All @@ -58,8 +56,6 @@ class HyperPathLoader
return FactorCollection::Instance().AddFactor(s, true);
}

FactorDirection m_direction;
const std::vector<FactorType> &m_factorOrder;
std::vector<TreeFragmentToken> m_tokenSeq;
std::vector<NodeTuple> m_nodeTupleSeq;
std::stack<int> m_parentStack;
Expand Down
6 changes: 2 additions & 4 deletions moses/Syntax/F2S/HyperTreeLoader.cpp
Expand Up @@ -60,7 +60,7 @@ bool HyperTreeLoader::Load(const std::vector<FactorType> &input,

double_conversion::StringToDoubleConverter converter(double_conversion::StringToDoubleConverter::NO_FLAGS, NAN, NAN, "inf", "nan");

HyperPathLoader hyperPathLoader(Input, input);
HyperPathLoader hyperPathLoader;

Phrase dummySourcePhrase;
{
Expand All @@ -87,9 +87,7 @@ bool HyperTreeLoader::Load(const std::vector<FactorType> &input,
alignString = temp;
}

if (++pipes) {
StringPiece str(*pipes); //counts
}
++pipes; // counts

scoreVector.clear();
for (util::TokenIter<util::AnyCharacter, true> s(scoreString, " \t"); s; ++s) {
Expand Down
4 changes: 1 addition & 3 deletions moses/Syntax/T2S/RuleTrieLoader.cpp
Expand Up @@ -77,9 +77,7 @@ bool RuleTrieLoader::Load(const std::vector<FactorType> &input,
alignString = temp;
}

if (++pipes) {
StringPiece str(*pipes); //counts
}
++pipes; // counts

bool isLHSEmpty = (sourcePhraseString.find_first_not_of(" \t", 0) == std::string::npos);
if (isLHSEmpty && !staticData.IsWordDeletionEnabled()) {
Expand Down
2 changes: 1 addition & 1 deletion moses/TargetPhrase.cpp
Expand Up @@ -135,8 +135,8 @@ TargetPhrase::TargetPhrase(const TargetPhrase &copy)
, m_scoreBreakdown(copy.m_scoreBreakdown)
, m_alignTerm(copy.m_alignTerm)
, m_alignNonTerm(copy.m_alignNonTerm)
, m_properties(copy.m_properties)
, m_scope(copy.m_scope)
, m_properties(copy.m_properties)
, m_container(copy.m_container)
{
if (copy.m_lhsTarget) {
Expand Down
1 change: 0 additions & 1 deletion moses/TranslationOptionCollection.cpp
Expand Up @@ -173,7 +173,6 @@ TranslationOptionCollection::
ProcessOneUnknownWord(const InputPath &inputPath, size_t sourcePos,
size_t length, const ScorePair *inputScores)
{
const StaticData &staticData = StaticData::Instance();
const UnknownWordPenaltyProducer&
unknownWordPenaltyProducer = UnknownWordPenaltyProducer::Instance();
float unknownScore = FloorScore(TransformScore(0));
Expand Down

0 comments on commit 7375d81

Please sign in to comment.