Replace all usages of C standard headers with C++ headers

This commit is contained in:
Robert Müller 2023-02-28 20:41:07 +01:00
parent cf4da09ce9
commit a76fb9b99a
22 changed files with 32 additions and 31 deletions

View file

@ -53,7 +53,7 @@ def generate_decompositions():
def gen_header(decompositions, len_set):
print("""\
#include <stdint.h>
#include <cstdint>
struct DECOMP_SLICE
{

View file

@ -16,7 +16,7 @@ def generate_cases():
def gen_header(cases):
print(f"""\
#include <stdint.h>
#include <cstdint>
struct UPPER_LOWER
{{

View file

@ -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)

View file

@ -4,8 +4,8 @@
#define BASE_MATH_H
#include <algorithm>
#include <math.h>
#include <stdlib.h>
#include <cmath>
#include <cstdlib>
using std::clamp;

View file

@ -70,7 +70,7 @@
#include <ws2tcpip.h>
#include <cerrno>
#include <fenv.h>
#include <cfenv>
#include <io.h>
#include <objbase.h>
#include <process.h>

View file

@ -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

View file

@ -1,4 +1,4 @@
#include <stdint.h>
#include <cstdint>
struct DECOMP_SLICE
{

View file

@ -1,4 +1,4 @@
#include <stdint.h>
#include <cstdint>
struct UPPER_LOWER
{

View file

@ -3,7 +3,7 @@
#ifndef BASE_VMATH_H
#define BASE_VMATH_H
#include <math.h>
#include <cmath>
#include "math.h"

View file

@ -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;

View file

@ -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

View file

@ -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);

View file

@ -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;

View file

@ -5,7 +5,7 @@
#include <base/system.h>
#include <stdint.h>
#include <cstdint>
class IStorage;

View file

@ -4,7 +4,7 @@
#define ENGINE_SHARED_SNAPSHOT_H
#include <cstddef>
#include <stdint.h>
#include <cstdint>
// CSnapshot

View file

@ -7,7 +7,7 @@
#include <engine/storage.h>
#ifdef CONF_PLATFORM_HAIKU
#include <stdlib.h>
#include <cstdlib>
#endif
class CStorage : public IStorage

View file

@ -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);

View file

@ -5,7 +5,7 @@
#include <game/client/components/maplayers.h>
#include <stdint.h>
#include <cstdint>
class CLayers;
class CMapImages;

View file

@ -1,7 +1,7 @@
#ifndef GAME_PRNG_H
#define GAME_PRNG_H
#include <stdint.h>
#include <cstdint>
class CPrng
{

View file

@ -3,7 +3,7 @@
#ifndef GAME_SERVER_EVENTHANDLER_H
#define GAME_SERVER_EVENTHANDLER_H
#include <stdint.h>
#include <cstdint>
#include <engine/shared/protocol.h>

View file

@ -6,7 +6,7 @@
#include <engine/shared/protocol.h>
#include <game/generated/protocol.h>
#include <time.h>
#include <ctime>
class CConfig;
class CTuningParams;

View file

@ -3,7 +3,7 @@
#include <base/dynamic.h>
#include <stdint.h>
#include <cstdint>
#ifndef STEAMAPI
#define STEAMAPI DYNAMIC_IMPORT