mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Simplify last change a little for readability.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17861 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2ed87acf65
commit
ed86931bea
2 changed files with 9 additions and 9 deletions
|
@ -32,8 +32,8 @@
|
|||
* allocated from the heap (to avoid stack overflow).
|
||||
*/
|
||||
#define OBUFMAX 1024
|
||||
#define OBUFBEGIN(P, S) { id _xxx[(S) <= OBUFMAX ? (S) : 0]; id *(P) = ((S) <= OBUFMAX) ? _xxx : (id*)NSZoneMalloc(NSDefaultMallocZone(), (S) * sizeof(id));
|
||||
#define OBUFEND(P, S) if ((S) > OBUFMAX) NSZoneFree(NSDefaultMallocZone(), (P)); }
|
||||
#define OBUFBEGIN(P, S) { id _obuf[(S) <= OBUFMAX ? (S) : 0]; id *_base = ((S) <= OBUFMAX) ? _obuf : (id*)NSZoneMalloc(NSDefaultMallocZone(), (S) * sizeof(id)); id *(P) = _base;
|
||||
#define OBUFEND() if (_base != _obuf) NSZoneFree(NSDefaultMallocZone(), _base); }
|
||||
|
||||
/*
|
||||
* Function to get the name of a string encoding as an NSString.
|
||||
|
|
|
@ -278,7 +278,7 @@ static SEL rlSel;
|
|||
na = [[GSArrayClass allocWithZone: NSDefaultMallocZone()]
|
||||
initWithObjects: objects count: c+1];
|
||||
|
||||
OBUFEND(objects, c+1)
|
||||
OBUFEND()
|
||||
}
|
||||
return AUTORELEASE(na);
|
||||
}
|
||||
|
@ -301,7 +301,7 @@ static SEL rlSel;
|
|||
[anotherArray getObjects: &objects[c]];
|
||||
na = [NSArrayClass arrayWithObjects: objects count: c+l];
|
||||
|
||||
OBUFEND(objects, c+l)
|
||||
OBUFEND()
|
||||
|
||||
return na;
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ static SEL rlSel;
|
|||
[aCoder encodeArrayOfObjCType: @encode(id)
|
||||
count: count
|
||||
at: a];
|
||||
OBUFEND(a, count)
|
||||
OBUFEND()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -524,7 +524,7 @@ static SEL rlSel;
|
|||
{
|
||||
self = [self initWithObjects: objects count: c];
|
||||
}
|
||||
OBUFEND(objects, c)
|
||||
OBUFEND()
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -540,7 +540,7 @@ static SEL rlSel;
|
|||
|
||||
[array getObjects: objects];
|
||||
self = [self initWithObjects: objects count: c];
|
||||
OBUFEND(objects, c)
|
||||
OBUFEND()
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -568,7 +568,7 @@ static SEL rlSel;
|
|||
[contents[count] release];
|
||||
}
|
||||
#endif
|
||||
OBUFEND(contents, count)
|
||||
OBUFEND()
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -988,7 +988,7 @@ compare(id elem1, id elem2, void* context)
|
|||
|
||||
[self getObjects: objects range: aRange];
|
||||
na = [NSArray arrayWithObjects: objects count: aRange.length];
|
||||
OBUFEND(objects, aRange.length)
|
||||
OBUFEND()
|
||||
}
|
||||
return na;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue