Hi!
I'm developing an iphone application and when I compile it I receive some warnings. The application works, but probably it is interesting to delete all the warnings no?
This is one of them, that I can't undersand, basically because I'm a "rookie" with iPhone SDK and this class comes from another code (free code)
Anyone can help me??
The warning are: warning: implicit declaration of function 'NSAllocateCollectable' warning: initialization makes pointer from integer without a cast
The code is this:
double *MatrixAllocateArray( NSUInteger rows, NSUInteger columns )
{
// Allocate an array to hold [rows][columns] matrix values
NSCParameterAssert(rows!=0);
NSCParameterAssert(columns!=0);
__strong double *array = NSAllocateCollectable(SIZEOFARRAY(rows,columns),0); //(WARNINGS APPEAR HERE)
NSCAssert2(array!=NULL,@"falled to allocate %dx%d matrix",rows,columns);
return array;
}
As you can see this function try to allocate a matrix, and it is called by another function.
double *MatrixAllocateEmptyArray( NSUInteger rows, NSUInteger columns )
{
// Allocate a matrix array and fill it with zeros
__strong double *emptyArray = MatrixAllocateArray(rows,columns);
bzero(emptyArray,SIZEOFARRAY(rows,columns));
return emptyArray;
}
And this is called by the function which I execute and need
- (id)initWithRows:(NSUInteger)rowCount columns:(NSUInteger)colCount
{
// Create an empty matrix
return [self initWithAllocatedArray:MatrixAllocateEmptyArray(rowCount,colCount)
rows:rowCount
columns:colCount];
}
Thanks so much Toni