Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -408,10 +408,11 @@ block(objs[i], i, &stop); } - (OFArray*)mappedArrayUsingBlock: (of_array_map_block_t)block { + OFArray *ret; size_t count = [array count]; id *tmp = [self allocMemoryForNItems: count withSize: sizeof(id)]; @try { @@ -419,19 +420,22 @@ size_t i; for (i = 0; i < count; i++) tmp[i] = block(objs[i], i); - return [OFArray arrayWithCArray: tmp - length: count]; + ret = [OFArray arrayWithCArray: tmp + length: count]; } @finally { [self freeMemory: tmp]; } + + return ret; } - (OFArray*)filteredArrayUsingBlock: (of_array_filter_block_t)block { + OFArray *ret; size_t count = [array count]; id *tmp = [self allocMemoryForNItems: count withSize: sizeof(id)]; @try { @@ -440,15 +444,17 @@ for (i = 0; i < count; i++) if (block(objs[i], i)) tmp[j++] = objs[i]; - return [OFArray arrayWithCArray: tmp - length: j]; + ret = [OFArray arrayWithCArray: tmp + length: j]; } @finally { [self freeMemory: tmp]; } + + return ret; } #endif - (void)dealloc { Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -343,10 +343,11 @@ LOCALTIME_RET(tm_yday + 1) } - (OFString*)dateStringWithFormat: (OFString*)fmt { + OFString *ret; time_t sec_ = sec; struct tm tm; char *buf; if (sec != sec_) @@ -378,18 +379,21 @@ @try { if (!strftime(buf, of_pagesize, [fmt cString], &tm)) @throw [OFOutOfRangeException newWithClass: isa]; - return [OFString stringWithCString: buf]; + ret = [OFString stringWithCString: buf]; } @finally { [self freeMemory: buf]; } + + return ret; } - (OFString*)localDateStringWithFormat: (OFString*)fmt { + OFString *ret; time_t sec_ = sec; struct tm tm; char *buf; if (sec != sec_) @@ -421,14 +425,16 @@ @try { if (!strftime(buf, of_pagesize, [fmt cString], &tm)) @throw [OFOutOfRangeException newWithClass: isa]; - return [OFString stringWithCString: buf]; + ret = [OFString stringWithCString: buf]; } @finally { [self freeMemory: buf]; } + + return ret; } - (OFDate*)earlierDate: (OFDate*)date { if ([self compare: date] == OF_ORDERED_DESCENDING) Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -642,24 +642,26 @@ fromBuffer: [str cString]]; } - (size_t)writeLine: (OFString*)str { - size_t len = [str cStringLength]; + size_t ret, len = [str cStringLength]; char *buf; buf = [self allocMemoryWithSize: len + 1]; @try { memcpy(buf, [str cString], len); buf[len] = '\n'; - return [self writeNBytes: len + 1 - fromBuffer: buf]; + ret = [self writeNBytes: len + 1 + fromBuffer: buf]; } @finally { [self freeMemory: buf]; } + + return ret; } - (size_t)writeFormat: (OFString*)fmt, ... { va_list args; Index: src/of_asprintf.m ================================================================== --- src/of_asprintf.m +++ src/of_asprintf.m @@ -301,11 +301,14 @@ default: return false; } break; - case 'o': case 'u': case 'x': case 'X': + case 'o': + case 'u': + case 'x': + case 'X': switch (ctx->len_mod) { case LENGTH_MODIFIER_NONE: case LENGTH_MODIFIER_HH: case LENGTH_MODIFIER_H: tmp_len = asprintf(&tmp, ctx->subfmt,