Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -201,11 +201,11 @@ /*! * @brief Returns the objects of the array as a C array. * * @return The objects of the array as a C array */ -- (id*)objects; +- (id const*)objects; /*! * @brief Returns the index of the first object that is equivalent to the * specified object or `OF_NOT_FOUND` if it was not found. * Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -241,11 +241,11 @@ for (i = 0; i < range.length; i++) buffer[i] = [self objectAtIndex: range.location + i]; } -- (id*)objects +- (id const*)objects { OFObject *container; size_t count; id *buffer; @@ -396,11 +396,11 @@ usingSelector: (SEL)selector options: (int)options { void *pool; OFMutableString *ret; - id *objects; + id const *objects; size_t i, count; if (separator == nil) @throw [OFInvalidArgumentException exception]; @@ -474,11 +474,11 @@ return true; } - (uint32_t)hash { - id *objects = [self objects]; + id const *objects = [self objects]; size_t i, count = [self count]; uint32_t hash; OF_HASH_INIT(hash); @@ -520,11 +520,11 @@ - (OFXMLElement*)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; - id *objects = [self objects]; + id const *objects = [self objects]; size_t i, count = [self count]; if ([self isKindOfClass: [OFMutableArray class]]) element = [OFXMLElement elementWithName: @"OFMutableArray" namespace: OF_SERIALIZATION_NS]; @@ -674,21 +674,21 @@ return data; } - (void)makeObjectsPerformSelector: (SEL)selector { - id *objects = [self objects]; + id const *objects = [self objects]; size_t i, count = [self count]; for (i = 0; i < count; i++) [objects[i] performSelector: selector]; } - (void)makeObjectsPerformSelector: (SEL)selector withObject: (id)object { - id *objects = [self objects]; + id const *objects = [self objects]; size_t i, count = [self count]; for (i = 0; i < count; i++) [objects[i] performSelector: selector withObject: object]; Index: src/OFArray_adjacent.m ================================================================== --- src/OFArray_adjacent.m +++ src/OFArray_adjacent.m @@ -88,11 +88,11 @@ return self; } - initWithArray: (OFArray*)array { - id *objects; + id const *objects; size_t i, count; self = [super init]; if (array == nil) @@ -204,11 +204,11 @@ - (size_t)count { return [_array count]; } -- (id*)objects +- (id const*)objects { return [_array items]; } - (id)objectAtIndex: (size_t)index @@ -288,11 +288,11 @@ } - (bool)isEqual: (id)object { OFArray *otherArray; - id *objects, *otherObjects; + id const *objects, *otherObjects; size_t i, count; if ([object class] != [OFArray_adjacent class] && [object class] != [OFMutableArray_adjacent class] && [object class] != [OFArray_adjacentSubarray class]) Index: src/OFArray_adjacentSubarray.m ================================================================== --- src/OFArray_adjacentSubarray.m +++ src/OFArray_adjacentSubarray.m @@ -19,19 +19,19 @@ #import "OFArray_adjacentSubarray.h" #import "OFArray_adjacent.h" #import "OFMutableArray_adjacent.h" @implementation OFArray_adjacentSubarray -- (id*)objects +- (const id*)objects { return [_array objects] + _range.location; } - (bool)isEqual: (id)object { OFArray *otherArray; - id *objects, *otherObjects; + id const *objects, *otherObjects; size_t i; if ([object class] != [OFArray_adjacent class] && [object class] != [OFMutableArray_adjacent class] && [object class] != [OFArray_adjacentSubarray class]) @@ -53,14 +53,14 @@ } #ifdef OF_HAVE_BLOCKS - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block { - id *objects = [self objects]; + id const *objects = [self objects]; size_t i; bool stop = false; for (i = 0; i < _range.length && !stop; i++) block(objects[i], i, &stop); } #endif @end Index: src/OFCountedSet_hashtable.m ================================================================== --- src/OFCountedSet_hashtable.m +++ src/OFCountedSet_hashtable.m @@ -79,11 +79,11 @@ - initWithArray: (OFArray*)array { self = [self init]; @try { - id *objects = [array objects]; + id const *objects = [array objects]; size_t i, count = [array count]; for (i = 0; i < count; i++) [self addObject: objects[i]]; } @catch (id e) { Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -221,11 +221,11 @@ } - initWithObjects: (OFArray*)objects_ forKeys: (OFArray*)keys_ { - id *objects, *keys; + id const *objects, *keys; size_t count; @try { count = [objects_ count]; Index: src/OFKernelEventObserver.m ================================================================== --- src/OFKernelEventObserver.m +++ src/OFKernelEventObserver.m @@ -305,11 +305,11 @@ { #ifdef OF_HAVE_THREADS [_mutex lock]; #endif @try { - id *queueObjects = [_queue objects]; + id const *queueObjects = [_queue objects]; int *queueInfoItems = [_queueInfo items]; int *queueFDsItems = [_queueFDs items]; size_t i, count = [_queue count]; for (i = 0; i < count; i++) { @@ -399,11 +399,11 @@ #endif } - (bool)OF_processCache { - id *objects = [_readObjects objects]; + id const *objects = [_readObjects objects]; size_t i, count = [_readObjects count]; bool foundInCache = false; for (i = 0; i < count; i++) { if ([objects[i] isKindOfClass: [OFStream class]] && Index: src/OFKernelEventObserver_select.m ================================================================== --- src/OFKernelEventObserver_select.m +++ src/OFKernelEventObserver_select.m @@ -66,11 +66,11 @@ } - (bool)observeForTimeInterval: (of_time_interval_t)timeInterval { void *pool = objc_autoreleasePoolPush(); - id *objects; + id const *objects; fd_set readFDs; fd_set writeFDs; struct timeval timeout; size_t i, count, realEvents = 0; Index: src/OFMutableArray_adjacent.m ================================================================== --- src/OFMutableArray_adjacent.m +++ src/OFMutableArray_adjacent.m @@ -77,11 +77,11 @@ } - (void)insertObjectsFromArray: (OFArray*)array atIndex: (size_t)index { - id *objects = [array objects]; + id const *objects = [array objects]; size_t i, count = [array count]; @try { [_array insertItems: objects atIndex: index Index: src/OFProcess.m ================================================================== --- src/OFProcess.m +++ src/OFProcess.m @@ -141,11 +141,11 @@ @throw [OFInitializationFailedException exceptionWithClass: [self class]]; switch ((_pid = fork())) { case 0:; - OFString **objects = [arguments objects]; + OFString *const *objects = [arguments objects]; size_t i, count = [arguments count]; char **argv; of_string_encoding_t encoding; argv = [self allocMemoryWithSize: sizeof(char*) Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -421,11 +421,11 @@ } - (OFString*)stringValue { OFMutableString *ret; - OFXMLElement **objects; + OFXMLElement *const *objects; size_t i, count = [_children count]; if (count == 0) return @""; @@ -452,11 +452,11 @@ { void *pool; char *cString; size_t length, i, j, attributesCount; OFString *prefix, *parentPrefix; - OFXMLAttribute **attributesObjects; + OFXMLAttribute *const *attributesObjects; OFString *ret; OFString *defaultNS; pool = objc_autoreleasePoolPush(); @@ -593,11 +593,11 @@ objc_autoreleasePoolPop(pool2); } /* Childen */ if (_children != nil) { - OFXMLElement **childrenObjects = [_children objects]; + OFXMLElement *const *childrenObjects = [_children objects]; size_t childrenCount = [_children count]; OFDataArray *tmp = [OFDataArray dataArray]; bool indent; if (indentation > 0) { @@ -821,11 +821,11 @@ objc_autoreleasePoolPop(pool); } - (OFXMLAttribute*)attributeForName: (OFString*)attributeName { - OFXMLAttribute **objects = [_attributes objects]; + OFXMLAttribute *const *objects = [_attributes objects]; size_t i, count = [_attributes count]; for (i = 0; i < count; i++) if (objects[i]->_namespace == nil && [objects[i]->_name isEqual: attributeName]) @@ -835,11 +835,11 @@ } - (OFXMLAttribute*)attributeForName: (OFString*)attributeName namespace: (OFString*)attributeNS { - OFXMLAttribute **objects; + OFXMLAttribute *const *objects; size_t i, count; if (attributeNS == nil) return [self attributeForName: attributeName]; @@ -854,11 +854,11 @@ return nil; } - (void)removeAttributeForName: (OFString*)attributeName { - OFXMLAttribute **objects = [_attributes objects]; + OFXMLAttribute *const *objects = [_attributes objects]; size_t i, count = [_attributes count]; for (i = 0; i < count; i++) { if (objects[i]->_namespace == nil && [objects[i]->_name isEqual: attributeName]) { @@ -870,11 +870,11 @@ } - (void)removeAttributeForName: (OFString*)attributeName namespace: (OFString*)attributeNS { - OFXMLAttribute **objects; + OFXMLAttribute *const *objects; size_t i, count; if (attributeNS == nil) { [self removeAttributeForName: attributeName]; return; @@ -1012,11 +1012,11 @@ } - (OFArray*)elements { OFMutableArray *ret = [OFMutableArray array]; - OFXMLElement **objects = [_children objects]; + OFXMLElement *const *objects = [_children objects]; size_t i, count = [_children count]; for (i = 0; i < count; i++) if ([objects[i] isKindOfClass: [OFXMLElement class]]) [ret addObject: objects[i]]; @@ -1027,11 +1027,11 @@ } - (OFArray*)elementsForName: (OFString*)elementName { OFMutableArray *ret = [OFMutableArray array]; - OFXMLElement **objects = [_children objects]; + OFXMLElement *const *objects = [_children objects]; size_t i, count = [_children count]; for (i = 0; i < count; i++) if ([objects[i] isKindOfClass: [OFXMLElement class]] && objects[i]->_namespace == nil && @@ -1044,11 +1044,11 @@ } - (OFArray*)elementsForNamespace: (OFString*)elementNS { OFMutableArray *ret = [OFMutableArray array]; - OFXMLElement **objects = [_children objects]; + OFXMLElement *const *objects = [_children objects]; size_t i, count = [_children count]; for (i = 0; i < count; i++) if ([objects[i] isKindOfClass: [OFXMLElement class]] && objects[i]->_name != nil && @@ -1062,11 +1062,11 @@ - (OFArray*)elementsForName: (OFString*)elementName namespace: (OFString*)elementNS { OFMutableArray *ret; - OFXMLElement **objects; + OFXMLElement *const *objects; size_t i, count; if (elementNS == nil) return [self elementsForName: elementName]; Index: src/OFXMLElementBuilder.m ================================================================== --- src/OFXMLElementBuilder.m +++ src/OFXMLElementBuilder.m @@ -87,11 +87,11 @@ prefix: (OFString*)prefix namespace: (OFString*)namespace attributes: (OFArray*)attributes { OFXMLElement *element; - OFXMLAttribute **objects; + OFXMLAttribute *const *objects; size_t i, count; element = [OFXMLElement elementWithName: name namespace: namespace]; Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -97,11 +97,11 @@ } static OFString* namespaceForPrefix(OFString *prefix, OFArray *namespaces) { - OFDictionary **objects = [namespaces objects]; + OFDictionary *const *objects = [namespaces objects]; ssize_t i; if (prefix == nil) prefix = @""; @@ -698,11 +698,11 @@ /* Inside a tag, name found */ - (void)OF_inTagState { void *pool; OFString *namespace; - OFXMLAttribute **attributesObjects; + OFXMLAttribute *const *attributesObjects; size_t j, attributesCount; if (_data[_i] != '>' && _data[_i] != '/') { if (_data[_i] != ' ' && _data[_i] != '\t' && _data[_i] != '\n' && _data[_i] != '\r') {