* 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:
ayers 2004-09-10 15:10:54 +00:00
parent d6ca992407
commit 42d4e11439
4 changed files with 51 additions and 38 deletions

View file

@ -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> 2004-09-09 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSString.m: Implement init for GSPlaceHolderString * Source/GSString.m: Implement init for GSPlaceHolderString

View file

@ -275,14 +275,14 @@ static SEL rlSel;
} }
else else
{ {
GS_BEGINIDBUF(objects, c+1) GS_BEGINIDBUF(objects, c+1);
[self getObjects: objects]; [self getObjects: objects];
objects[c] = anObject; objects[c] = anObject;
na = [[GSArrayClass allocWithZone: NSDefaultMallocZone()] na = [[GSArrayClass allocWithZone: NSDefaultMallocZone()]
initWithObjects: objects count: c+1]; initWithObjects: objects count: c+1];
GS_ENDIDBUF() GS_ENDIDBUF();
} }
return AUTORELEASE(na); return AUTORELEASE(na);
} }
@ -299,13 +299,15 @@ static SEL rlSel;
c = [self count]; c = [self count];
l = [anotherArray count]; l = [anotherArray count];
GS_BEGINIDBUF(objects, c+l) {
GS_BEGINIDBUF(objects, c+l);
[self getObjects: objects]; [self getObjects: objects];
[anotherArray getObjects: &objects[c]]; [anotherArray getObjects: &objects[c]];
na = [NSArrayClass arrayWithObjects: objects count: c+l]; na = [NSArrayClass arrayWithObjects: objects count: c+l];
GS_ENDIDBUF() GS_ENDIDBUF();
}
return na; return na;
} }
@ -388,13 +390,13 @@ static SEL rlSel;
if (count > 0) if (count > 0)
{ {
GS_BEGINIDBUF(a, count) GS_BEGINIDBUF(a, count);
[self getObjects: a]; [self getObjects: a];
[aCoder encodeArrayOfObjCType: @encode(id) [aCoder encodeArrayOfObjCType: @encode(id)
count: count count: count
at: a]; at: a];
GS_ENDIDBUF() GS_ENDIDBUF();
} }
} }
} }
@ -557,7 +559,7 @@ static SEL rlSel;
- (id) initWithArray: (NSArray*)array copyItems: (BOOL)shouldCopy - (id) initWithArray: (NSArray*)array copyItems: (BOOL)shouldCopy
{ {
unsigned c = [array count]; unsigned c = [array count];
GS_BEGINIDBUF(objects, c) GS_BEGINIDBUF(objects, c);
[array getObjects: objects]; [array getObjects: objects];
if (shouldCopy == YES) if (shouldCopy == YES)
@ -580,7 +582,7 @@ static SEL rlSel;
{ {
self = [self initWithObjects: objects count: c]; self = [self initWithObjects: objects count: c];
} }
GS_ENDIDBUF() GS_ENDIDBUF();
return self; return self;
} }
@ -592,11 +594,11 @@ static SEL rlSel;
- (id) initWithArray: (NSArray*)array - (id) initWithArray: (NSArray*)array
{ {
unsigned c = [array count]; unsigned c = [array count];
GS_BEGINIDBUF(objects, c) GS_BEGINIDBUF(objects, c);
[array getObjects: objects]; [array getObjects: objects];
self = [self initWithObjects: objects count: c]; self = [self initWithObjects: objects count: c];
GS_ENDIDBUF() GS_ENDIDBUF();
return self; return self;
} }
@ -641,11 +643,11 @@ static SEL rlSel;
at: &count]; at: &count];
if (count > 0) if (count > 0)
{ {
GS_BEGINIDBUF(contents, count) GS_BEGINIDBUF(contents, count);
[aCoder decodeArrayOfObjCType: @encode(id) [aCoder decodeArrayOfObjCType: @encode(id)
count: count count: count
at: contents]; at: contents];
self = [self initWithObjects: contents count: count]; self = [self initWithObjects: contents count: count];
#if GS_WITH_GC == 0 #if GS_WITH_GC == 0
while (count-- > 0) while (count-- > 0)
@ -653,7 +655,7 @@ static SEL rlSel;
[contents[count] release]; [contents[count] release];
} }
#endif #endif
GS_ENDIDBUF() GS_ENDIDBUF();
} }
else else
{ {
@ -1072,11 +1074,11 @@ compare(id elem1, id elem2, void* context)
} }
else else
{ {
GS_BEGINIDBUF(objects, aRange.length) GS_BEGINIDBUF(objects, aRange.length);
[self getObjects: objects range: aRange]; [self getObjects: objects range: aRange];
na = [NSArray arrayWithObjects: objects count: aRange.length]; na = [NSArray arrayWithObjects: objects count: aRange.length];
GS_ENDIDBUF() GS_ENDIDBUF();
} }
return na; return na;
} }
@ -1688,10 +1690,10 @@ compare(id elem1, id elem2, void* context)
{ {
if (count > 0) if (count > 0)
{ {
GS_BEGINITEMBUF(sorted, count, unsigned int);
unsigned to = 0; unsigned to = 0;
unsigned from = 0; unsigned from = 0;
unsigned i; unsigned i;
GS_BEGINITEMBUF(sorted, count, unsigned int);
while (from < count) while (from < count)
{ {

View file

@ -418,14 +418,14 @@ static SEL appSel;
} }
else else
{ {
GS_BEGINIDBUF(o, objectCount*2) GS_BEGINIDBUF(o, objectCount*2);
[objects getObjects: o]; [objects getObjects: o];
[keys getObjects: o + objectCount]; [keys getObjects: o + objectCount];
self = [self initWithObjects: o self = [self initWithObjects: o
forKeys: o + objectCount forKeys: o + objectCount
count: objectCount]; count: objectCount];
GS_ENDIDBUF() GS_ENDIDBUF();
} }
return self; return self;
} }
@ -504,7 +504,7 @@ static SEL appSel;
unsigned i = 0; unsigned i = 0;
IMP nxtObj = [e methodForSelector: nxtSel]; IMP nxtObj = [e methodForSelector: nxtSel];
IMP otherObj = [other methodForSelector: objSel]; IMP otherObj = [other methodForSelector: objSel];
GS_BEGINIDBUF(o, c*2) GS_BEGINIDBUF(o, c*2);
if (shouldCopy) if (shouldCopy)
{ {
@ -534,7 +534,7 @@ static SEL appSel;
} }
self = [self initWithObjects: o + c forKeys: o count: c]; self = [self initWithObjects: o + c forKeys: o count: c];
} }
GS_ENDIDBUF() GS_ENDIDBUF();
} }
return self; return self;
} }
@ -734,7 +734,7 @@ static SEL appSel;
IMP nxtObj = [e methodForSelector: nxtSel]; IMP nxtObj = [e methodForSelector: nxtSel];
unsigned i; unsigned i;
id result; id result;
GS_BEGINIDBUF(k, c) GS_BEGINIDBUF(k, c);
for (i = 0; i < c; i++) for (i = 0; i < c; i++)
{ {
@ -743,7 +743,7 @@ static SEL appSel;
} }
result = [[NSArray_class allocWithZone: NSDefaultMallocZone()] result = [[NSArray_class allocWithZone: NSDefaultMallocZone()]
initWithObjects: k count: c]; initWithObjects: k count: c];
GS_ENDIDBUF() GS_ENDIDBUF();
return AUTORELEASE(result); return AUTORELEASE(result);
} }
} }
@ -765,7 +765,7 @@ static SEL appSel;
IMP nxtObj = [e methodForSelector: nxtSel]; IMP nxtObj = [e methodForSelector: nxtSel];
id result; id result;
unsigned i; unsigned i;
GS_BEGINIDBUF(k, c) GS_BEGINIDBUF(k, c);
for (i = 0; i < c; i++) for (i = 0; i < c; i++)
{ {
@ -773,7 +773,7 @@ static SEL appSel;
} }
result = [[NSArray_class allocWithZone: NSDefaultMallocZone()] result = [[NSArray_class allocWithZone: NSDefaultMallocZone()]
initWithObjects: k count: c]; initWithObjects: k count: c];
GS_ENDIDBUF() GS_ENDIDBUF();
return AUTORELEASE(result); return AUTORELEASE(result);
} }
} }
@ -798,7 +798,7 @@ static SEL appSel;
BOOL (*eqObj)(id, SEL, id); BOOL (*eqObj)(id, SEL, id);
id k; id k;
id result; id result;
GS_BEGINIDBUF(a, [self count]) GS_BEGINIDBUF(a, [self count]);
eqObj = (BOOL (*)(id, SEL, id))[anObject methodForSelector: eqSel]; eqObj = (BOOL (*)(id, SEL, id))[anObject methodForSelector: eqSel];
c = 0; c = 0;
@ -820,7 +820,7 @@ static SEL appSel;
result = [[NSArray_class allocWithZone: NSDefaultMallocZone()] result = [[NSArray_class allocWithZone: NSDefaultMallocZone()]
initWithObjects: a count: c]; initWithObjects: a count: c];
} }
GS_ENDIDBUF() GS_ENDIDBUF();
return AUTORELEASE(result); return AUTORELEASE(result);
} }
} }
@ -875,7 +875,7 @@ compareIt(id o1, id o2, void* context)
unsigned i; unsigned i;
IMP myObj = [self methodForSelector: objSel]; IMP myObj = [self methodForSelector: objSel];
id result; id result;
GS_BEGINIDBUF(obuf, c) GS_BEGINIDBUF(obuf, c);
[keys getObjects: obuf]; [keys getObjects: obuf];
for (i = 0; i < c; i++) for (i = 0; i < c; i++)
@ -893,7 +893,7 @@ compareIt(id o1, id o2, void* context)
} }
result = [[NSArray_class allocWithZone: NSDefaultMallocZone()] result = [[NSArray_class allocWithZone: NSDefaultMallocZone()]
initWithObjects: obuf count: c]; initWithObjects: obuf count: c];
GS_ENDIDBUF() GS_ENDIDBUF();
return AUTORELEASE(result); return AUTORELEASE(result);
} }
} }
@ -1099,7 +1099,7 @@ compareIt(id o1, id o2, void* context)
NSEnumerator *enumerator = [self keyEnumerator]; NSEnumerator *enumerator = [self keyEnumerator];
IMP nxtImp = [enumerator methodForSelector: nxtSel]; IMP nxtImp = [enumerator methodForSelector: nxtSel];
IMP objImp = [self methodForSelector: objSel]; IMP objImp = [self methodForSelector: objSel];
GS_BEGINIDBUF(o, count*2) GS_BEGINIDBUF(o, count*2);
for (i = 0; (key = (*nxtImp)(enumerator, nxtSel)); i++) for (i = 0; (key = (*nxtImp)(enumerator, nxtSel)); i++)
{ {
@ -1117,7 +1117,7 @@ compareIt(id o1, id o2, void* context)
[o[count + i] release]; [o[count + i] release];
} }
#endif #endif
GS_ENDIDBUF() GS_ENDIDBUF();
return newDictionary; return newDictionary;
} }
@ -1228,14 +1228,14 @@ compareIt(id o1, id o2, void* context)
if (c > 0) if (c > 0)
{ {
IMP remObj = [self methodForSelector: remSel]; IMP remObj = [self methodForSelector: remSel];
GS_BEGINIDBUF(keys, c) GS_BEGINIDBUF(keys, c);
[keyArray getObjects: keys]; [keyArray getObjects: keys];
while (c--) while (c--)
{ {
(*remObj)(self, remSel, keys[c]); (*remObj)(self, remSel, keys[c]);
} }
GS_ENDIDBUF() GS_ENDIDBUF();
} }
} }

View file

@ -253,8 +253,8 @@ static Class NSMutableSet_concrete_class;
[aCoder decodeValueOfObjCType: @encode(unsigned) at: &count]; [aCoder decodeValueOfObjCType: @encode(unsigned) at: &count];
if (count > 0) if (count > 0)
{ {
GS_BEGINIDBUF(objs, count);
unsigned i; unsigned i;
GS_BEGINIDBUF(objs, count);
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {