From 8471a7e18992a7fc3c42b39a3a69fc9fb342f794 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 24 Aug 2019 02:29:35 -0400 Subject: [PATCH 1/3] Types: Simplify typedefs These can just be regular structure declarations. This also has the benefit of allowing forward declaring the types. --- include/athena/Types.hpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/athena/Types.hpp b/include/athena/Types.hpp index a7b6cac..dc6ba27 100644 --- a/include/athena/Types.hpp +++ b/include/athena/Types.hpp @@ -13,24 +13,24 @@ using atUint64 = uint64_t; // Vector types #include "simd/simd.hpp" -typedef struct { +struct atVec2f { athena::simd simd; -} atVec2f; -typedef struct { +}; +struct atVec3f { athena::simd simd; -} atVec3f; -typedef struct { +}; +struct atVec4f { athena::simd simd; -} atVec4f; -typedef struct { +}; +struct atVec2d { athena::simd simd; -} atVec2d; -typedef struct { +}; +struct atVec3d { athena::simd simd; -} atVec3d; -typedef struct { +}; +struct atVec4d { athena::simd simd; -} atVec4d; +}; #ifndef UNUSED #define UNUSED(x) ((void)x) From f669191fcb2a492ff944e400c7237b5854d1cb25 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 24 Aug 2019 02:31:08 -0400 Subject: [PATCH 2/3] Types: Remove unnecessary macros These appear to be unused, and, with C++17, can be superseded with [[maybe_unused]] and [[deprecated]] attributes --- include/athena/Types.hpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/include/athena/Types.hpp b/include/athena/Types.hpp index dc6ba27..bf82f5e 100644 --- a/include/athena/Types.hpp +++ b/include/athena/Types.hpp @@ -31,16 +31,3 @@ struct atVec3d { struct atVec4d { athena::simd simd; }; - -#ifndef UNUSED -#define UNUSED(x) ((void)x) -#endif // UNUSED - -#ifdef __GNUC__ -#define DEPRECATED(func) func __attribute__((deprecated)) -#elif defined(_MSC_VER) -#define DEPRECATED(func) __declspec(deprecated) func -#else -#pragma message("WARNING: You need to implement DEPRECATED for this compiler") -#define DEPRECATED(func) func -#endif From 0622ada76646c6e5475dce97150443a88d6c032b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 24 Aug 2019 02:33:40 -0400 Subject: [PATCH 3/3] Types: Qualify std types with std:: Same behavior, but more proper from a type header point of view. --- include/athena/Types.hpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/include/athena/Types.hpp b/include/athena/Types.hpp index bf82f5e..6bd4f1d 100644 --- a/include/athena/Types.hpp +++ b/include/athena/Types.hpp @@ -1,15 +1,16 @@ #pragma once -#include -#include -using atInt8 = int8_t; -using atUint8 = uint8_t; -using atInt16 = int16_t; -using atUint16 = uint16_t; -using atInt32 = int32_t; -using atUint32 = uint32_t; -using atInt64 = int64_t; -using atUint64 = uint64_t; +#include +#include + +using atInt8 = std::int8_t; +using atUint8 = std::uint8_t; +using atInt16 = std::int16_t; +using atUint16 = std::uint16_t; +using atInt32 = std::int32_t; +using atUint32 = std::uint32_t; +using atInt64 = std::int64_t; +using atUint64 = std::uint64_t; // Vector types #include "simd/simd.hpp"