mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:00:47 +00:00
avoid obsolete macros
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32412 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
89b2b64d5e
commit
fed6ff1796
5 changed files with 115 additions and 107 deletions
|
@ -1,3 +1,11 @@
|
|||
2011-02-28 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSBitmapImageRep.m:
|
||||
* Source/NSBitmapImageRep+GIF.m:
|
||||
* Source/NSBitmapImageRep+JPEG.m:
|
||||
* Source/tiff.m:
|
||||
Avoid obsolete OBJC_... macros
|
||||
|
||||
2011-02-28 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Source/GSLayoutManager.m
|
||||
|
|
|
@ -432,7 +432,7 @@ static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len)
|
|||
}
|
||||
else // interleaved RGB or RGBA
|
||||
{
|
||||
OBJC_MALLOC(rgbPlanes, GifByteType, width*height*3);
|
||||
rgbPlanes = malloc(sizeof(GifByteType)*width*height*3);
|
||||
if (!rgbPlanes)
|
||||
{
|
||||
SET_ERROR_MSG(@"GIFRepresentation: malloc out of memory.");
|
||||
|
@ -461,23 +461,23 @@ static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len)
|
|||
if (!GIFColorMap)
|
||||
{
|
||||
SET_ERROR_MSG(@"GIFRepresentation (giflib): MakeMapObject() failed.");
|
||||
OBJC_FREE(rgbPlanes);
|
||||
free(rgbPlanes);
|
||||
return nil;
|
||||
}
|
||||
|
||||
OBJC_MALLOC(GIFImage, GifByteType, height*width);
|
||||
GIFImage = malloc(sizeof(GifByteType)*height*width);
|
||||
if (!GIFImage)
|
||||
{
|
||||
SET_ERROR_MSG(@"GIFRepresentation: malloc out of memory.");
|
||||
OBJC_FREE(rgbPlanes);
|
||||
free(rgbPlanes);
|
||||
}
|
||||
status = QuantizeBuffer(width, height, &colorMapSize,
|
||||
redPlane, greenPlane, bluePlane,
|
||||
GIFImage, GIFColorMap->Colors);
|
||||
if (status == GIF_ERROR)
|
||||
{
|
||||
OBJC_FREE(GIFImage);
|
||||
OBJC_FREE(rgbPlanes);
|
||||
free(GIFImage);
|
||||
free(rgbPlanes);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -490,13 +490,13 @@ static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len)
|
|||
GIFColorMap->ColorCount = colorMapSize;
|
||||
GIFColorMap->BitsPerPixel = h;
|
||||
|
||||
if ( ![self isPlanar] ) OBJC_FREE(rgbPlanes);
|
||||
if (![self isPlanar]) free(rgbPlanes);
|
||||
|
||||
// Write the converted image out to the NSData
|
||||
GIFRep = [NSMutableData dataWithLength: 0];
|
||||
if (!GIFRep)
|
||||
{
|
||||
OBJC_FREE(GIFImage);
|
||||
free(GIFImage);
|
||||
return nil;
|
||||
}
|
||||
GIFFile = EGifOpen(GIFRep, gs_gif_output);
|
||||
|
@ -504,7 +504,7 @@ static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len)
|
|||
if (status == GIF_ERROR)
|
||||
{
|
||||
SET_ERROR_MSG(@"GIFRepresentation (giflib): EGifPutScreenDesc() failed.");
|
||||
OBJC_FREE(GIFImage);
|
||||
free(GIFImage);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -513,7 +513,7 @@ static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len)
|
|||
if (status == GIF_ERROR)
|
||||
{
|
||||
SET_ERROR_MSG(@"GIFRepresentation (giflib): EGifPutImageDesc() failed.");
|
||||
OBJC_FREE(GIFImage);
|
||||
free(GIFImage);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -524,14 +524,14 @@ static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len)
|
|||
if (status == GIF_ERROR)
|
||||
{
|
||||
SET_ERROR_MSG(@"GIFRepresentation (giflib): EGifPutLine() failed.");
|
||||
OBJC_FREE(GIFImage);
|
||||
free(GIFImage);
|
||||
return nil;
|
||||
}
|
||||
GIFImageP += width;
|
||||
}
|
||||
status = EGifCloseFile(GIFFile);
|
||||
|
||||
OBJC_FREE(GIFImage);
|
||||
free(GIFImage);
|
||||
|
||||
return GIFRep;
|
||||
}
|
||||
|
|
|
@ -634,7 +634,7 @@ static void gs_jpeg_memory_dest_destroy (j_compress_ptr cinfo)
|
|||
{
|
||||
unsigned char * RGB, * pRGB, * pRGBA;
|
||||
unsigned int iRGB, iRGBA;
|
||||
OBJC_MALLOC(RGB, unsigned char, 3*width);
|
||||
RGB = malloc(sizeof(unsigned char)*3*width);
|
||||
while (cinfo.next_scanline < cinfo.image_height)
|
||||
{
|
||||
iRGBA = cinfo.next_scanline * row_stride;
|
||||
|
@ -649,7 +649,7 @@ static void gs_jpeg_memory_dest_destroy (j_compress_ptr cinfo)
|
|||
row_pointer[0] = RGB;
|
||||
jpeg_write_scanlines (&cinfo, row_pointer, 1);
|
||||
}
|
||||
OBJC_FREE(RGB);
|
||||
free(RGB);
|
||||
}
|
||||
else // no alpha channel
|
||||
{
|
||||
|
|
|
@ -1932,12 +1932,12 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
|
|||
|
||||
if (NSTiffRead(image, info, [self bitmapData]))
|
||||
{
|
||||
OBJC_FREE(info);
|
||||
free(info);
|
||||
RELEASE(self);
|
||||
NSLog(@"Tiff read invalid TIFF image data in directory %d", imageNumber);
|
||||
return nil;
|
||||
}
|
||||
OBJC_FREE(info);
|
||||
free(info);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ TiffHandleClose(thandle_t handle)
|
|||
chandle_t* chand = (chandle_t *)handle;
|
||||
|
||||
/* Presumably, we don't need the handle anymore */
|
||||
OBJC_FREE(chand);
|
||||
free(chand);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ NSTiffOpenDataRead(const char* data, long size)
|
|||
TIFFSetWarningHandler(NSTiffWarning);
|
||||
}
|
||||
|
||||
OBJC_MALLOC(handle, chandle_t, 1);
|
||||
handle = malloc(sizeof(chandle_t));
|
||||
handle->data = (char*)data;
|
||||
handle->outdata = 0;
|
||||
handle->position = 0;
|
||||
|
@ -221,7 +221,7 @@ TIFF*
|
|||
NSTiffOpenDataWrite(char **data, long *size)
|
||||
{
|
||||
chandle_t* handle;
|
||||
OBJC_MALLOC(handle, chandle_t, 1);
|
||||
handle = malloc(sizeof(chandle_t));
|
||||
handle->data = *data;
|
||||
handle->outdata = data;
|
||||
handle->position = 0;
|
||||
|
@ -269,7 +269,7 @@ NSTiffGetInfo(int imageNumber, TIFF* image)
|
|||
if (image == NULL)
|
||||
return NULL;
|
||||
|
||||
OBJC_MALLOC(info, NSTiffInfo, 1);
|
||||
info = malloc(sizeof(NSTiffInfo));
|
||||
memset(info, 0, sizeof(NSTiffInfo));
|
||||
if (imageNumber >= 0)
|
||||
{
|
||||
|
@ -567,14 +567,14 @@ NSTiffGetColormap(TIFF* image)
|
|||
if (info->photoInterp != PHOTOMETRIC_PALETTE)
|
||||
return NULL;
|
||||
|
||||
OBJC_MALLOC(map, NSTiffColormap, 1);
|
||||
map = malloc(sizeof(NSTiffColormap));
|
||||
map->size = 1 << info->bitsPerSample;
|
||||
|
||||
if (!TIFFGetField(image, TIFFTAG_COLORMAP,
|
||||
&map->red, &map->green, &map->blue))
|
||||
{
|
||||
TIFFError(TIFFFileName(image), "Missing required \"Colormap\" tag");
|
||||
OBJC_FREE(map);
|
||||
free(map);
|
||||
return NULL;
|
||||
}
|
||||
if (CheckAndCorrectColormap(map) == 8)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue