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-28 16:09:03 +0300
committerJeroen Vermeulen <jtv@precisiontranslationtools.com>2015-03-28 16:09:03 +0300
commita9c8f4489662efcf8825f6bb1a3a8b61c44e7f93 (patch)
treef3d25bb5ef4fbd17343327e02053dd640a5c1fa6 /moses
parent9852a0c2ffcac0f7ad93d249f3b9ecd0c5fcf3f9 (diff)
Modernize "C" includes in moses.
This is one of those little chores in managing a long-lived C++ project: standard C headers like stdio.h and math.h now have their own place in the C++ standard as resp. cstdio, cmath, and so on. In this branch the #include names are updated for the moses/ subdirectory; more branches to follow. C++11 adds cstdint, but to support compilation with the previous standard, that change is left for later.
Diffstat (limited to 'moses')
-rw-r--r--moses/ChartManager.cpp2
-rw-r--r--moses/FF/ExternalFeature.cpp2
-rw-r--r--moses/FF/SoftSourceSyntacticConstraintsFeature.cpp2
-rw-r--r--moses/FF/SourceGHKMTreeInputMatchFeature.cpp2
-rw-r--r--moses/LM/Ken.cpp2
-rw-r--r--moses/LM/Remote.cpp4
-rw-r--r--moses/PP/CountsPhraseProperty.cpp2
-rw-r--r--moses/PP/NonTermContextProperty.cpp2
-rw-r--r--moses/PP/SourceLabelsPhraseProperty.cpp2
-rw-r--r--moses/SentenceStats.h2
-rw-r--r--moses/Syntax/F2S/HyperTreeLoader.cpp2
-rw-r--r--moses/Syntax/S2T/RuleTrieLoader.cpp4
-rw-r--r--moses/TargetPhrase.cpp2
-rw-r--r--moses/TranslationModel/CompactPT/BlockHashIndex.h2
-rw-r--r--moses/TranslationModel/CompactPT/MurmurHash3.cpp2
-rw-r--r--moses/TranslationModel/DynSAInclude/FileHandler.cpp2
-rw-r--r--moses/TranslationModel/PhraseDictionary.h2
-rw-r--r--moses/TranslationModel/PhraseDictionaryTransliteration.cpp2
-rw-r--r--moses/TranslationModel/ProbingPT/huffmanish.hh2
-rw-r--r--moses/TranslationModel/ProbingPT/line_splitter.hh2
-rw-r--r--moses/TranslationModel/ProbingPT/storing.hh2
-rw-r--r--moses/TranslationModel/RuleTable/LoaderStandard.cpp2
-rw-r--r--moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp10
-rw-r--r--moses/TranslationModel/UG/mm/tpt_tightindex.cc2
-rw-r--r--moses/TranslationModel/UG/mm/tpt_tokenindex.cc2
-rw-r--r--moses/TranslationModel/UG/mmsapt.h2
-rw-r--r--moses/TranslationModel/fuzzy-match/Vocabulary.h4
-rw-r--r--moses/Util.cpp2
-rw-r--r--moses/mbr.cpp6
29 files changed, 38 insertions, 38 deletions
diff --git a/moses/ChartManager.cpp b/moses/ChartManager.cpp
index aa550e48b..d6846d6df 100644
--- a/moses/ChartManager.cpp
+++ b/moses/ChartManager.cpp
@@ -19,7 +19,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
-#include <stdio.h>
+#include <cstdio>
#include "ChartManager.h"
#include "ChartCell.h"
#include "ChartHypothesis.h"
diff --git a/moses/FF/ExternalFeature.cpp b/moses/FF/ExternalFeature.cpp
index 10800d24d..602971d2b 100644
--- a/moses/FF/ExternalFeature.cpp
+++ b/moses/FF/ExternalFeature.cpp
@@ -1,6 +1,6 @@
#include "ExternalFeature.h"
#include <dlfcn.h>
-#include <stdlib.h>
+#include <cstdlib>
#include <iostream>
#include "util/exception.hh"
diff --git a/moses/FF/SoftSourceSyntacticConstraintsFeature.cpp b/moses/FF/SoftSourceSyntacticConstraintsFeature.cpp
index 05a3c92e0..d57c42d99 100644
--- a/moses/FF/SoftSourceSyntacticConstraintsFeature.cpp
+++ b/moses/FF/SoftSourceSyntacticConstraintsFeature.cpp
@@ -1,6 +1,6 @@
#include <vector>
#include <limits>
-#include <assert.h>
+#include <cassert>
#include "SoftSourceSyntacticConstraintsFeature.h"
#include "moses/StaticData.h"
#include "moses/InputFileStream.h"
diff --git a/moses/FF/SourceGHKMTreeInputMatchFeature.cpp b/moses/FF/SourceGHKMTreeInputMatchFeature.cpp
index 15509f1e4..d33cbf94a 100644
--- a/moses/FF/SourceGHKMTreeInputMatchFeature.cpp
+++ b/moses/FF/SourceGHKMTreeInputMatchFeature.cpp
@@ -1,6 +1,6 @@
#include <map>
#include <vector>
-#include <assert.h>
+#include <cassert>
#include "SourceGHKMTreeInputMatchFeature.h"
#include "moses/StaticData.h"
#include "moses/InputFileStream.h"
diff --git a/moses/LM/Ken.cpp b/moses/LM/Ken.cpp
index 499886505..41cc3e04a 100644
--- a/moses/LM/Ken.cpp
+++ b/moses/LM/Ken.cpp
@@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <cstring>
#include <iostream>
#include <memory>
-#include <stdlib.h>
+#include <cstdlib>
#include <boost/shared_ptr.hpp>
#include <boost/lexical_cast.hpp>
diff --git a/moses/LM/Remote.cpp b/moses/LM/Remote.cpp
index 4527a52a7..af02a6617 100644
--- a/moses/LM/Remote.cpp
+++ b/moses/LM/Remote.cpp
@@ -1,5 +1,5 @@
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdio>
+#include <cstdlib>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/moses/PP/CountsPhraseProperty.cpp b/moses/PP/CountsPhraseProperty.cpp
index 00bc08011..a8cefe37f 100644
--- a/moses/PP/CountsPhraseProperty.cpp
+++ b/moses/PP/CountsPhraseProperty.cpp
@@ -1,6 +1,6 @@
#include "moses/PP/CountsPhraseProperty.h"
#include <sstream>
-#include <assert.h>
+#include <cassert>
namespace Moses
{
diff --git a/moses/PP/NonTermContextProperty.cpp b/moses/PP/NonTermContextProperty.cpp
index d1ea6a554..3126e90d9 100644
--- a/moses/PP/NonTermContextProperty.cpp
+++ b/moses/PP/NonTermContextProperty.cpp
@@ -1,6 +1,6 @@
#include "moses/PP/NonTermContextProperty.h"
#include <string>
-#include <assert.h>
+#include <cassert>
#include "moses/Util.h"
#include "moses/FactorCollection.h"
diff --git a/moses/PP/SourceLabelsPhraseProperty.cpp b/moses/PP/SourceLabelsPhraseProperty.cpp
index efe5ae741..18229fd1a 100644
--- a/moses/PP/SourceLabelsPhraseProperty.cpp
+++ b/moses/PP/SourceLabelsPhraseProperty.cpp
@@ -5,7 +5,7 @@
#include <sstream>
#include <string>
#include <queue>
-#include <assert.h>
+#include <cassert>
#include <limits>
namespace Moses
diff --git a/moses/SentenceStats.h b/moses/SentenceStats.h
index c1650eac1..998adc74f 100644
--- a/moses/SentenceStats.h
+++ b/moses/SentenceStats.h
@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <iostream>
#include <string>
#include <vector>
-#include <time.h>
+#include <ctime>
#include "Timer.h"
#include "Phrase.h"
#include "Hypothesis.h"
diff --git a/moses/Syntax/F2S/HyperTreeLoader.cpp b/moses/Syntax/F2S/HyperTreeLoader.cpp
index 0ffc3602f..f3caa2cec 100644
--- a/moses/Syntax/F2S/HyperTreeLoader.cpp
+++ b/moses/Syntax/F2S/HyperTreeLoader.cpp
@@ -3,7 +3,7 @@
#include <sys/stat.h>
#include <cmath>
-#include <stdlib.h>
+#include <cstdlib>
#include <fstream>
#include <string>
#include <iterator>
diff --git a/moses/Syntax/S2T/RuleTrieLoader.cpp b/moses/Syntax/S2T/RuleTrieLoader.cpp
index b9f7484ad..a88c0f5fe 100644
--- a/moses/Syntax/S2T/RuleTrieLoader.cpp
+++ b/moses/Syntax/S2T/RuleTrieLoader.cpp
@@ -1,14 +1,14 @@
#include "RuleTrieLoader.h"
#include <sys/stat.h>
-#include <stdlib.h>
+#include <cstdlib>
#include <fstream>
#include <string>
#include <iterator>
#include <algorithm>
#include <iostream>
-#include <math.h>
+#include <cmath>
#include "moses/FactorCollection.h"
#include "moses/Word.h"
diff --git a/moses/TargetPhrase.cpp b/moses/TargetPhrase.cpp
index 70568940d..d6abd16ff 100644
--- a/moses/TargetPhrase.cpp
+++ b/moses/TargetPhrase.cpp
@@ -20,7 +20,7 @@
***********************************************************************/
#include <algorithm>
-#include <stdlib.h>
+#include <cstdlib>
#include "util/exception.hh"
#include "util/tokenize_piece.hh"
diff --git a/moses/TranslationModel/CompactPT/BlockHashIndex.h b/moses/TranslationModel/CompactPT/BlockHashIndex.h
index f8d526930..b3f5e6f4b 100644
--- a/moses/TranslationModel/CompactPT/BlockHashIndex.h
+++ b/moses/TranslationModel/CompactPT/BlockHashIndex.h
@@ -38,7 +38,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#ifdef WITH_THREADS
#include "moses/ThreadPool.h"
#else
-#include <time.h>
+#include <ctime>
#endif
#include <boost/shared_ptr.hpp>
diff --git a/moses/TranslationModel/CompactPT/MurmurHash3.cpp b/moses/TranslationModel/CompactPT/MurmurHash3.cpp
index 4e4cd4258..fb6946bbc 100644
--- a/moses/TranslationModel/CompactPT/MurmurHash3.cpp
+++ b/moses/TranslationModel/CompactPT/MurmurHash3.cpp
@@ -18,7 +18,7 @@
#define FORCE_INLINE __forceinline
-#include <stdlib.h>
+#include <cstdlib>
#define ROTL32(x,y) _rotl(x,y)
#define ROTL64(x,y) _rotl64(x,y)
diff --git a/moses/TranslationModel/DynSAInclude/FileHandler.cpp b/moses/TranslationModel/DynSAInclude/FileHandler.cpp
index 8645833fe..9413ffd7c 100644
--- a/moses/TranslationModel/DynSAInclude/FileHandler.cpp
+++ b/moses/TranslationModel/DynSAInclude/FileHandler.cpp
@@ -1,5 +1,5 @@
#include "FileHandler.h"
-#include <stdio.h>
+#include <cstdio>
#ifdef WIN32
#define popen(A, B) _popen(A, B)
diff --git a/moses/TranslationModel/PhraseDictionary.h b/moses/TranslationModel/PhraseDictionary.h
index 2d5ae32f6..4736f37d8 100644
--- a/moses/TranslationModel/PhraseDictionary.h
+++ b/moses/TranslationModel/PhraseDictionary.h
@@ -36,7 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <boost/thread/tss.hpp>
#else
#include <boost/scoped_ptr.hpp>
-#include <time.h>
+#include <ctime>
#endif
#include "moses/Phrase.h"
diff --git a/moses/TranslationModel/PhraseDictionaryTransliteration.cpp b/moses/TranslationModel/PhraseDictionaryTransliteration.cpp
index a336da759..ce5ac121c 100644
--- a/moses/TranslationModel/PhraseDictionaryTransliteration.cpp
+++ b/moses/TranslationModel/PhraseDictionaryTransliteration.cpp
@@ -1,5 +1,5 @@
// vim:tabstop=2
-#include <stdlib.h>
+#include <cstdlib>
#include "PhraseDictionaryTransliteration.h"
#include "moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerSkeleton.h"
#include "moses/DecodeGraph.h"
diff --git a/moses/TranslationModel/ProbingPT/huffmanish.hh b/moses/TranslationModel/ProbingPT/huffmanish.hh
index 46b7dbeea..14db53a69 100644
--- a/moses/TranslationModel/ProbingPT/huffmanish.hh
+++ b/moses/TranslationModel/ProbingPT/huffmanish.hh
@@ -3,7 +3,7 @@
//Huffman encodes a line and also produces the vocabulary ids
#include "hash.hh"
#include "line_splitter.hh"
-#include <stdio.h>
+#include <cstdio>
#include <fstream>
#include <iostream>
#include <sstream>
diff --git a/moses/TranslationModel/ProbingPT/line_splitter.hh b/moses/TranslationModel/ProbingPT/line_splitter.hh
index c699a28c0..36833616f 100644
--- a/moses/TranslationModel/ProbingPT/line_splitter.hh
+++ b/moses/TranslationModel/ProbingPT/line_splitter.hh
@@ -4,7 +4,7 @@
#include "util/tokenize_piece.hh"
#include "util/file_piece.hh"
#include <vector>
-#include <stdlib.h> //atof
+#include <cstdlib> //atof
#include "util/string_piece.hh" //Tokenization and work with StringPiece
#include "util/tokenize_piece.hh"
#include <vector>
diff --git a/moses/TranslationModel/ProbingPT/storing.hh b/moses/TranslationModel/ProbingPT/storing.hh
index 821fd14ca..eb3b1ea53 100644
--- a/moses/TranslationModel/ProbingPT/storing.hh
+++ b/moses/TranslationModel/ProbingPT/storing.hh
@@ -1,6 +1,6 @@
#pragma once
-#include <stdio.h>
+#include <cstdio>
#include <fstream>
#include <iostream>
diff --git a/moses/TranslationModel/RuleTable/LoaderStandard.cpp b/moses/TranslationModel/RuleTable/LoaderStandard.cpp
index 95463feea..f9e6ac6fd 100644
--- a/moses/TranslationModel/RuleTable/LoaderStandard.cpp
+++ b/moses/TranslationModel/RuleTable/LoaderStandard.cpp
@@ -25,7 +25,7 @@
#include <algorithm>
#include <iostream>
#include <sys/stat.h>
-#include <stdlib.h>
+#include <cstdlib>
#include <boost/algorithm/string/predicate.hpp>
#include "Trie.h"
#include "moses/FactorCollection.h"
diff --git a/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp b/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp
index 0928cf1e4..3ecfe8f19 100644
--- a/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp
+++ b/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp
@@ -19,10 +19,10 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <climits>
#include <sys/types.h>
#include <unistd.h>
#include <dirent.h>
@@ -50,7 +50,7 @@ using namespace std;
#if defined __MINGW32__ && !defined mkdtemp
#include <windows.h>
-#include <errno.h>
+#include <cerrno>
char *mkdtemp(char *tempbuf)
{
int rand_value = 0;
diff --git a/moses/TranslationModel/UG/mm/tpt_tightindex.cc b/moses/TranslationModel/UG/mm/tpt_tightindex.cc
index ff7153af7..da28c6d93 100644
--- a/moses/TranslationModel/UG/mm/tpt_tightindex.cc
+++ b/moses/TranslationModel/UG/mm/tpt_tightindex.cc
@@ -17,7 +17,7 @@
//
#include <iostream>
-#include <assert.h>
+#include <cassert>
#include "tpt_tightindex.h"
namespace ugdiss
diff --git a/moses/TranslationModel/UG/mm/tpt_tokenindex.cc b/moses/TranslationModel/UG/mm/tpt_tokenindex.cc
index 2273fefa7..c6704beac 100644
--- a/moses/TranslationModel/UG/mm/tpt_tokenindex.cc
+++ b/moses/TranslationModel/UG/mm/tpt_tokenindex.cc
@@ -1,7 +1,7 @@
// -*- c++ -*-
// (c) 2007-2013 Ulrich Germann
#include <sstream>
-#include <string.h>
+#include <cstring>
#include <algorithm>
#include <iostream>
#include <stdexcept>
diff --git a/moses/TranslationModel/UG/mmsapt.h b/moses/TranslationModel/UG/mmsapt.h
index 834faf196..23258475a 100644
--- a/moses/TranslationModel/UG/mmsapt.h
+++ b/moses/TranslationModel/UG/mmsapt.h
@@ -3,7 +3,7 @@
// Design and code by Ulrich Germann.
#pragma once
-#include <time.h>
+#include <ctime>
#include <boost/thread.hpp>
#include <boost/scoped_ptr.hpp>
diff --git a/moses/TranslationModel/fuzzy-match/Vocabulary.h b/moses/TranslationModel/fuzzy-match/Vocabulary.h
index 5a79e2f26..f5245ebe3 100644
--- a/moses/TranslationModel/fuzzy-match/Vocabulary.h
+++ b/moses/TranslationModel/fuzzy-match/Vocabulary.h
@@ -4,8 +4,8 @@
#include <iostream>
#include <fstream>
-#include <assert.h>
-#include <stdlib.h>
+#include <cassert>
+#include <cstdlib>
#include <string>
#include <queue>
#include <map>
diff --git a/moses/Util.cpp b/moses/Util.cpp
index 1d1df7d58..a8175b58d 100644
--- a/moses/Util.cpp
+++ b/moses/Util.cpp
@@ -29,7 +29,7 @@
#include <cstring>
#include <cctype>
#include <algorithm>
-#include <stdio.h>
+#include <cstdio>
#include <iostream>
#include <iomanip>
#include <boost/algorithm/string/predicate.hpp>
diff --git a/moses/mbr.cpp b/moses/mbr.cpp
index 6a8dfa823..df2313b66 100644
--- a/moses/mbr.cpp
+++ b/moses/mbr.cpp
@@ -4,10 +4,10 @@
#include <iomanip>
#include <vector>
#include <map>
-#include <stdlib.h>
-#include <math.h>
+#include <cstdlib>
+#include <cmath>
#include <algorithm>
-#include <stdio.h>
+#include <cstdio>
#include "moses/TrellisPathList.h"
#include "moses/TrellisPath.h"
#include "moses/StaticData.h"