mirror of https://github.com/libAthena/athena.git
General: Be explicit about the Endian type
This commit is contained in:
parent
d5e91ca0fe
commit
71eb499270
|
@ -1,7 +1,7 @@
|
||||||
#include <athena/DNAYaml.hpp>
|
#include <athena/DNAYaml.hpp>
|
||||||
|
|
||||||
using namespace athena;
|
using namespace athena;
|
||||||
typedef io::DNA<Big> BigDNA;
|
typedef io::DNA<Endian::Big> BigDNA;
|
||||||
|
|
||||||
enum ETest : atUint8 { ZERO, ONE, TWO, THREE };
|
enum ETest : atUint8 { ZERO, ONE, TWO, THREE };
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ struct AT_SPECIALIZE_PARMS(atUint16, 42, atUint32, 87, atUint32, 2) TESTFile : p
|
||||||
Value<TESTTemplateSubFile<atInt32, 36>> nestedTemplate1;
|
Value<TESTTemplateSubFile<atInt32, 36>> nestedTemplate1;
|
||||||
Value<TESTTemplateSubFile<atInt64, 96>> nestedTemplate2;
|
Value<TESTTemplateSubFile<atInt64, 96>> nestedTemplate2;
|
||||||
|
|
||||||
Value<atUint32, Little> arrCount[2];
|
Value<atUint32, Endian::Little> arrCount[2];
|
||||||
Vector<atUint32, AT_DNA_COUNT(arrCount[0])> array;
|
Vector<atUint32, AT_DNA_COUNT(arrCount[0])> array;
|
||||||
|
|
||||||
Value<atUint32> arrAltCount;
|
Value<atUint32> arrAltCount;
|
||||||
|
|
|
@ -16,8 +16,8 @@ constexpr bool isSystemBigEndian() { return false; }
|
||||||
#else
|
#else
|
||||||
constexpr bool isSystemBigEndian() { return __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__; }
|
constexpr bool isSystemBigEndian() { return __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__; }
|
||||||
#endif
|
#endif
|
||||||
constexpr ::athena::Endian SystemEndian = isSystemBigEndian() ? Big : Little;
|
constexpr ::athena::Endian SystemEndian = isSystemBigEndian() ? ::athena::Endian::Big : ::athena::Endian::Little;
|
||||||
constexpr ::athena::Endian NotSystemEndian = isSystemBigEndian() ? Little : Big;
|
constexpr ::athena::Endian NotSystemEndian = isSystemBigEndian() ? ::athena::Endian::Little : ::athena::Endian::Big;
|
||||||
|
|
||||||
#if _MSC_VER
|
#if _MSC_VER
|
||||||
#define BSWAP_CONSTEXPR inline
|
#define BSWAP_CONSTEXPR inline
|
||||||
|
|
Loading…
Reference in New Issue