Index: src/OFDataArray.h ================================================================== --- src/OFDataArray.h +++ src/OFDataArray.h @@ -125,39 +125,39 @@ /** * Adds an item to the OFDataArray. * * \param item A pointer to an arbitrary item */ -- (void)addItem: (void*)item; +- (void)addItem: (const void*)item; /** * Adds an item to the OFDataArray at the specified index. * * \param item A pointer to an arbitrary item * \param index The index where the item should be added */ -- (void)addItem: (void*)item +- (void)addItem: (const void*)item atIndex: (size_t)index; /** * Adds items from a C array to the OFDataArray. * * \param nitems The number of items to add * \param carray A C array containing the items to add */ - (void)addNItems: (size_t)nitems - fromCArray: (void*)carray; + fromCArray: (const void*)carray; /** * Adds items from a C array to the OFDataArray at the specified index. * * \param nitems The number of items to add * \param carray A C array containing the items to add * \param index The index where the items should be added */ - (void)addNItems: (size_t)nitems - fromCArray: (void*)carray + fromCArray: (const void*)carray atIndex: (size_t)index; /** * Removes the item at the specified index. * Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -164,11 +164,11 @@ return NULL; return data + (count - 1) * itemSize; } -- (void)addItem: (void*)item +- (void)addItem: (const void*)item { if (SIZE_MAX - count < 1) @throw [OFOutOfRangeException newWithClass: isa]; data = [self resizeMemory: data @@ -178,20 +178,20 @@ memcpy(data + count * itemSize, item, itemSize); count++; } -- (void)addItem: (void*)item +- (void)addItem: (const void*)item atIndex: (size_t)index { [self addNItems: 1 fromCArray: item atIndex: index]; } - (void)addNItems: (size_t)nitems - fromCArray: (void*)carray + fromCArray: (const void*)carray { if (nitems > SIZE_MAX - count) @throw [OFOutOfRangeException newWithClass: isa]; data = [self resizeMemory: data @@ -201,11 +201,11 @@ memcpy(data + count * itemSize, carray, nitems * itemSize); count += nitems; } - (void)addNItems: (size_t)nitems - fromCArray: (void*)carray + fromCArray: (const void*)carray atIndex: (size_t)index { if (nitems > SIZE_MAX - count) @throw [OFOutOfRangeException newWithClass: isa]; @@ -333,11 +333,11 @@ return of_base64_encode(data, count * itemSize); } @end @implementation OFBigDataArray -- (void)addItem: (void*)item +- (void)addItem: (const void*)item { size_t nsize, lastpagebyte; if (SIZE_MAX - count < 1 || count + 1 > SIZE_MAX / itemSize) @throw [OFOutOfRangeException newWithClass: isa]; @@ -354,11 +354,11 @@ count++; size = nsize; } - (void)addNItems: (size_t)nitems - fromCArray: (void*)carray + fromCArray: (const void*)carray { size_t nsize, lastpagebyte; if (nitems > SIZE_MAX - count || count + nitems > SIZE_MAX / itemSize) @throw [OFOutOfRangeException newWithClass: isa]; @@ -375,11 +375,11 @@ count += nitems; size = nsize; } - (void)addNItems: (size_t)nitems - fromCArray: (void*)carray + fromCArray: (const void*)carray atIndex: (size_t)index { size_t nsize, lastpagebyte; if (nitems > SIZE_MAX - count || count + nitems > SIZE_MAX / itemSize)