mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-08-16 15:00:33 +03:00
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.
This commit is contained in:
parent
9852a0c2ff
commit
a9c8f44896
@ -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"
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "ExternalFeature.h"
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include "util/exception.hh"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <vector>
|
||||
#include <limits>
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include "SoftSourceSyntacticConstraintsFeature.h"
|
||||
#include "moses/StaticData.h"
|
||||
#include "moses/InputFileStream.h"
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include "SourceGHKMTreeInputMatchFeature.h"
|
||||
#include "moses/StaticData.h"
|
||||
#include "moses/InputFileStream.h"
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "moses/PP/CountsPhraseProperty.h"
|
||||
#include <sstream>
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
|
||||
namespace Moses
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "moses/PP/NonTermContextProperty.h"
|
||||
#include <string>
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include "moses/Util.h"
|
||||
#include "moses/FactorCollection.h"
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <queue>
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
|
||||
namespace Moses
|
||||
|
@ -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"
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <iterator>
|
||||
|
@ -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"
|
||||
|
@ -20,7 +20,7 @@
|
||||
***********************************************************************/
|
||||
|
||||
#include <algorithm>
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
#include "util/exception.hh"
|
||||
#include "util/tokenize_piece.hh"
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "FileHandler.h"
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
|
||||
#ifdef WIN32
|
||||
#define popen(A, B) _popen(A, B)
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
|
@ -17,7 +17,7 @@
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include "tpt_tightindex.h"
|
||||
|
||||
namespace ugdiss
|
||||
|
@ -1,7 +1,7 @@
|
||||
// -*- c++ -*-
|
||||
// (c) 2007-2013 Ulrich Germann
|
||||
#include <sstream>
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
|
@ -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>
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <queue>
|
||||
#include <map>
|
||||
|
@ -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>
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user