Modernize "C" includes in contrib.

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 contrib/ subdirectory.

C++11 adds cstdint, but to support compilation with the previous
standard, that change is left for later.
This commit is contained in:
Jeroen Vermeulen 2015-03-28 20:58:46 +07:00
parent b3c0a29044
commit 4c59b350df
11 changed files with 28 additions and 28 deletions

View File

@ -13,8 +13,8 @@
#ifndef LOSSYCOUNTER_H
#define LOSSYCOUNTER_H
#include <stddef.h>
#include <math.h>
#include <cstddef>
#include <cmath>
#ifdef USE_UNORDERED_MAP
#include <tr1/unordered_map>
#else

View File

@ -13,7 +13,7 @@
#include <string>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <cstdlib>
#include <iomanip>
#include "phrase-extract.h"

View File

@ -5,13 +5,13 @@
#include <sstream>
#include <string>
#include <iostream>
#include <stdio.h>
#include <cstdio>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string.h>
#include <cstring>
#include <map>
struct Cache {

View File

@ -4,8 +4,8 @@
* Created on: 28 Feb 2014
* Author: hieu
*/
#include <stdlib.h>
#include <stdio.h>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <fstream>
#include <boost/algorithm/string/predicate.hpp>

View File

@ -20,7 +20,7 @@
#error Cython requires Python 2.4+.
#else
#define CYTHON_ABI "0_20_1post0"
#include <stddef.h> /* For offsetof */
#include <cstddef> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
@ -343,7 +343,7 @@ void __Pyx_call_destructor(T* x) {
#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#include <cmath>
#define __PYX_HAVE__moses__dictree
#define __PYX_HAVE_API__moses__dictree
#include "string.h"
@ -1131,7 +1131,7 @@ bad:
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/
#include <string.h>
#include <cstring>
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

View File

@ -31,14 +31,14 @@
///////////////////////////////////////////////////////////////////////////////
// if you are not using precompiled headers then include these lines:
//#include <windows.h>
//#include <stdio.h>
//#include <cstdio>
//#include <tchar.h>
///////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include "WIN32_functions.h"
@ -228,4 +228,4 @@ double lgamma(int x)
sum += coefs[j]/++y;
}
return -tmp+log(2.5066282746310005*sum/(double)x);
}
}

View File

@ -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 "TrellisPathList.h"
#include "TrellisPath.h"
#include "StaticData.h"

View File

@ -31,14 +31,14 @@
///////////////////////////////////////////////////////////////////////////////
// if you are not using precompiled headers then include these lines:
//#include <windows.h>
//#include <stdio.h>
//#include <cstdio>
//#include <tchar.h>
///////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include "WIN32_functions.h"
@ -228,4 +228,4 @@ double lgamma(int x)
sum += coefs[j]/++y;
}
return -tmp+log(2.5066282746310005*sum/(double)x);
}
}

View File

@ -24,7 +24,7 @@
#ifndef _NL_CPT__
#define _NL_CPT__
//#include <stdlib.h>
//#include <cstdlib>
//#include <vector>
//#include <string>
//#include <cassert>

View File

@ -24,7 +24,7 @@
#ifndef _NL_LIST_ //////////////////////////////////////////////////////////////
#define _NL_LIST_ //////////////////////////////////////////////////////////////
#include <stdlib.h>
#include <cstdlib>
#define Listed(x) ListedObject<x>

View File

@ -26,10 +26,10 @@
#include "nl-array.h"
#include <stdio.h>
#include <cstdio>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;