Allow atdna to handle multidimensional arrays

This commit is contained in:
Jack Andersen 2018-07-27 18:30:35 -10:00
parent 61bfac431e
commit d2dbd99ad6
2 changed files with 3 additions and 3 deletions

View File

@ -435,7 +435,7 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor<ATDNAEmitVisitor>
regType = regType->getUnqualifiedDesugaredType(); regType = regType->getUnqualifiedDesugaredType();
/* Resolve constant array */ /* Resolve constant array */
if (regType->getTypeClass() == clang::Type::ConstantArray) while (regType->getTypeClass() == clang::Type::ConstantArray)
{ {
const clang::ConstantArrayType* caType = (clang::ConstantArrayType*)regType; const clang::ConstantArrayType* caType = (clang::ConstantArrayType*)regType;
qualType = caType->getElementType(); qualType = caType->getElementType();
@ -913,7 +913,7 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor<ATDNAEmitVisitor>
regType = regType->getUnqualifiedDesugaredType(); regType = regType->getUnqualifiedDesugaredType();
/* Resolve constant array */ /* Resolve constant array */
if (regType->getTypeClass() == clang::Type::ConstantArray) while (regType->getTypeClass() == clang::Type::ConstantArray)
{ {
const clang::ConstantArrayType* caType = (clang::ConstantArrayType*)regType; const clang::ConstantArrayType* caType = (clang::ConstantArrayType*)regType;
qualType = caType->getElementType(); qualType = caType->getElementType();

View File

@ -12,7 +12,7 @@
namespace athena::utility namespace athena::utility
{ {
inline bool isEmpty(atInt8* buf, atUint32 size) {return !memcmp(buf, buf + 1, size - 1);} inline bool isEmpty(atInt8* buf, atUint32 size) {return !memcmp(buf, buf + 1, size - 1);}
inline bool isSystemBigEndian() {return (*(atUint16*)"\xFE\xFF" == 0xFEFF);} constexpr bool isSystemBigEndian() {return __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__;}
inline atInt16 swap16(atInt16 val) inline atInt16 swap16(atInt16 val)
{ {