@@ -177,11 +177,11 @@ self = [super init]; @try { _s = &_storage; - _s->cString = [self allocMemoryWithSize: 1]; + _s->cString = (void *)[self allocMemoryWithSize: 1]; _s->cString[0] = '\0'; } @catch (id e) { [self release]; @throw e; } @@ -243,11 +243,12 @@ cStringLength -= 3; } _s = &_storage; - _s->cString = [self allocMemoryWithSize: cStringLength + 1]; + _s->cString = (void *)[self + allocMemoryWithSize: cStringLength + 1]; _s->cStringLength = cStringLength; if (encoding == OF_STRING_ENCODING_UTF_8 || encoding == OF_STRING_ENCODING_ASCII) { switch (of_string_utf8_check(cString, cStringLength, @@ -290,11 +291,11 @@ if (bytes == 0) @throw [OFInvalidEncodingException exception]; _s->cStringLength += bytes - 1; - _s->cString = [self + _s->cString = (void *)[self resizeMemory: _s->cString size: _s->cStringLength + 1]; memcpy(_s->cString + j, buffer, bytes); j += bytes; @@ -371,11 +372,11 @@ if (byteLength == 0) @throw [OFInvalidEncodingException exception]; _s->cStringLength += byteLength - 1; - _s->cString = [self + _s->cString = (void *)[self resizeMemory: _s->cString size: _s->cStringLength + 1]; memcpy(_s->cString + j, buffer, byteLength); j += byteLength; @@ -443,11 +444,12 @@ else _s->isUTF8 = true; _s->length = [string length]; - _s->cString = [self allocMemoryWithSize: _s->cStringLength + 1]; + _s->cString = (void *)[self + allocMemoryWithSize: _s->cStringLength + 1]; memcpy(_s->cString, [string UTF8String], _s->cStringLength + 1); } @catch (id e) { [self release]; @throw e; } @@ -463,11 +465,12 @@ @try { size_t j; _s = &_storage; - _s->cString = [self allocMemoryWithSize: (length * 4) + 1]; + _s->cString = (void *)[self + allocMemoryWithSize: (length * 4) + 1]; _s->length = length; j = 0; for (size_t i = 0; i < length; i++) { size_t len = of_string_utf8_encode(characters[i], @@ -484,12 +487,12 @@ _s->cString[j] = '\0'; _s->cStringLength = j; @try { - _s->cString = [self resizeMemory: _s->cString - size: j + 1]; + _s->cString = (void *)[self resizeMemory: _s->cString + size: j + 1]; } @catch (OFOutOfMemoryException *e) { /* We don't care, as we only tried to make it smaller */ } } @catch (id e) { [self release]; @@ -519,11 +522,12 @@ } else if (byteOrder != OF_BYTE_ORDER_NATIVE) swap = true; _s = &_storage; - _s->cString = [self allocMemoryWithSize: (length * 4) + 1]; + _s->cString = (void *)[self + allocMemoryWithSize: (length * 4) + 1]; _s->length = length; j = 0; for (size_t i = 0; i < length; i++) { of_unichar_t character = @@ -569,12 +573,12 @@ _s->cString[j] = '\0'; _s->cStringLength = j; @try { - _s->cString = [self resizeMemory: _s->cString - size: j + 1]; + _s->cString = (void *)[self resizeMemory: _s->cString + size: j + 1]; } @catch (OFOutOfMemoryException *e) { /* We don't care, as we only tried to make it smaller */ } } @catch (id e) { [self release]; @@ -604,11 +608,12 @@ } else if (byteOrder != OF_BYTE_ORDER_NATIVE) swap = true; _s = &_storage; - _s->cString = [self allocMemoryWithSize: (length * 4) + 1]; + _s->cString = (void *)[self + allocMemoryWithSize: (length * 4) + 1]; _s->length = length; j = 0; for (size_t i = 0; i < length; i++) { char buffer[4]; @@ -636,12 +641,12 @@ _s->cString[j] = '\0'; _s->cStringLength = j; @try { - _s->cString = [self resizeMemory: _s->cString - size: j + 1]; + _s->cString = (void *)[self resizeMemory: _s->cString + size: j + 1]; } @catch (OFOutOfMemoryException *e) { /* We don't care, as we only tried to make it smaller */ } } @catch (id e) { [self release]; @@ -679,11 +684,11 @@ break; case -1: @throw [OFInvalidEncodingException exception]; } - _s->cString = [self + _s->cString = (void *)[self allocMemoryWithSize: cStringLength + 1]; memcpy(_s->cString, tmp, cStringLength + 1); } @finally { free(tmp); }