mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-10-05 15:58:03 +03:00
Modernize "C" includes in util.
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 util/ 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
206d0c9698
commit
88e90957a1
@ -1,7 +1,7 @@
|
||||
#include "util/bit_packing.hh"
|
||||
#include "util/exception.hh"
|
||||
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace util {
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
* NICT.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#ifdef __APPLE__
|
||||
#include <architecture/byte_order.h>
|
||||
#elif __linux__
|
||||
@ -28,8 +28,7 @@
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace util {
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#define BOOST_TEST_MODULE BitPackingTest
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace util {
|
||||
namespace {
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "util/file.hh"
|
||||
#include "util/read_compressed.hh"
|
||||
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
namespace {
|
||||
|
@ -25,7 +25,7 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
#include "bignum-dtoa.h"
|
||||
|
||||
|
@ -25,9 +25,9 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#include <cstdarg>
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
|
@ -25,8 +25,8 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
|
||||
#include "double-conversion.h"
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
#include "fixed-dtoa.h"
|
||||
#include "ieee.h"
|
||||
|
@ -25,8 +25,8 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <limits.h>
|
||||
#include <cstdarg>
|
||||
#include <climits>
|
||||
|
||||
#include "strtod.h"
|
||||
#include "bignum.h"
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// Ersatz version of boost::progress so core language model doesn't depend on
|
||||
|
@ -4,8 +4,8 @@
|
||||
#include <typeinfo>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
||||
|
||||
namespace util {
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace util {
|
||||
|
@ -13,9 +13,9 @@
|
||||
#include <sstream>
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <cassert>
|
||||
#include <cerrno>
|
||||
#include <climits>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace util {
|
||||
|
@ -14,10 +14,9 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <limits>
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
@ -11,8 +11,7 @@
|
||||
#include <cstddef>
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace util {
|
||||
|
@ -8,8 +8,7 @@
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace util {
|
||||
|
||||
|
@ -11,11 +11,11 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include <windows.h>
|
||||
|
@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
#include "util/murmur_hash.hh"
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace util {
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/utility.hpp>
|
||||
|
||||
#include <errno.h>
|
||||
#include <cerrno>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <mach/semaphore.h>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "util/scoped.hh"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace util {
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
#define UTIL_POOL_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace util {
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace util {
|
||||
|
@ -7,9 +7,9 @@
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace util {
|
||||
|
@ -7,10 +7,10 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <cassert>
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#include <zlib.h>
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include "util/scoped.hh"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace util {
|
||||
|
@ -9,11 +9,10 @@
|
||||
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
|
||||
#if defined __MINGW32__
|
||||
#include <time.h>
|
||||
#include <ctime>
|
||||
#include <fcntl.h>
|
||||
|
||||
#if !defined mkstemp
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace util {
|
||||
|
||||
|
@ -3,8 +3,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace util {
|
||||
|
@ -8,9 +8,7 @@
|
||||
#include <cstdlib>
|
||||
#include <new>
|
||||
#include <iostream>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace util {
|
||||
namespace stream {
|
||||
|
@ -10,8 +10,7 @@
|
||||
#include <boost/thread/thread.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
|
||||
namespace util {
|
||||
template <class T> class PCQueue;
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
#if !defined(_WIN32) && !defined(_WIN64)
|
||||
#include <unistd.h>
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include <boost/thread/mutex.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace util { namespace stream {
|
||||
|
@ -9,8 +9,8 @@
|
||||
#include <cstddef>
|
||||
#include <new>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace util { namespace stream {
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace util {
|
||||
|
@ -5,8 +5,7 @@
|
||||
#include "util/string_piece.hh"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <limits.h>
|
||||
#include <climits>
|
||||
|
||||
#ifndef HAVE_ICU
|
||||
|
||||
|
@ -85,7 +85,7 @@ inline bool starts_with(const StringPiece& longer, const StringPiece& prefix) {
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
#ifdef WIN32
|
||||
#undef max
|
||||
|
@ -8,8 +8,7 @@
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace util {
|
||||
|
||||
|
@ -7,8 +7,7 @@
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace util {
|
||||
|
||||
|
@ -7,10 +7,9 @@
|
||||
#include <sstream>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include <cstring>
|
||||
#include <cctype>
|
||||
#include <ctime>
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
// This code lifted from physmem.c in gnulib. See the copyright statement
|
||||
// below.
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include <cstddef>
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace util {
|
||||
|
Loading…
Reference in New Issue
Block a user