@@ -25,12 +25,13 @@ #import "OFInvalidFormatException.h" #import "OFOutOfRangeException.h" #import "macros.h" -static size_t alignofEncoding(const char **type, size_t *length, bool inStruct); -static size_t sizeofEncoding(const char **type, size_t *length); +static size_t alignmentOfEncoding(const char **type, size_t *length, + bool inStruct); +static size_t sizeOfEncoding(const char **type, size_t *length); static size_t alignofArray(const char **type, size_t *length) { size_t align; @@ -43,11 +44,11 @@ while (*length > 0 && OFASCIIIsDigit(**type)) { (*type)++; (*length)--; } - align = alignofEncoding(type, length, true); + align = alignmentOfEncoding(type, length, true); if (*length == 0 || **type != ']') @throw [OFInvalidFormatException exception]; (*type)++; @@ -81,11 +82,11 @@ /* Skip '=' */ (*type)++; (*length)--; while (*length > 0 && **type != '}') { - size_t fieldAlign = alignofEncoding(type, length, true); + size_t fieldAlign = alignmentOfEncoding(type, length, true); #if defined(OF_POWERPC) && defined(OF_MACOS) if (!first && fieldAlign > 4) fieldAlign = 4; @@ -127,11 +128,11 @@ /* Skip '=' */ (*type)++; (*length)--; while (*length > 0 && **type != ')') { - size_t fieldAlign = alignofEncoding(type, length, true); + size_t fieldAlign = alignmentOfEncoding(type, length, true); if (fieldAlign > align) align = fieldAlign; } @@ -143,11 +144,11 @@ return align; } static size_t -alignofEncoding(const char **type, size_t *length, bool inStruct) +alignmentOfEncoding(const char **type, size_t *length, bool inStruct) { size_t align; if (*length == 0) @throw [OFInvalidFormatException exception]; @@ -237,11 +238,11 @@ return alignofUnion(type, length); case '^': /* Just to skip over the rest */ (*type)++; (*length)--; - alignofEncoding(type, length, false); + alignmentOfEncoding(type, length, false); return OF_ALIGNOF(void *); #ifndef __STDC_NO_COMPLEX__ case 'j': (*type)++; @@ -300,11 +301,11 @@ } if (count == 0) @throw [OFInvalidFormatException exception]; - size = sizeofEncoding(type, length); + size = sizeOfEncoding(type, length); if (*length == 0 || **type != ']') @throw [OFInvalidFormatException exception]; (*type)++; @@ -348,12 +349,12 @@ while (*length > 0 && **type != '}') { size_t fieldSize, fieldAlign; typeCopy = *type; lengthCopy = *length; - fieldSize = sizeofEncoding(type, length); - fieldAlign = alignofEncoding(&typeCopy, &lengthCopy, true); + fieldSize = sizeOfEncoding(type, length); + fieldAlign = alignmentOfEncoding(&typeCopy, &lengthCopy, true); #if defined(OF_POWERPC) && defined(OF_MACOS) if (!first && fieldAlign > 4) fieldAlign = 4; @@ -415,11 +416,11 @@ /* Skip '=' */ (*type)++; (*length)--; while (*length > 0 && **type != ')') { - size_t fieldSize = sizeofEncoding(type, length); + size_t fieldSize = sizeOfEncoding(type, length); if (fieldSize > size) size = fieldSize; } @@ -431,11 +432,11 @@ return size; } static size_t -sizeofEncoding(const char **type, size_t *length) +sizeOfEncoding(const char **type, size_t *length) { size_t size; if (*length == 0) @throw [OFInvalidFormatException exception]; @@ -510,11 +511,11 @@ return sizeofUnion(type, length); case '^': /* Just to skip over the rest */ (*type)++; (*length)--; - sizeofEncoding(type, length); + sizeOfEncoding(type, length); return sizeof(void *); #ifndef __STDC_NO_COMPLEX__ case 'j': (*type)++; @@ -548,26 +549,26 @@ return size; } size_t -of_sizeof_type_encoding(const char *type) +OFSizeOfTypeEncoding(const char *type) { size_t length = strlen(type); - size_t ret = sizeofEncoding(&type, &length); + size_t ret = sizeOfEncoding(&type, &length); if (length > 0) @throw [OFInvalidFormatException exception]; return ret; } size_t -of_alignof_type_encoding(const char *type) +OFAlignmentOfTypeEncoding(const char *type) { size_t length = strlen(type); - size_t ret = alignofEncoding(&type, &length, false); + size_t ret = alignmentOfEncoding(&type, &length, false); if (length > 0) @throw [OFInvalidFormatException exception]; return ret;