Cocoa Port: Do some minor code cleanup.

This commit is contained in:
rogerman 2017-08-22 21:31:28 -07:00
parent 2746427dd7
commit 3a63db2086
3 changed files with 9 additions and 14 deletions

View File

@ -722,10 +722,9 @@
pthread_rwlock_unlock(self.rwlockProducer);
#ifdef MSB_FIRST
uint32_t *bitmapDataEnd = bitmapData + (w * h);
while (bitmapData < bitmapDataEnd)
for (size_t i = 0; i < w * h; i++)
{
*bitmapData++ = CFSwapInt32LittleToHost(*bitmapData);
bitmapData[i] = LE_TO_LOCAL_32(bitmapData[i]);
}
#endif

View File

@ -412,17 +412,15 @@ static NSMutableDictionary *saveTypeValues = nil;
return newImage;
}
NSUInteger w = ROM_ICON_WIDTH;
NSUInteger h = ROM_ICON_HEIGHT;
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
pixelsWide:w
pixelsHigh:h
pixelsWide:ROM_ICON_WIDTH
pixelsHigh:ROM_ICON_HEIGHT
bitsPerSample:8
samplesPerPixel:4
hasAlpha:YES
isPlanar:NO
colorSpaceName:NSCalibratedRGBColorSpace
bytesPerRow:w * 4
bytesPerRow:ROM_ICON_WIDTH * 4
bitsPerPixel:32];
if(imageRep == nil)
@ -436,10 +434,9 @@ static NSMutableDictionary *saveTypeValues = nil;
RomIconToRGBA8888(bitmapData);
#ifdef MSB_FIRST
uint32_t *bitmapDataEnd = bitmapData + (w * h);
while (bitmapData < bitmapDataEnd)
for (size_t i = 0; i < ROM_ICON_WIDTH * ROM_ICON_HEIGHT; i++)
{
*bitmapData++ = CFSwapInt32LittleToHost(*bitmapData);
bitmapData[i] = LE_TO_LOCAL_32(bitmapData[i]);
}
#endif

View File

@ -142,10 +142,9 @@
ColorspaceConvertBuffer888XTo8888Opaque<false, true>((const uint32_t *)[self runFilter], bitmapData, w * h);
#ifdef MSB_FIRST
uint32_t *bitmapDataEnd = bitmapData + (w * h);
while (bitmapData < bitmapDataEnd)
for (size_t i = 0; i < w * h; i++)
{
*bitmapData++ = CFSwapInt32LittleToHost(*bitmapData);
bitmapData[i] = LE_TO_LOCAL_32(bitmapData[i]);
}
#endif