Index: src/OFExceptions.h ================================================================== --- src/OFExceptions.h +++ src/OFExceptions.h @@ -95,22 +95,22 @@ /** * \param class_ The class of the object which caused the exception * \param size The size of the memory that couldn't be allocated * \return A new no memory exception */ -+ newWithClass: (Class)class_ - size: (size_t)size; ++ newWithClass: (Class)class_ + requestedSize: (size_t)size; /** * Initializes an already allocated no memory exception. * * \param class_ The class of the object which caused the exception * \param size The size of the memory that couldn't be allocated * \return An initialized no memory exception */ - initWithClass: (Class)class_ - size: (size_t)size; + requestedSize: (size_t)size; /** * \return The size of the memoory that couldn't be allocated */ - (size_t)requestedSize; @@ -334,22 +334,22 @@ /** * \param class_ The class of the object which caused the exception * \param size The requested size of the data that couldn't be read / written * \return A new open file failed exception */ -+ newWithClass: (Class)class_ - size: (size_t)size; ++ newWithClass: (Class)class_ + requestedSize: (size_t)size; /** * Initializes an already allocated read or write failed exception. * * \param class_ The class of the object which caused the exception * \param size The requested size of the data that couldn't be read / written * \return A new open file failed exception */ - initWithClass: (Class)class_ - size: (size_t)size; + requestedSize: (size_t)size; /** * \return The errno from when the exception was created */ - (int)errNo; Index: src/OFExceptions.m ================================================================== --- src/OFExceptions.m +++ src/OFExceptions.m @@ -189,19 +189,19 @@ selector: _cmd]; } @end @implementation OFOutOfMemoryException -+ newWithClass: (Class)class_ - size: (size_t)size ++ newWithClass: (Class)class_ + requestedSize: (size_t)size { return [[self alloc] initWithClass: class_ - size: size]; + requestedSize: size]; } - initWithClass: (Class)class_ - size: (size_t)size + requestedSize: (size_t)size { self = [super initWithClass: class_]; requestedSize = size; @@ -516,15 +516,15 @@ return mode; } @end @implementation OFReadOrWriteFailedException -+ newWithClass: (Class)class_ - size: (size_t)size ++ newWithClass: (Class)class_ + requestedSize: (size_t)size { return [[self alloc] initWithClass: class_ - size: size]; + requestedSize: size]; } - initWithClass: (Class)class_ { Class c = isa; @@ -532,11 +532,11 @@ @throw [OFNotImplementedException newWithClass: c selector: _cmd]; } - initWithClass: (Class)class_ - size: (size_t)size + requestedSize: (size_t)size { self = [super initWithClass: class_]; requestedSize = size; Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -468,11 +468,11 @@ { size_t ret; if (fd == -1 || eos) @throw [OFReadFailedException newWithClass: isa - size: size]; + requestedSize: size]; if ((ret = read(fd, buf, size)) == 0) eos = YES; return ret; } @@ -482,11 +482,11 @@ { size_t ret; if (fd == -1 || eos || (ret = write(fd, buf, size)) < size) @throw [OFWriteFailedException newWithClass: isa - size: size]; + requestedSize: size]; return ret; } - (void)_seekToOffset: (off_t)offset Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -499,11 +499,11 @@ @throw [OFOutOfRangeException newWithClass: isa]; if ((memchunks = realloc(PRE_IVAR->memchunks, memchunks_size * sizeof(void*))) == NULL) @throw [OFOutOfMemoryException newWithClass: isa - size: memchunks_size]; + requestedSize: memchunks_size]; PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[PRE_IVAR->memchunks_size] = ptr; PRE_IVAR->memchunks_size = memchunks_size; } @@ -522,17 +522,17 @@ memchunks_size > SIZE_MAX / sizeof(void*)) @throw [OFOutOfRangeException newWithClass: isa]; if ((ptr = malloc(size)) == NULL) @throw [OFOutOfMemoryException newWithClass: isa - size: size]; + requestedSize: size]; if ((memchunks = realloc(PRE_IVAR->memchunks, memchunks_size * sizeof(void*))) == NULL) { free(ptr); @throw [OFOutOfMemoryException newWithClass: isa - size: memchunks_size]; + requestedSize: memchunks_size]; } PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[PRE_IVAR->memchunks_size] = ptr; PRE_IVAR->memchunks_size = memchunks_size; @@ -569,12 +569,12 @@ while (iter-- > PRE_IVAR->memchunks) { if (OF_UNLIKELY(*iter == ptr)) { if (OF_UNLIKELY((ptr = realloc(ptr, size)) == NULL)) @throw [OFOutOfMemoryException - newWithClass: isa - size: size]; + newWithClass: isa + requestedSize: size]; *iter = ptr; return ptr; } } Index: src/OFStreamSocket.m ================================================================== --- src/OFStreamSocket.m +++ src/OFStreamSocket.m @@ -69,11 +69,11 @@ errno = ENOTCONN; #endif if (eos || (ret = recv(sock, buf, size, 0)) < 0) @throw [OFReadFailedException newWithClass: isa - size: size]; + requestedSize: size]; if (ret == 0) eos = YES; return ret; @@ -93,11 +93,11 @@ errno = ENOTCONN; #endif if (eos || (ret = send(sock, buf, size, 0)) == -1) @throw [OFWriteFailedException newWithClass: isa - size: size]; + requestedSize: size]; /* This is safe, as we already checked for -1 */ return ret; } Index: src/OFString+URLEncoding.m ================================================================== --- src/OFString+URLEncoding.m +++ src/OFString+URLEncoding.m @@ -36,11 +36,11 @@ * Oh, and we can't use [self allocWithSize:] here as self might be a * @"" literal. */ if ((ret_c = malloc((length * 3) + 1)) == NULL) @throw [OFOutOfMemoryException newWithClass: isa - size: (length * 3) + 1]; + requestedSize: (length * 3) + 1]; for (i = 0; *s != '\0'; s++) { if (isalnum((int)*s) || *s == '-' || *s == '_' || *s == '.' || *s == '~') ret_c[i++] = *s; @@ -76,11 +76,11 @@ s = string; if ((ret_c = malloc(length + 1)) == NULL) @throw [OFOutOfMemoryException newWithClass: isa - size: length + 1]; + requestedSize: length + 1]; for (st = 0, i = 0, c = 0; *s; s++) { switch (st) { case 0: if (*s == '%') Index: src/OFString+XMLEscaping.m ================================================================== --- src/OFString+XMLEscaping.m +++ src/OFString+XMLEscaping.m @@ -34,11 +34,11 @@ /* * We can't use allocMemoryWithSize: here as it might be a @"" literal */ if ((str_c = malloc(len)) == NULL) @throw [OFOutOfMemoryException newWithClass: isa - size: len]; + requestedSize: len]; for (i = 0; i < length; i++) { switch (string[i]) { case '<': append = "<"; @@ -67,12 +67,12 @@ if (append != NULL) { if ((tmp = realloc(str_c, len + append_len)) == NULL) { free(str_c); @throw [OFOutOfMemoryException - newWithClass: isa - size: len + append_len]; + newWithClass: isa + requestedSize: len + append_len]; } str_c = tmp; len += append_len - 1; memcpy(str_c + j, append, append_len); Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -587,13 +587,13 @@ case -1:; @throw [OFInvalidEncodingException newWithClass: isa]; } if ((string = strdup(string)) == NULL) - @throw [OFOutOfMemoryException newWithClass: isa - size: length + - 1]; + @throw [OFOutOfMemoryException + newWithClass: isa + requestedSize: length + 1]; @try { [self addMemoryToPool: string]; } @catch (id e) { free(string);