mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-19 09:12:19 +00:00
Replace all usages of C standard headers with C++ headers
This commit is contained in:
parent
cf4da09ce9
commit
a76fb9b99a
|
@ -53,7 +53,7 @@ def generate_decompositions():
|
|||
|
||||
def gen_header(decompositions, len_set):
|
||||
print("""\
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
struct DECOMP_SLICE
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ def generate_cases():
|
|||
|
||||
def gen_header(cases):
|
||||
print(f"""\
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
struct UPPER_LOWER
|
||||
{{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef BASE_LOG_H
|
||||
#define BASE_LOG_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define GNUC_ATTRIBUTE(x) __attribute__(x)
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#define BASE_MATH_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
|
||||
using std::clamp;
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
#include <ws2tcpip.h>
|
||||
|
||||
#include <cerrno>
|
||||
#include <fenv.h>
|
||||
#include <cfenv>
|
||||
#include <io.h>
|
||||
#include <objbase.h>
|
||||
#include <process.h>
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
#define __USE_GNU
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <cinttypes>
|
||||
#include <cstdint>
|
||||
#include <ctime>
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#undef PRId64
|
||||
|
@ -62,7 +62,7 @@
|
|||
void dbg_assert_imp(const char *filename, int line, int test, const char *msg);
|
||||
|
||||
#ifdef __clang_analyzer__
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#undef dbg_assert
|
||||
#define dbg_assert(test, msg) assert(test)
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
struct DECOMP_SLICE
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
struct UPPER_LOWER
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#ifndef BASE_VMATH_H
|
||||
#define BASE_VMATH_H
|
||||
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
#include "math.h"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef ENGINE_CLIENT_GRAPHICS_DEFINES_H
|
||||
#define ENGINE_CLIENT_GRAPHICS_DEFINES_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
typedef uint32_t TWGLuint;
|
||||
typedef int32_t TWGLint;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef ENGINE_GFX_IMAGE_LOADER_H
|
||||
#define ENGINE_GFX_IMAGE_LOADER_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
enum EImageFormat
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef ENGINE_GFX_IMAGE_MANIPULATION_H
|
||||
#define ENGINE_GFX_IMAGE_MANIPULATION_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
void DilateImage(unsigned char *pImageBuff, int w, int h, int BPP);
|
||||
void DilateImageSub(unsigned char *pImageBuff, int w, int h, int BPP, int x, int y, int sw, int sh);
|
||||
|
|
|
@ -7,17 +7,18 @@
|
|||
#include "warning.h"
|
||||
|
||||
#include <base/color.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#define GRAPHICS_TYPE_UNSIGNED_BYTE 0x1401
|
||||
#define GRAPHICS_TYPE_UNSIGNED_SHORT 0x1403
|
||||
#define GRAPHICS_TYPE_INT 0x1404
|
||||
#define GRAPHICS_TYPE_UNSIGNED_INT 0x1405
|
||||
#define GRAPHICS_TYPE_FLOAT 0x1406
|
||||
|
||||
struct SBufferContainerInfo
|
||||
{
|
||||
int m_Stride;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <base/system.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
class IStorage;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#define ENGINE_SHARED_SNAPSHOT_H
|
||||
|
||||
#include <cstddef>
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
// CSnapshot
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <engine/storage.h>
|
||||
|
||||
#ifdef CONF_PLATFORM_HAIKU
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
#endif
|
||||
|
||||
class CStorage : public IStorage
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <cstddef>
|
||||
|
||||
int websocket_create(const char *addr, int port);
|
||||
int websocket_destroy(int socket);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <game/client/components/maplayers.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
class CLayers;
|
||||
class CMapImages;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef GAME_PRNG_H
|
||||
#define GAME_PRNG_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
class CPrng
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#ifndef GAME_SERVER_EVENTHANDLER_H
|
||||
#define GAME_SERVER_EVENTHANDLER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
#include <engine/shared/protocol.h>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <engine/shared/protocol.h>
|
||||
#include <game/generated/protocol.h>
|
||||
|
||||
#include <time.h>
|
||||
#include <ctime>
|
||||
|
||||
class CConfig;
|
||||
class CTuningParams;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <base/dynamic.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
#ifndef STEAMAPI
|
||||
#define STEAMAPI DYNAMIC_IMPORT
|
||||
|
|
Loading…
Reference in a new issue