From 42d4e114398b0331d83642553e1eec89f6c83e4a Mon Sep 17 00:00:00 2001 From: ayers Date: Fri, 10 Sep 2004 15:10:54 +0000 Subject: [PATCH] * 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 --- ChangeLog | 11 +++++++++++ Source/NSArray.m | 44 ++++++++++++++++++++++--------------------- Source/NSDictionary.m | 32 +++++++++++++++---------------- Source/NSSet.m | 2 +- 4 files changed, 51 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index a01a1ccbf..f61b77a15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-09-10 David Ayers + + * 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 * Source/GSString.m: Implement init for GSPlaceHolderString diff --git a/Source/NSArray.m b/Source/NSArray.m index ea65446e1..f9fcfb2f0 100644 --- a/Source/NSArray.m +++ b/Source/NSArray.m @@ -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) { diff --git a/Source/NSDictionary.m b/Source/NSDictionary.m index 135b651f5..b9c9899c7 100644 --- a/Source/NSDictionary.m +++ b/Source/NSDictionary.m @@ -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(); } } diff --git a/Source/NSSet.m b/Source/NSSet.m index 1af6f363c..2a31a6fa7 100644 --- a/Source/NSSet.m +++ b/Source/NSSet.m @@ -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++) {