mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
tidyup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32410 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b2d830cbf4
commit
e1fdfb3ee4
4 changed files with 35 additions and 35 deletions
|
@ -63,7 +63,7 @@
|
|||
|
||||
_selectorsCount = [sels count];
|
||||
|
||||
_selectors = objc_malloc (sizeof (SEL) * _selectorsCount);
|
||||
_selectors = malloc (sizeof (SEL) * _selectorsCount);
|
||||
|
||||
for (i = 0; i < _selectorsCount; i++)
|
||||
{
|
||||
|
@ -84,7 +84,7 @@
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
objc_free (_selectors);
|
||||
free (_selectors);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@
|
|||
else
|
||||
{
|
||||
_bindingsCount++;
|
||||
_bindings = objc_realloc (_bindings, sizeof (struct _GSKeyBinding)
|
||||
_bindings = realloc (_bindings, sizeof (struct _GSKeyBinding)
|
||||
* _bindingsCount);
|
||||
}
|
||||
_bindings[_bindingsCount - 1].character = character;
|
||||
|
@ -266,7 +266,7 @@
|
|||
RELEASE (_bindings[i].action);
|
||||
RELEASE (_bindings[i].table);
|
||||
}
|
||||
objc_free (_bindings);
|
||||
free (_bindings);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ static void run_remove(glyph_run_head_t **context, glyph_run_t *r)
|
|||
|
||||
// Free the glyphs
|
||||
if (r->glyphs)
|
||||
objc_free(r->glyphs);
|
||||
free(r->glyphs);
|
||||
|
||||
h = &r->head;
|
||||
if (h->next)
|
||||
|
@ -104,7 +104,7 @@ static void run_remove(glyph_run_head_t **context, glyph_run_t *r)
|
|||
context[i]->next = context[i]->next->next;
|
||||
|
||||
h -= r->level;
|
||||
objc_free(h);
|
||||
free(h);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -116,7 +116,7 @@ static inline void run_free_glyphs(glyph_run_t *r)
|
|||
{
|
||||
r->head.complete = 0;
|
||||
r->head.glyph_length = 0;
|
||||
objc_free(r->glyphs);
|
||||
free(r->glyphs);
|
||||
r->glyphs = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -230,16 +230,16 @@ Private method used internally by GSLayoutManager for sanity checking.
|
|||
{
|
||||
next = (glyph_run_t *)cur->head.next;
|
||||
if (cur->glyphs)
|
||||
objc_free(cur->glyphs);
|
||||
free(cur->glyphs);
|
||||
[self _run_free_attributes: cur];
|
||||
// Find the start of the allocated memory
|
||||
h = &cur->head;
|
||||
h -= cur->level;
|
||||
objc_free(h);
|
||||
free(h);
|
||||
}
|
||||
|
||||
// Free the head element
|
||||
objc_free(glyphs);
|
||||
free(glyphs);
|
||||
glyphs = NULL;
|
||||
}
|
||||
|
||||
|
@ -1795,12 +1795,12 @@ places where we switch.
|
|||
for (j = 0, lf = tc->linefrags; j < tc->num_linefrags + tc->num_soft; j++, lf++)
|
||||
{
|
||||
if (lf->points)
|
||||
objc_free(lf->points);
|
||||
free(lf->points);
|
||||
if (lf->attachments)
|
||||
objc_free(lf->attachments);
|
||||
free(lf->attachments);
|
||||
}
|
||||
|
||||
objc_free(tc->linefrags);
|
||||
free(tc->linefrags);
|
||||
}
|
||||
tc->linefrags = NULL;
|
||||
tc->num_linefrags = tc->num_soft = 0;
|
||||
|
@ -1887,12 +1887,12 @@ places where we switch.
|
|||
{
|
||||
if (lf->points)
|
||||
{
|
||||
objc_free(lf->points);
|
||||
free(lf->points);
|
||||
lf->points = NULL;
|
||||
}
|
||||
if (lf->attachments)
|
||||
{
|
||||
objc_free(lf->attachments);
|
||||
free(lf->attachments);
|
||||
lf->attachments = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1967,12 +1967,12 @@ places where we switch.
|
|||
{
|
||||
if (lf->points)
|
||||
{
|
||||
objc_free(lf->points);
|
||||
free(lf->points);
|
||||
lf->points = NULL;
|
||||
}
|
||||
if (lf->attachments)
|
||||
{
|
||||
objc_free(lf->attachments);
|
||||
free(lf->attachments);
|
||||
lf->attachments = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -2195,7 +2195,7 @@ by calling this incorrectly.
|
|||
if (tc->size_linefrags <= tc->num_linefrags)
|
||||
{
|
||||
tc->size_linefrags += tc->size_linefrags / 2;
|
||||
tc->linefrags = objc_realloc(tc->linefrags, sizeof(linefrag_t) * tc->size_linefrags);
|
||||
tc->linefrags = realloc(tc->linefrags, sizeof(linefrag_t) * tc->size_linefrags);
|
||||
}
|
||||
tc->num_linefrags++;
|
||||
lf = &tc->linefrags[tc->num_linefrags - 1];
|
||||
|
@ -2209,12 +2209,12 @@ by calling this incorrectly.
|
|||
break;
|
||||
if (lf->points)
|
||||
{
|
||||
objc_free(lf->points);
|
||||
free(lf->points);
|
||||
lf->points = NULL;
|
||||
}
|
||||
if (lf->attachments)
|
||||
{
|
||||
objc_free(lf->attachments);
|
||||
free(lf->attachments);
|
||||
lf->attachments = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -2228,7 +2228,7 @@ by calling this incorrectly.
|
|||
if (tc->size_linefrags <= tc->num_linefrags + tc->num_soft)
|
||||
{
|
||||
tc->size_linefrags += tc->size_linefrags / 2;
|
||||
tc->linefrags = objc_realloc(tc->linefrags, sizeof(linefrag_t) * tc->size_linefrags);
|
||||
tc->linefrags = realloc(tc->linefrags, sizeof(linefrag_t) * tc->size_linefrags);
|
||||
}
|
||||
memmove(&tc->linefrags[tc->num_linefrags + 1], &tc->linefrags[tc->num_linefrags], tc->num_soft * sizeof(linefrag_t));
|
||||
}
|
||||
|
@ -2318,7 +2318,7 @@ forStartOfGlyphRange: (NSRange)glyphRange
|
|||
return;
|
||||
}
|
||||
lf->num_points++;
|
||||
lf->points = objc_realloc(lf->points, sizeof(linefrag_point_t) * lf->num_points);
|
||||
lf->points = realloc(lf->points, sizeof(linefrag_point_t) * lf->num_points);
|
||||
lp = &lf->points[lf->num_points - 1];
|
||||
}
|
||||
lp->pos = glyphRange.location;
|
||||
|
@ -2367,7 +2367,7 @@ forStartOfGlyphRange: (NSRange)glyphRange
|
|||
|
||||
/* TODO: we do no sanity checking of attachment size ranges. might want
|
||||
to consider doing it */
|
||||
lf->attachments = objc_realloc(lf->attachments,
|
||||
lf->attachments = realloc(lf->attachments,
|
||||
sizeof(linefrag_attachment_t) * (lf->num_attachments + 1));
|
||||
la = &lf->attachments[lf->num_attachments++];
|
||||
|
||||
|
@ -2651,7 +2651,7 @@ forStartOfGlyphRange: (NSRange)glyphRange
|
|||
[self _invalidateLayoutFromContainer: index];
|
||||
|
||||
num_textcontainers++;
|
||||
textcontainers = objc_realloc(textcontainers,
|
||||
textcontainers = realloc(textcontainers,
|
||||
sizeof(textcontainer_t) * num_textcontainers);
|
||||
|
||||
for (i = num_textcontainers - 1; i > index; i--)
|
||||
|
@ -2679,11 +2679,11 @@ forStartOfGlyphRange: (NSRange)glyphRange
|
|||
textcontainers[i] = textcontainers[i + 1];
|
||||
|
||||
if (num_textcontainers)
|
||||
textcontainers = objc_realloc(textcontainers,
|
||||
textcontainers = realloc(textcontainers,
|
||||
sizeof(textcontainer_t) * num_textcontainers);
|
||||
else
|
||||
{
|
||||
objc_free(textcontainers);
|
||||
free(textcontainers);
|
||||
textcontainers = NULL;
|
||||
}
|
||||
|
||||
|
@ -2876,7 +2876,7 @@ forStartOfGlyphRange: (NSRange)glyphRange
|
|||
int i;
|
||||
textcontainer_t *tc;
|
||||
|
||||
objc_free(rect_array);
|
||||
free(rect_array);
|
||||
rect_array_size = 0;
|
||||
rect_array = NULL;
|
||||
|
||||
|
@ -2885,7 +2885,7 @@ forStartOfGlyphRange: (NSRange)glyphRange
|
|||
{
|
||||
[tc->textContainer release];
|
||||
}
|
||||
objc_free(textcontainers);
|
||||
free(textcontainers);
|
||||
textcontainers = NULL;
|
||||
|
||||
[self _freeGlyphs];
|
||||
|
@ -3160,7 +3160,7 @@ forStartingGlyphAtIndex: (NSUInteger)glyph
|
|||
}
|
||||
else if (run->head.glyph_length < len)
|
||||
{
|
||||
run->glyphs = objc_realloc(run->glyphs, sizeof(glyph_t) * len);
|
||||
run->glyphs = realloc(run->glyphs, sizeof(glyph_t) * len);
|
||||
memset(&run->glyphs[glyph - gpos], 0, sizeof(glyph_t) * length);
|
||||
}
|
||||
run->head.glyph_length = len;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue