Differences From Artifact [9c702fcecb]:
- File
src/OFMethodSignature.m
— part of check-in
[5c0117205d]
at
2022-11-06 21:19:39
on branch trunk
— Work around an ICE in Clang 3.7.0 on Windows/x86
Apparently the optimizer crashes on some recursive functions. (user: js, size: 12883) [annotate] [blame] [check-ins using] [more...]
To Artifact [90c71645ee]:
- File
src/OFMethodSignature.m
— part of check-in
[c86b8f10f0]
at
2022-11-16 01:27:26
on branch trunk
— Add OFAssert()
This uses the same format as OFEnsure(). (user: js, size: 12896) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
11 12 13 14 15 16 17 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" | < > | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #include <ctype.h> #import "OFMethodSignature.h" #import "OFData.h" #import "OFString.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFOutOfRangeException.h" #import "macros.h" 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 alignmentOfArray(const char **type, size_t *length) { size_t alignment; OFAssert(*length > 0); (*type)++; (*length)--; while (*length > 0 && OFASCIIIsDigit(**type)) { (*type)++; (*length)--; |
︙ | ︙ | |||
61 62 63 64 65 66 67 | alignmentOfStruct(const char **type, size_t *length) { size_t alignment = 0; #if defined(OF_POWERPC) && defined(OF_MACOS) bool first = true; #endif | | | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | alignmentOfStruct(const char **type, size_t *length) { size_t alignment = 0; #if defined(OF_POWERPC) && defined(OF_MACOS) bool first = true; #endif OFAssert(*length > 0); (*type)++; (*length)--; /* Skip name */ while (*length > 0 && **type != '=') { (*type)++; |
︙ | ︙ | |||
107 108 109 110 111 112 113 | } static size_t alignmentOfUnion(const char **type, size_t *length) { size_t alignment = 0; | | | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | } static size_t alignmentOfUnion(const char **type, size_t *length) { size_t alignment = 0; OFAssert(*length > 0); (*type)++; (*length)--; /* Skip name */ while (*length > 0 && **type != '=') { (*type)++; |
︙ | ︙ | |||
288 289 290 291 292 293 294 | static size_t sizeOfArray(const char **type, size_t *length) { size_t count = 0; size_t size; | | | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | static size_t sizeOfArray(const char **type, size_t *length) { size_t count = 0; size_t size; OFAssert(*length > 0); (*type)++; (*length)--; while (*length > 0 && OFASCIIIsDigit(**type)) { count = count * 10 + **type - '0'; |
︙ | ︙ | |||
328 329 330 331 332 333 334 | const char *typeCopy = *type; size_t lengthCopy = *length; size_t alignment = alignmentOfStruct(&typeCopy, &lengthCopy); #if defined(OF_POWERPC) && defined(OF_MACOS) bool first = true; #endif | | | 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | const char *typeCopy = *type; size_t lengthCopy = *length; size_t alignment = alignmentOfStruct(&typeCopy, &lengthCopy); #if defined(OF_POWERPC) && defined(OF_MACOS) bool first = true; #endif OFAssert(*length > 0); (*type)++; (*length)--; /* Skip name */ while (*length > 0 && **type != '=') { (*type)++; |
︙ | ︙ | |||
401 402 403 404 405 406 407 | } static size_t sizeOfUnion(const char **type, size_t *length) { size_t size = 0; | | | 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 | } static size_t sizeOfUnion(const char **type, size_t *length) { size_t size = 0; OFAssert(*length > 0); (*type)++; (*length)--; /* Skip name */ while (*length > 0 && **type != '=') { (*type)++; |
︙ | ︙ |