mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
More tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12019 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2ede4f3530
commit
e1effaf436
5 changed files with 93 additions and 122 deletions
|
@ -1,3 +1,11 @@
|
|||
2002-01-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Tools/AGSHtml.m: Minor speedup.
|
||||
* Tools/AGSParser.m: Rewrite handling of standards information to fix
|
||||
bug in NO_GNUSTEP handling.
|
||||
* Source/GNUmakefile: Don't document concrete number stuff ... not
|
||||
public.
|
||||
|
||||
Sun Jan 6 22:33:55 2002 Nicola Pero <n.pero@mi.flashnet.it>
|
||||
|
||||
* Tools/HTMLLinker.m: Rewritten to fixup links by link name rather
|
||||
|
|
|
@ -95,9 +95,11 @@
|
|||
Class isa;
|
||||
}
|
||||
|
||||
#ifndef NO_GNUSTEP
|
||||
#if GS_WITH_GC
|
||||
+ (BOOL) requiresTypedMemory;
|
||||
#endif
|
||||
#endif
|
||||
+ (void) initialize;
|
||||
+ (id) allocWithZone: (NSZone*)z;
|
||||
+ (id) alloc;
|
||||
|
@ -164,6 +166,8 @@ NSComparisonResult;
|
|||
|
||||
enum {NSNotFound = 0x7fffffff};
|
||||
|
||||
#ifndef NO_GNUSTEP
|
||||
|
||||
@interface NSObject (NEXTSTEP)
|
||||
- error:(const char *)aString, ...;
|
||||
- notImplemented:(SEL)aSel;
|
||||
|
@ -171,7 +175,6 @@ enum {NSNotFound = 0x7fffffff};
|
|||
Removed because OpenStep has -(NSString*)name; */
|
||||
@end
|
||||
|
||||
#ifndef NO_GNUSTEP
|
||||
/* Global lock to be used by classes when operating on any global
|
||||
data that invoke other methods which also access global; thus,
|
||||
creating the potential for deadlock. */
|
||||
|
@ -189,7 +192,7 @@ GS_EXPORT NSRecursiveLock *gnustep_global_lock;
|
|||
@end
|
||||
|
||||
@interface NSObject (GNU)
|
||||
- (int) compare: (id)anObject;
|
||||
- (NSComparisonResult) compare: (id)anObject;
|
||||
/*
|
||||
* Default description methods -
|
||||
* [descriptionWithLocale:] calls [description]
|
||||
|
|
|
@ -310,7 +310,6 @@ NSCalendarDate.h \
|
|||
NSCharacterSet.h \
|
||||
NSClassDescription.h \
|
||||
NSCoder.h \
|
||||
NSConcreteNumber.h \
|
||||
NSConnection.h \
|
||||
NSData.h \
|
||||
NSDate.h \
|
||||
|
@ -366,6 +365,7 @@ NSZone.h
|
|||
FOUNDATION_HEADERS = \
|
||||
Foundation.h \
|
||||
NSByteOrder.h \
|
||||
NSConcreteNumber.h \
|
||||
NSKeyValueCoding.h \
|
||||
NSPathUtilities.h \
|
||||
NSSerialization.h \
|
||||
|
|
|
@ -279,14 +279,48 @@ static NSMutableSet *textNodes = nil;
|
|||
if ([dict count] > 1
|
||||
|| ([dict count] > 0 && [type isEqual: @"title"] == NO))
|
||||
{
|
||||
NSArray *a = [dict allKeys];
|
||||
unsigned c = [a count];
|
||||
unsigned i;
|
||||
NSString *sep = @"";
|
||||
NSArray *a = [dict allKeys];
|
||||
unsigned c = [a count];
|
||||
NSMutableSet *unitNames = nil;
|
||||
unsigned i;
|
||||
NSString *sep = @"";
|
||||
BOOL isInUnit = NO;
|
||||
|
||||
if ([type isEqual: @"ivariable"])
|
||||
if ([type isEqual: @"method"] || [type isEqual: @"ivariable"])
|
||||
{
|
||||
sep = @"*";
|
||||
isInUnit = YES;
|
||||
if ([type isEqual: @"ivariable"])
|
||||
{
|
||||
sep = @"*";
|
||||
}
|
||||
else if (unit != nil)
|
||||
{
|
||||
/*
|
||||
* Create a mutable set containing the unit name.
|
||||
*/
|
||||
unitNames = [NSMutableSet setWithObject: unit];
|
||||
/*
|
||||
* if the unit is a class, add all its categories to the set.
|
||||
*/
|
||||
if ([unit hasSuffix: @")"] == NO)
|
||||
{
|
||||
NSArray *categoryNames;
|
||||
unsigned l = [unit length];
|
||||
|
||||
categoryNames = [[dict objectForKey: @"category"] allKeys];
|
||||
i = [categoryNames count];
|
||||
while (i-- > 0)
|
||||
{
|
||||
NSString *n = [categoryNames objectAtIndex: i];
|
||||
|
||||
if ([n hasPrefix: unit] == YES && [n length] > l
|
||||
&& [n characterAtIndex: i] == '(')
|
||||
{
|
||||
[unitNames addObject: n];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
a = [a sortedArrayUsingSelector: @selector(compare:)];
|
||||
|
||||
|
@ -298,33 +332,25 @@ static NSMutableSet *textNodes = nil;
|
|||
|
||||
for (i = 0; i < c; i++)
|
||||
{
|
||||
if ([type isEqual: @"method"] || [type isEqual: @"ivariable"])
|
||||
if (isInUnit == YES)
|
||||
{
|
||||
NSString *ref = [a objectAtIndex: i];
|
||||
NSDictionary *units = [dict objectForKey: ref];
|
||||
NSMutableArray *b = [[units allKeys] mutableCopy];
|
||||
unsigned j;
|
||||
|
||||
if (unit != nil)
|
||||
if (unitNames != nil)
|
||||
{
|
||||
/*
|
||||
* Remove any listing for methods not in the
|
||||
* current unit or in categories of the
|
||||
* current class.
|
||||
* current unit or in categories of the current class.
|
||||
*/
|
||||
for (j = 0; j < [b count]; j++)
|
||||
{
|
||||
NSString *u = [b objectAtIndex: j];
|
||||
|
||||
if ([unit isEqual: u] == NO)
|
||||
if ([unitNames member: u] == NO)
|
||||
{
|
||||
if ([unit hasSuffix: @")"] == NO
|
||||
&& [u hasPrefix: unit] == YES
|
||||
&& [u characterAtIndex: [unit length]]
|
||||
== '(')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
[b removeObjectAtIndex: j--];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1289,9 +1289,8 @@ fail:
|
|||
else if (ifStack == nil)
|
||||
{
|
||||
ifStack = [[NSMutableArray alloc] initWithCapacity: 4];
|
||||
[ifStack addObject: @"OpenStep"];
|
||||
[ifStack addObject: @"MacOS-X"];
|
||||
[ifStack addObject: @"GNUstep"];
|
||||
[ifStack addObject: [NSSet setWithObjects:
|
||||
@"OpenStep", @"MacOS-X", @"GNUstep", nil]];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1302,65 +1301,21 @@ fail:
|
|||
*/
|
||||
- (void) setStandards: (NSMutableDictionary*)dict
|
||||
{
|
||||
unsigned c = [ifStack count];
|
||||
BOOL hadG = NO;
|
||||
BOOL hadM = NO;
|
||||
BOOL hadO = NO;
|
||||
NSSet *set = [ifStack lastObject];
|
||||
|
||||
if (c > 0)
|
||||
if ([set count] > 0)
|
||||
{
|
||||
NSMutableString *s = nil;
|
||||
BOOL found = NO;
|
||||
NSEnumerator *e = [set objectEnumerator];
|
||||
NSString *name;
|
||||
|
||||
s = [NSMutableString stringWithCString: "<standards>"];
|
||||
while (c-- > 0)
|
||||
while ((name = [e nextObject]) != nil)
|
||||
{
|
||||
NSString *name = [ifStack objectAtIndex: c];
|
||||
|
||||
/*
|
||||
* We don't produce output for empty strings or
|
||||
* the 'NotGNUstep' string.
|
||||
*/
|
||||
if ([name isEqualToString: @""] == YES
|
||||
|| [name isEqualToString: @"NotGNUstep"] == YES)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ([name isEqualToString: @"GNUstep"] == YES
|
||||
|| [name isEqualToString: @"NotGNUstep"] == YES)
|
||||
{
|
||||
if (hadG == YES)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
hadG = YES;
|
||||
}
|
||||
if ([name isEqualToString: @"OpenStep"] == YES
|
||||
|| [name isEqualToString: @"NotOpenStep"] == YES)
|
||||
{
|
||||
if (hadO == YES)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
hadO = YES;
|
||||
}
|
||||
if ([name isEqualToString: @"MacOS-X"] == YES
|
||||
|| [name isEqualToString: @"NotMacOS-X"] == YES)
|
||||
{
|
||||
if (hadM == YES)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
hadM = YES;
|
||||
}
|
||||
found = YES;
|
||||
[s appendFormat: @"<%@ />", name];
|
||||
}
|
||||
if (found == YES)
|
||||
{
|
||||
[s appendString: @"</standards>"];
|
||||
[dict setObject: s forKey: @"Standards"];
|
||||
}
|
||||
[s appendString: @"</standards>"];
|
||||
[dict setObject: s forKey: @"Standards"];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2043,71 +1998,42 @@ fail:
|
|||
|
||||
if ([directive isEqual: @"endif"] == YES)
|
||||
{
|
||||
unsigned c = [ifStack count];
|
||||
|
||||
if (c == 0)
|
||||
if ([ifStack count] <= 1)
|
||||
{
|
||||
[self log: @"Unexpected #endif (no matching #if)"];
|
||||
}
|
||||
else
|
||||
{
|
||||
[ifStack removeObjectAtIndex: c - 1];
|
||||
[ifStack removeLastObject];
|
||||
}
|
||||
}
|
||||
else if ([directive isEqual: @"elif"] == YES)
|
||||
{
|
||||
unsigned c = [ifStack count];
|
||||
|
||||
if (c == 0)
|
||||
if ([ifStack count] <= 1)
|
||||
{
|
||||
[self log: @"Unexpected #else (no matching #if)"];
|
||||
}
|
||||
else
|
||||
{
|
||||
[ifStack replaceObjectAtIndex: c - 1 withObject: @""];
|
||||
[ifStack removeLastObject];
|
||||
[ifStack addObject: [ifStack lastObject]];
|
||||
}
|
||||
}
|
||||
else if ([directive isEqual: @"else"] == YES)
|
||||
{
|
||||
unsigned c = [ifStack count];
|
||||
|
||||
if (c == 0)
|
||||
if ([ifStack count] <= 1)
|
||||
{
|
||||
[self log: @"Unexpected #else (no matching #if)"];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *item = [ifStack objectAtIndex: --c];
|
||||
|
||||
if ([item isEqual: @"GNUstep"] == YES)
|
||||
{
|
||||
[ifStack replaceObjectAtIndex: c withObject: @"NotGNUstep"];
|
||||
}
|
||||
else if ([item isEqual: @"NotGNUstep"] == YES)
|
||||
{
|
||||
[ifStack replaceObjectAtIndex: c withObject: @"GNUstep"];
|
||||
}
|
||||
else if ([item isEqual: @"OpenStep"] == YES)
|
||||
{
|
||||
[ifStack replaceObjectAtIndex: c withObject: @"NotOpenStep"];
|
||||
}
|
||||
else if ([item isEqual: @"NotOpenStep"] == YES)
|
||||
{
|
||||
[ifStack replaceObjectAtIndex: c withObject: @"OpenStep"];
|
||||
}
|
||||
else if ([item isEqual: @"MacOS-X"] == YES)
|
||||
{
|
||||
[ifStack replaceObjectAtIndex: c withObject: @"NotMacOS-X"];
|
||||
}
|
||||
else if ([item isEqual: @"NotMacOS-X"] == YES)
|
||||
{
|
||||
[ifStack replaceObjectAtIndex: c withObject: @"MacOS-X"];
|
||||
}
|
||||
[ifStack removeLastObject];
|
||||
[ifStack addObject: [ifStack lastObject]];
|
||||
}
|
||||
}
|
||||
else if ([directive isEqual: @"if"] == YES)
|
||||
{
|
||||
[ifStack addObject: @""];
|
||||
[ifStack addObject: [ifStack lastObject]];
|
||||
}
|
||||
else if ([directive hasPrefix: @"if"] == YES)
|
||||
{
|
||||
|
@ -2119,43 +2045,51 @@ fail:
|
|||
}
|
||||
if (pos < length && buffer[pos] != '\n')
|
||||
{
|
||||
NSString *arg = [self parseIdentifier];
|
||||
NSString *val = @"";
|
||||
NSMutableSet *set = [[ifStack lastObject] mutableCopy];
|
||||
NSString *arg = [self parseIdentifier];
|
||||
|
||||
if ([arg isEqual: @"NO_GNUSTEP"] == YES)
|
||||
{
|
||||
if (isIfDef == YES)
|
||||
{
|
||||
val = @"NotGNUstep";
|
||||
[self log: @"Unexpected #ifdef NO_GNUSTEP (nonsense)"];
|
||||
}
|
||||
else
|
||||
{
|
||||
val = @"GNUstep";
|
||||
[set removeObject: @"MacOS-X"];
|
||||
[set addObject: @"NotMacOS-X"];
|
||||
[set removeObject: @"OpenStep"];
|
||||
[set addObject: @"NotOpenStep"];
|
||||
}
|
||||
}
|
||||
else if ([arg isEqual: @"STRICT_MACOS_X"] == YES)
|
||||
{
|
||||
if (isIfDef == YES)
|
||||
{
|
||||
val = @"MacOS-X";
|
||||
[set removeObject: @"NotMacOS-X"];
|
||||
[set addObject: @"MacOS-X"];
|
||||
}
|
||||
else
|
||||
{
|
||||
val = @"NotMacOS-X";
|
||||
[set removeObject: @"MacOS-X"];
|
||||
[set addObject: @"NotMacOS-X"];
|
||||
}
|
||||
}
|
||||
else if ([arg isEqual: @"STRICT_OPENSTEP"] == YES)
|
||||
{
|
||||
if (isIfDef == YES)
|
||||
{
|
||||
val = @"OpenStep";
|
||||
[set removeObject: @"NotOpenStep"];
|
||||
[set addObject: @"OpenStep"];
|
||||
}
|
||||
else
|
||||
{
|
||||
val = @"NotOpenStep";
|
||||
[set removeObject: @"OpenStep"];
|
||||
[set addObject: @"NotOpenStep"];
|
||||
}
|
||||
}
|
||||
[ifStack addObject: val];
|
||||
[ifStack addObject: set];
|
||||
RELEASE(set);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue