mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Replace typedef aliasing by using (#10712)
This commit is contained in:
@@ -74,36 +74,36 @@
|
||||
# undef glGetTexImage
|
||||
|
||||
// 1.1 function signatures
|
||||
typedef void(APIENTRYP PFNGLBEGINPROC)(GLenum mode);
|
||||
typedef void(APIENTRYP PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture);
|
||||
typedef void(APIENTRYP PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor);
|
||||
typedef void(APIENTRYP PFNGLCLEARPROC)(GLbitfield mask);
|
||||
typedef void(APIENTRYP PFNGLCLEARCOLORPROC)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode);
|
||||
typedef void(APIENTRYP PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint* textures);
|
||||
typedef void(APIENTRYP PFNGLDEPTHFUNCPROC)(GLenum func);
|
||||
typedef void(APIENTRYP PFNGLDISABLEPROC)(GLenum cap);
|
||||
typedef void(APIENTRYP PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count);
|
||||
typedef void(APIENTRYP PFNGLENABLEPROC)(GLenum cap);
|
||||
typedef void(APIENTRYP PFNGLENDPROC)(void);
|
||||
typedef GLenum(APIENTRYP PFNGLGETERRORPROC)(void);
|
||||
typedef void(APIENTRYP PFNGLGENTEXTURESPROC)(GLsizei n, GLuint* textures);
|
||||
typedef void(APIENTRYP PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNGLREADPIXELSPROC)(
|
||||
using PFNGLBEGINPROC = void(APIENTRYP)(GLenum mode);
|
||||
using PFNGLBINDTEXTUREPROC = void(APIENTRYP)(GLenum target, GLuint texture);
|
||||
using PFNGLBLENDFUNCPROC = void(APIENTRYP)(GLenum sfactor, GLenum dfactor);
|
||||
using PFNGLCLEARPROC = void(APIENTRYP)(GLbitfield mask);
|
||||
using PFNGLCLEARCOLORPROC = void(APIENTRYP)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
using PFNGLCULLFACEPROC = void(APIENTRYP)(GLenum mode);
|
||||
using PFNGLDELETETEXTURESPROC = void(APIENTRYP)(GLsizei n, const GLuint* textures);
|
||||
using PFNGLDEPTHFUNCPROC = void(APIENTRYP)(GLenum func);
|
||||
using PFNGLDISABLEPROC = void(APIENTRYP)(GLenum cap);
|
||||
using PFNGLDRAWARRAYSPROC = void(APIENTRYP)(GLenum mode, GLint first, GLsizei count);
|
||||
using PFNGLENABLEPROC = void(APIENTRYP)(GLenum cap);
|
||||
using PFNGLENDPROC = void(APIENTRYP)(void);
|
||||
using PFNGLGETERRORPROC = GLenum(APIENTRYP)(void);
|
||||
using PFNGLGENTEXTURESPROC = void(APIENTRYP)(GLsizei n, GLuint* textures);
|
||||
using PFNGLPIXELSTOREIPROC = void(APIENTRYP)(GLenum pname, GLint param);
|
||||
using PFNGLREADPIXELSPROC = void(APIENTRYP)(
|
||||
GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNGLTEXIMAGE2DPROC)(
|
||||
using PFNGLTEXIMAGE2DPROC = void(APIENTRYP)(
|
||||
GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type,
|
||||
const GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void(APIENTRYP PFNGLTEXSUBIMAGE3DPROC)(
|
||||
using PFNGLTEXPARAMETERIPROC = void(APIENTRYP)(GLenum target, GLenum pname, GLint param);
|
||||
using PFNGLVIEWPORTPROC = void(APIENTRYP)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
using PFNGLTEXSUBIMAGE3DPROC = void(APIENTRYP)(
|
||||
GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
|
||||
GLenum format, GLenum type, const GLvoid* data);
|
||||
typedef void(APIENTRYP PFNGLTEXIMAGE3DPROC)(
|
||||
using PFNGLTEXIMAGE3DPROC = void(APIENTRYP)(
|
||||
GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format,
|
||||
GLenum type, const GLvoid* data);
|
||||
typedef void(APIENTRYP PFNGLGETINTERGERVPROC)(GLenum pname, GLint* data);
|
||||
typedef void(APIENTRYP PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid* img);
|
||||
using PFNGLGETINTERGERVPROC = void(APIENTRYP)(GLenum pname, GLint* data);
|
||||
using PFNGLGETTEXIMAGEPROC = void(APIENTRYP)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid* img);
|
||||
|
||||
# define OPENGL_PROC(TYPE, PROC) extern TYPE PROC;
|
||||
# include "OpenGLAPIProc.h"
|
||||
|
||||
@@ -205,12 +205,12 @@ private:
|
||||
|
||||
#ifndef __MACOSX__
|
||||
std::shared_mutex _mutex;
|
||||
typedef std::shared_lock<std::shared_mutex> shared_lock;
|
||||
typedef std::unique_lock<std::shared_mutex> unique_lock;
|
||||
using shared_lock = std::shared_lock<std::shared_mutex>;
|
||||
using unique_lock = std::unique_lock<std::shared_mutex>;
|
||||
#else
|
||||
std::mutex _mutex;
|
||||
typedef std::unique_lock<std::mutex> shared_lock;
|
||||
typedef std::unique_lock<std::mutex> unique_lock;
|
||||
using shared_lock = std::unique_lock<std::mutex>;
|
||||
using unique_lock = std::unique_lock<std::mutex>;
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
@@ -24,7 +24,7 @@ struct XData
|
||||
bool begin;
|
||||
int32_t top, bottom;
|
||||
};
|
||||
typedef std::vector<XData> SweepLine;
|
||||
using SweepLine = std::vector<XData>;
|
||||
|
||||
/*
|
||||
* Creates a list of vertical bounding box edges, stored as xdata and sorted
|
||||
@@ -76,7 +76,7 @@ struct YData
|
||||
{
|
||||
int32_t count, depth;
|
||||
};
|
||||
typedef std::map<int32_t, YData> IntervalTree;
|
||||
using IntervalTree = std::map<int32_t, YData>;
|
||||
|
||||
/*
|
||||
* Inserts the interval's top endpoint into the interval tree. If the endpoint
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
template<typename _TType, size_t _TMax> class CircularBuffer
|
||||
{
|
||||
public:
|
||||
typedef _TType value_type;
|
||||
typedef _TType* pointer;
|
||||
typedef const _TType* const_pointer;
|
||||
typedef _TType& reference;
|
||||
typedef const _TType& const_reference;
|
||||
typedef size_t size_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
using value_type = _TType;
|
||||
using pointer = _TType*;
|
||||
using const_pointer = const _TType*;
|
||||
using reference = _TType&;
|
||||
using const_reference = const _TType&;
|
||||
using size_type = size_t;
|
||||
using difference_type = ptrdiff_t;
|
||||
|
||||
reference front()
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Crypt
|
||||
template<size_t TLength> class HashAlgorithm
|
||||
{
|
||||
public:
|
||||
typedef std::array<uint8_t, TLength> Result;
|
||||
using Result = std::array<uint8_t, TLength>;
|
||||
|
||||
virtual ~HashAlgorithm() = default;
|
||||
virtual HashAlgorithm* Clear() = 0;
|
||||
|
||||
@@ -17,7 +17,7 @@ template<size_t size> struct ByteSwapT
|
||||
|
||||
template<> struct ByteSwapT<1>
|
||||
{
|
||||
typedef uint8_t UIntType;
|
||||
using UIntType = uint8_t;
|
||||
static uint8_t SwapBE(uint8_t value)
|
||||
{
|
||||
return value;
|
||||
@@ -26,7 +26,7 @@ template<> struct ByteSwapT<1>
|
||||
|
||||
template<> struct ByteSwapT<2>
|
||||
{
|
||||
typedef uint16_t UIntType;
|
||||
using UIntType = uint16_t;
|
||||
static uint16_t SwapBE(uint16_t value)
|
||||
{
|
||||
return (uint16_t)((value << 8) | (value >> 8));
|
||||
@@ -35,7 +35,7 @@ template<> struct ByteSwapT<2>
|
||||
|
||||
template<> struct ByteSwapT<4>
|
||||
{
|
||||
typedef uint32_t UIntType;
|
||||
using UIntType = uint32_t;
|
||||
static uint32_t SwapBE(uint32_t value)
|
||||
{
|
||||
return (uint32_t)(((value << 24) | ((value << 8) & 0x00FF0000) | ((value >> 8) & 0x0000FF00) | (value >> 24)));
|
||||
@@ -44,7 +44,7 @@ template<> struct ByteSwapT<4>
|
||||
|
||||
template<> struct ByteSwapT<8>
|
||||
{
|
||||
typedef uint64_t UIntType;
|
||||
using UIntType = uint64_t;
|
||||
static uint64_t SwapBE(uint64_t value)
|
||||
{
|
||||
value = (value & 0x00000000FFFFFFFF) << 32 | (value & 0xFFFFFFFF00000000) >> 32;
|
||||
@@ -56,7 +56,7 @@ template<> struct ByteSwapT<8>
|
||||
|
||||
template<typename T> static T ByteSwapBE(const T& value)
|
||||
{
|
||||
typedef ByteSwapT<sizeof(T)> ByteSwap;
|
||||
using ByteSwap = ByteSwapT<sizeof(T)>;
|
||||
typename ByteSwap::UIntType result = ByteSwap::SwapBE(reinterpret_cast<const typename ByteSwap::UIntType&>(value));
|
||||
return *reinterpret_cast<T*>(&result);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ private:
|
||||
std::condition_variable _condComplete;
|
||||
std::mutex _mutex;
|
||||
|
||||
typedef std::unique_lock<std::mutex> unique_lock;
|
||||
using unique_lock = std::unique_lock<std::mutex>;
|
||||
|
||||
public:
|
||||
JobPool(size_t maxThreads = 255)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "../object/Object.h"
|
||||
#include "Ride.h"
|
||||
|
||||
typedef uint16_t track_type_t;
|
||||
using track_type_t = uint16_t;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct rct_trackdefinition
|
||||
|
||||
@@ -398,7 +398,7 @@ struct TileCoordsXYZ : public TileCoordsXY
|
||||
* 3 is Y-decreasing
|
||||
* Direction is not used to model up/down, or diagonal directions.
|
||||
*/
|
||||
typedef uint8_t Direction;
|
||||
using Direction = uint8_t;
|
||||
|
||||
const Direction INVALID_DIRECTION = 0xFF;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ constexpr const int32_t LAND_HEIGHT_STEP = 2 * COORDS_Z_STEP;
|
||||
|
||||
#define TILE_UNDEFINED_TILE_ELEMENT NULL
|
||||
|
||||
typedef CoordsXYZD PeepSpawn;
|
||||
using PeepSpawn = CoordsXYZD;
|
||||
|
||||
struct CoordsXYE : public CoordsXY
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
struct Banner;
|
||||
struct rct_scenery_entry;
|
||||
struct rct_footpath_entry;
|
||||
typedef uint16_t track_type_t;
|
||||
using track_type_t = uint16_t;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user