git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32410 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2011-02-28 14:24:57 +00:00
parent c028d0568d
commit 89b2b64d5e
4 changed files with 35 additions and 35 deletions

View file

@ -225,7 +225,7 @@ relativeCenterPosition: (NSPoint)relativeCenterPoint
// FIXME: Convert all colours to colour space
ASSIGN(_colors, colorArray);
_locations = objc_malloc(sizeof(CGFloat)*_numberOfColorStops);
_locations = malloc(sizeof(CGFloat)*_numberOfColorStops);
if (locations)
{
// FIXME: Check that the locations are properly ordered
@ -248,7 +248,7 @@ relativeCenterPosition: (NSPoint)relativeCenterPoint
va_list ap;
unsigned int max = 128;
unsigned int count = 0;
CGFloat *locations = (CGFloat*)objc_malloc(max * sizeof(CGFloat));
CGFloat *locations = (CGFloat*)malloc(max * sizeof(CGFloat));
NSMutableArray *colorArray = [[NSMutableArray alloc] init];
va_start(ap, color);
@ -257,7 +257,7 @@ relativeCenterPosition: (NSPoint)relativeCenterPoint
if (max <= count)
{
max *= 2;
locations = (CGFloat*)objc_realloc(locations, max * sizeof(CGFloat));
locations = (CGFloat*)realloc(locations, max * sizeof(CGFloat));
}
[colorArray addObject: color];
// gcc insists on using double here
@ -272,7 +272,7 @@ relativeCenterPosition: (NSPoint)relativeCenterPoint
colorSpace: nil];
RELEASE(colorArray);
objc_free(locations);
free(locations);
return self;
}
@ -285,7 +285,7 @@ relativeCenterPosition: (NSPoint)relativeCenterPoint
{
RELEASE(_colorSpace);
RELEASE(_colors);
objc_free(_locations);
free(_locations);
[super dealloc];
}
@ -334,7 +334,7 @@ relativeCenterPosition: (NSPoint)relativeCenterPoint
RETAIN(g->_colorSpace);
RETAIN(g->_colors);
g->_locations = objc_malloc(sizeof(CGFloat) * _numberOfColorStops);
g->_locations = malloc(sizeof(CGFloat) * _numberOfColorStops);
memcpy(g->_locations, _locations, sizeof(CGFloat) * _numberOfColorStops);
return g;