mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
* Source/NSArray.m: Consistently terminate macros with semicolons.
(arrayByAddingObjectsFromArray) (removeObjectsFromIndices:numIndices:): Insure all declarations precede statements. * Source/NSDictionary.m: Consistently terminate macros with semicolons. * Source/NSSet.m (initWithCoder:): Insure all declarations precede statements. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20043 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d6ca992407
commit
42d4e11439
4 changed files with 51 additions and 38 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2004-09-10 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* Source/NSArray.m: Consistently terminate macros with semicolons.
|
||||
(arrayByAddingObjectsFromArray)
|
||||
(removeObjectsFromIndices:numIndices:): Insure all declarations
|
||||
precede statements.
|
||||
* Source/NSDictionary.m: Consistently terminate macros with
|
||||
semicolons.
|
||||
* Source/NSSet.m (initWithCoder:): Insure all declarations precede
|
||||
statements.
|
||||
|
||||
2004-09-09 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSString.m: Implement init for GSPlaceHolderString
|
||||
|
|
|
@ -275,14 +275,14 @@ static SEL rlSel;
|
|||
}
|
||||
else
|
||||
{
|
||||
GS_BEGINIDBUF(objects, c+1)
|
||||
GS_BEGINIDBUF(objects, c+1);
|
||||
|
||||
[self getObjects: objects];
|
||||
objects[c] = anObject;
|
||||
na = [[GSArrayClass allocWithZone: NSDefaultMallocZone()]
|
||||
initWithObjects: objects count: c+1];
|
||||
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
}
|
||||
return AUTORELEASE(na);
|
||||
}
|
||||
|
@ -299,13 +299,15 @@ static SEL rlSel;
|
|||
c = [self count];
|
||||
l = [anotherArray count];
|
||||
|
||||
GS_BEGINIDBUF(objects, c+l)
|
||||
{
|
||||
GS_BEGINIDBUF(objects, c+l);
|
||||
|
||||
[self getObjects: objects];
|
||||
[anotherArray getObjects: &objects[c]];
|
||||
na = [NSArrayClass arrayWithObjects: objects count: c+l];
|
||||
[self getObjects: objects];
|
||||
[anotherArray getObjects: &objects[c]];
|
||||
na = [NSArrayClass arrayWithObjects: objects count: c+l];
|
||||
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
}
|
||||
|
||||
return na;
|
||||
}
|
||||
|
@ -388,13 +390,13 @@ static SEL rlSel;
|
|||
|
||||
if (count > 0)
|
||||
{
|
||||
GS_BEGINIDBUF(a, count)
|
||||
GS_BEGINIDBUF(a, count);
|
||||
|
||||
[self getObjects: a];
|
||||
[aCoder encodeArrayOfObjCType: @encode(id)
|
||||
count: count
|
||||
at: a];
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -557,7 +559,7 @@ static SEL rlSel;
|
|||
- (id) initWithArray: (NSArray*)array copyItems: (BOOL)shouldCopy
|
||||
{
|
||||
unsigned c = [array count];
|
||||
GS_BEGINIDBUF(objects, c)
|
||||
GS_BEGINIDBUF(objects, c);
|
||||
|
||||
[array getObjects: objects];
|
||||
if (shouldCopy == YES)
|
||||
|
@ -580,7 +582,7 @@ static SEL rlSel;
|
|||
{
|
||||
self = [self initWithObjects: objects count: c];
|
||||
}
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -592,11 +594,11 @@ static SEL rlSel;
|
|||
- (id) initWithArray: (NSArray*)array
|
||||
{
|
||||
unsigned c = [array count];
|
||||
GS_BEGINIDBUF(objects, c)
|
||||
GS_BEGINIDBUF(objects, c);
|
||||
|
||||
[array getObjects: objects];
|
||||
self = [self initWithObjects: objects count: c];
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -641,11 +643,11 @@ static SEL rlSel;
|
|||
at: &count];
|
||||
if (count > 0)
|
||||
{
|
||||
GS_BEGINIDBUF(contents, count)
|
||||
GS_BEGINIDBUF(contents, count);
|
||||
|
||||
[aCoder decodeArrayOfObjCType: @encode(id)
|
||||
count: count
|
||||
at: contents];
|
||||
[aCoder decodeArrayOfObjCType: @encode(id)
|
||||
count: count
|
||||
at: contents];
|
||||
self = [self initWithObjects: contents count: count];
|
||||
#if GS_WITH_GC == 0
|
||||
while (count-- > 0)
|
||||
|
@ -653,7 +655,7 @@ static SEL rlSel;
|
|||
[contents[count] release];
|
||||
}
|
||||
#endif
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1072,11 +1074,11 @@ compare(id elem1, id elem2, void* context)
|
|||
}
|
||||
else
|
||||
{
|
||||
GS_BEGINIDBUF(objects, aRange.length)
|
||||
GS_BEGINIDBUF(objects, aRange.length);
|
||||
|
||||
[self getObjects: objects range: aRange];
|
||||
na = [NSArray arrayWithObjects: objects count: aRange.length];
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
}
|
||||
return na;
|
||||
}
|
||||
|
@ -1688,10 +1690,10 @@ compare(id elem1, id elem2, void* context)
|
|||
{
|
||||
if (count > 0)
|
||||
{
|
||||
GS_BEGINITEMBUF(sorted, count, unsigned int);
|
||||
unsigned to = 0;
|
||||
unsigned from = 0;
|
||||
unsigned i;
|
||||
GS_BEGINITEMBUF(sorted, count, unsigned int);
|
||||
|
||||
while (from < count)
|
||||
{
|
||||
|
|
|
@ -418,14 +418,14 @@ static SEL appSel;
|
|||
}
|
||||
else
|
||||
{
|
||||
GS_BEGINIDBUF(o, objectCount*2)
|
||||
GS_BEGINIDBUF(o, objectCount*2);
|
||||
|
||||
[objects getObjects: o];
|
||||
[keys getObjects: o + objectCount];
|
||||
self = [self initWithObjects: o
|
||||
forKeys: o + objectCount
|
||||
count: objectCount];
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -504,7 +504,7 @@ static SEL appSel;
|
|||
unsigned i = 0;
|
||||
IMP nxtObj = [e methodForSelector: nxtSel];
|
||||
IMP otherObj = [other methodForSelector: objSel];
|
||||
GS_BEGINIDBUF(o, c*2)
|
||||
GS_BEGINIDBUF(o, c*2);
|
||||
|
||||
if (shouldCopy)
|
||||
{
|
||||
|
@ -534,7 +534,7 @@ static SEL appSel;
|
|||
}
|
||||
self = [self initWithObjects: o + c forKeys: o count: c];
|
||||
}
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -734,7 +734,7 @@ static SEL appSel;
|
|||
IMP nxtObj = [e methodForSelector: nxtSel];
|
||||
unsigned i;
|
||||
id result;
|
||||
GS_BEGINIDBUF(k, c)
|
||||
GS_BEGINIDBUF(k, c);
|
||||
|
||||
for (i = 0; i < c; i++)
|
||||
{
|
||||
|
@ -743,7 +743,7 @@ static SEL appSel;
|
|||
}
|
||||
result = [[NSArray_class allocWithZone: NSDefaultMallocZone()]
|
||||
initWithObjects: k count: c];
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
return AUTORELEASE(result);
|
||||
}
|
||||
}
|
||||
|
@ -765,7 +765,7 @@ static SEL appSel;
|
|||
IMP nxtObj = [e methodForSelector: nxtSel];
|
||||
id result;
|
||||
unsigned i;
|
||||
GS_BEGINIDBUF(k, c)
|
||||
GS_BEGINIDBUF(k, c);
|
||||
|
||||
for (i = 0; i < c; i++)
|
||||
{
|
||||
|
@ -773,7 +773,7 @@ static SEL appSel;
|
|||
}
|
||||
result = [[NSArray_class allocWithZone: NSDefaultMallocZone()]
|
||||
initWithObjects: k count: c];
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
return AUTORELEASE(result);
|
||||
}
|
||||
}
|
||||
|
@ -798,7 +798,7 @@ static SEL appSel;
|
|||
BOOL (*eqObj)(id, SEL, id);
|
||||
id k;
|
||||
id result;
|
||||
GS_BEGINIDBUF(a, [self count])
|
||||
GS_BEGINIDBUF(a, [self count]);
|
||||
|
||||
eqObj = (BOOL (*)(id, SEL, id))[anObject methodForSelector: eqSel];
|
||||
c = 0;
|
||||
|
@ -820,7 +820,7 @@ static SEL appSel;
|
|||
result = [[NSArray_class allocWithZone: NSDefaultMallocZone()]
|
||||
initWithObjects: a count: c];
|
||||
}
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
return AUTORELEASE(result);
|
||||
}
|
||||
}
|
||||
|
@ -875,7 +875,7 @@ compareIt(id o1, id o2, void* context)
|
|||
unsigned i;
|
||||
IMP myObj = [self methodForSelector: objSel];
|
||||
id result;
|
||||
GS_BEGINIDBUF(obuf, c)
|
||||
GS_BEGINIDBUF(obuf, c);
|
||||
|
||||
[keys getObjects: obuf];
|
||||
for (i = 0; i < c; i++)
|
||||
|
@ -893,7 +893,7 @@ compareIt(id o1, id o2, void* context)
|
|||
}
|
||||
result = [[NSArray_class allocWithZone: NSDefaultMallocZone()]
|
||||
initWithObjects: obuf count: c];
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
return AUTORELEASE(result);
|
||||
}
|
||||
}
|
||||
|
@ -1099,7 +1099,7 @@ compareIt(id o1, id o2, void* context)
|
|||
NSEnumerator *enumerator = [self keyEnumerator];
|
||||
IMP nxtImp = [enumerator methodForSelector: nxtSel];
|
||||
IMP objImp = [self methodForSelector: objSel];
|
||||
GS_BEGINIDBUF(o, count*2)
|
||||
GS_BEGINIDBUF(o, count*2);
|
||||
|
||||
for (i = 0; (key = (*nxtImp)(enumerator, nxtSel)); i++)
|
||||
{
|
||||
|
@ -1117,7 +1117,7 @@ compareIt(id o1, id o2, void* context)
|
|||
[o[count + i] release];
|
||||
}
|
||||
#endif
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
|
||||
return newDictionary;
|
||||
}
|
||||
|
@ -1228,14 +1228,14 @@ compareIt(id o1, id o2, void* context)
|
|||
if (c > 0)
|
||||
{
|
||||
IMP remObj = [self methodForSelector: remSel];
|
||||
GS_BEGINIDBUF(keys, c)
|
||||
GS_BEGINIDBUF(keys, c);
|
||||
|
||||
[keyArray getObjects: keys];
|
||||
while (c--)
|
||||
{
|
||||
(*remObj)(self, remSel, keys[c]);
|
||||
}
|
||||
GS_ENDIDBUF()
|
||||
GS_ENDIDBUF();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -253,8 +253,8 @@ static Class NSMutableSet_concrete_class;
|
|||
[aCoder decodeValueOfObjCType: @encode(unsigned) at: &count];
|
||||
if (count > 0)
|
||||
{
|
||||
GS_BEGINIDBUF(objs, count);
|
||||
unsigned i;
|
||||
GS_BEGINIDBUF(objs, count);
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue