Fix clang compiler warnings as reported by Sebastian Reitenbach

<sebastia@l00-bugdead-prods.de>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34608 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2012-01-23 14:27:58 +00:00
parent 81b8b6a826
commit e278d9956c
15 changed files with 87 additions and 41 deletions

View file

@ -519,26 +519,27 @@
}
else
{
unsigned char* bits;
long length;
unsigned char *bits;
NSUInteger length;
unsigned int i;
// No image data was given, allocate it.
length = (long)((_isPlanar) ? _numColors : 1) * _bytesPerRow *
length = (NSUInteger)((_isPlanar) ? _numColors : 1) * _bytesPerRow *
_pixelsHigh * sizeof(unsigned char);
// Create a mutable data object although we never use it as such
_imageData = [[NSMutableData alloc] initWithLength: length];
bits = [_imageData mutableBytes];
bits = (unsigned char *)[_imageData bytes];
_imagePlanes[0] = bits;
if (_isPlanar)
{
for (i=1; i < _numColors; i++)
_imagePlanes[i] = bits + i*_bytesPerRow * _pixelsHigh;
for (i= _numColors; i < MAX_PLANES; i++)
for (i = 1; i < _numColors; i++)
_imagePlanes[i] = bits + i * _bytesPerRow * _pixelsHigh;
for (i = _numColors; i < MAX_PLANES; i++)
_imagePlanes[i] = NULL;
}
else
{
for (i= 1; i < MAX_PLANES; i++)
for (i = 1; i < MAX_PLANES; i++)
_imagePlanes[i] = NULL;
}
}
@ -1766,21 +1767,21 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
}
else
{
unsigned char* bits;
unsigned char *bits;
unsigned int i;
bits = [copy->_imageData mutableBytes];
bits = (unsigned char *)[copy->_imageData bytes];
copy->_imagePlanes[0] = bits;
if (_isPlanar)
{
for (i=1; i < _numColors; i++)
copy->_imagePlanes[i] = bits + i*_bytesPerRow * _pixelsHigh;
for (i= _numColors; i < MAX_PLANES; i++)
for (i = 1; i < _numColors; i++)
copy->_imagePlanes[i] = bits + i * _bytesPerRow * _pixelsHigh;
for (i = _numColors; i < MAX_PLANES; i++)
copy->_imagePlanes[i] = NULL;
}
else
{
for (i= 1; i < MAX_PLANES; i++)
for (i = 1; i < MAX_PLANES; i++)
copy->_imagePlanes[i] = NULL;
}
}