+2006-07-03 Helge Hess <helge.hess@opengroupware.org>
+
+ * v4.5.65
+
+ * EOKeyValueCoding.m: reduced autorelease usage in KVC key creation
+
+ * use %p for pointer formats, fixed gcc 4.1 warnings
+
2006-05-02 Marcus Mueller <znek@mulle-kybernetik.com>
* EOSortOrdering.m: use keyPaths instead of just keys in
}
}
- return keys ? [keys allObjects] : [NSArray array];
+ return keys ? [keys allObjects] : (NSArray *)[NSArray array];
}
/* keys */
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: entity=%@>",
+ return [NSString stringWithFormat:@"<%@[0x%p]: entity=%@>",
NSStringFromClass([self class]), self,
[self entityName]];
}
id tmp;
ms = [NSMutableString stringWithCapacity:128];
- [ms appendFormat:@"<%@[0x%08X]:", NSStringFromClass([self class]), self];
+ [ms appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self];
if ((tmp = [self entityName]))
[ms appendFormat:@" entity=%@", tmp];
if (_value == nil) _value = null;
#if DEBUG
- NSAssert1(_key, @"called -takeValue:0x%08X forKey:nil !", _value);
+ NSAssert1(_key, @"called -takeValue:0x%p forKey:nil !", _value);
#endif
value = eoGet(self, _key);
unsigned int i;
s = [[NSMutableString alloc] init];
- [s appendFormat:@"<0x%08X[%@]: %@",
+ [s appendFormat:@"<0x%p[%@]: %@",
self, NSStringFromClass([self class]),
[self entityName]];
self->plist = self->parent;
self->parent = lastParent;
- return obj ? obj : [NSNull null];
+ return obj != nil ? obj : (id)[NSNull null];
}
- (id)decodeObjectForKey:(NSString *)_key {
NSString *key;
key = (start < i)
- ? [StringClass stringWithCString:(const char *)
- &(buf[start]) length:(i - start)]
- : @"";
+ ? [[StringClass alloc] initWithCString:(const char *)&(buf[start])
+ length:(i - start)]
+ : (NSString *)@"";
- if ((value = [value valueForKey:key]) == nil)
+ value = [value valueForKey:key];
+ [key release]; key = nil;
+
+ if (value == nil)
return nil;
start = (i + 1); /* next part is after the pt */
/* check last part */
{
NSString *key;
+ id v;
key = (start < i)
- ? [StringClass stringWithCString:(const char *)
- &(buf[start]) length:(i - start)]
- : @"";
- return [value valueForKey:key];
+ ? [[StringClass alloc] initWithCString:(const char *)&(buf[start])
+ length:(i - start)]
+ : (id)@"";
+ v = [value valueForKey:key];
+ [key release]; key = nil;
+ return v;
}
#else
/* naive implementation */
[(NSMutableDictionary *)_ctx setObject:lv forKey:self->key];
}
- rv = self->value ? self->value : null;
+ rv = self->value != nil ? self->value : (id)null;
if (debugEval) {
NSLog(@"Eval: EOKeyValueQualifier:(%@ %@)\n"
}
}
- return keys ? [keys allObjects] : [NSArray array];
+ return keys ? [keys allObjects] : (NSArray *)[NSArray array];
}
/* keys */
if (qDebug) {
NSLog(@"%s: return <%@> for <%s> ", __PRETTY_FUNCTION__,
- obj?obj:@"<nil>", _buf);
+ obj != nil ? obj : (id)@"<nil>", _buf);
}
if (obj != nil) {
+ NSDictionary *d;
id keys[2], values[2];
keys[0] = @"length"; values[0] = [NSNumber numberWithUnsignedInt:pos];
keys[1] = @"object"; values[1] = obj;
- [_ctx setResult:
- [NSDictionary dictionaryWithObjects:values forKeys:keys count:2]
- forFunction:@"parseValue" atPos:(unsigned)_buf];
+ d = [[NSDictionary alloc] initWithObjects:values forKeys:keys count:2];
+ [_ctx setResult:d forFunction:@"parseValue" atPos:(unsigned)_buf];
+ [d release];
*_keyLen = pos;
}
return obj;
}
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: variable=%@>",
+ return [NSString stringWithFormat:@"<%@[0x%p]: variable=%@>",
NSStringFromClass([self class]), self,
[self key]];
}
- (NSString *)description {
return [NSString stringWithFormat:
- @"<0x%08X[%@]: key=%@ selector=%@>",
+ @"<0x%p[%@]: key=%@ selector=%@>",
self, NSStringFromClass([self class]),
[self key], NSStringFromSelector([self selector])];
}
# version file
-SUBMINOR_VERSION:=64
+SUBMINOR_VERSION:=65
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if (self->fetchSpecification != nil)
[ms appendFormat:@" fs=%@", self->fetchSpecification];
unsigned popts;
if (_selector == NULL) {
- NSLog(@"ERROR(0x%08X/%@): missing selector for predicate construction: %@",
+ NSLog(@"ERROR(0x%p/%@): missing selector for predicate construction: %@",
self, NSStringFromClass([self class]), self);
return nil;
}
+2006-07-03 Helge Hess <helge.hess@opengroupware.org>
+
+ * v4.5.184
+
+ * NGHashMap.m: improved memory management with exceptions
+
+ * FdExt.subproj/NSSet+enumerator.m: code cleanups
+
+ * use %p for pointer formats, fixed gcc 4.1 warnings
+
2006-05-16 Marcus Mueller <znek@mulle-kybernetik.com>
* *.h, *m: changed EOControl related includes into imports
- (NSString *)description {
NSString *fmt;
- fmt = [NSString stringWithFormat:@"<%@[0x%08X]: source=%@>",
+ fmt = [NSString stringWithFormat:@"<%@[0x%p]: source=%@>",
NSStringFromClass([self class]), self,
self->source];
return fmt;
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if (self->source != nil)
[ms appendFormat:@" source=%@", self->source];
- (NSString *)description {
NSString *fmt;
- fmt = [NSString stringWithFormat:@"<%@[0x%08X]: source=%@ map=%@>",
+ fmt = [NSString stringWithFormat:@"<%@[0x%p]: source=%@ map=%@>",
NSStringFromClass([self class]), self,
self->source, self->map];
return fmt;
}
}
else
- NSLog(@"startPos=0x%08X endPos=0x%08X", startPos, endPos);
+ NSLog(@"startPos=0x%p endPos=0x%p", startPos, endPos);
}
[exception setUserInfo:ui];
if (__autoreleaseEnableCheck) {
unsigned int toCome = [NSAutoreleasePool autoreleaseCountForObject:self];
if (toCome+1 > [self retainCount]) {
- NSLog(@"Release[0x%08X<%@>] release check for object %@ "
+ NSLog(@"Release[0x%p<%@>] release check for object %@ "
@"has %d references "
@"and %d pending calls to release in autorelease pools\n",
(unsigned)self, NSStringFromClass([self class]),
NSLog(@"ERROR(%s): missing format!", __PRETTY_FUNCTION__);
va_start(ap, _format);
- tmp = [[NSString allocWithZone:[self zone]]
- initWithFormat:_format ? _format : @"Exception"
- arguments:ap];
+ tmp = [[NSString alloc] initWithFormat:
+ _format ? _format : (NSString *)@"Exception"
+ arguments:ap];
va_end(ap);
self = [self initWithReason:tmp userInfo:nil];
- (NSString *)description {
NSMutableString *ms = [NSMutableString stringWithCapacity:32];
- [ms appendFormat:@"<0x%08X[%@]", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]", self, NSStringFromClass([self class])];
[ms appendFormat:@" path=%@", self->path];
[ms appendString:@">"];
return ms;
- (NSString *)loggingPrefix {
/* improve perf ... */
- return [NSStringClass() stringWithFormat:@"<0x%08X[%@]>",
+ return [NSStringClass() stringWithFormat:@"<0x%p[%@]>",
self, NSStringFromClass([self class])];
}
[ma addObject:arg];
}
- return foundDefault ? (id)ma : a;
+ return foundDefault ? (NSArray *)ma : a;
}
/* create temp file name */
if (![[NSFileManager defaultManager] fileExistsAtPath:p isDirectory:&isDir])
return nil;
- return isDir ? p : nil;
+ return isDir ? p : (NSString *)nil;
}
- (NSDictionary *)procStatusDictionary {
/*
- Copyright (C) 2000-2005 SKYRIX Software AG
+ Copyright (C) 2000-2006 SKYRIX Software AG
+ Copyright (C) 2006 Helge Hess
This file is part of SOPE.
02111-1307, USA.
*/
-#import "common.h"
-#import "NSSet+enumerator.h"
+#include "NSSet+enumerator.h"
+#include "common.h"
@implementation NSSet(enumerator)
return self;
}
-// mapping
+/* mapping */
- (NSArray *)mappedArrayUsingSelector:(SEL)_selector {
- NSArray *array = nil;
- NSSet *set = nil;
-
- set = [self mappedSetUsingSelector:_selector];
- if (set) {
- array = [[NSArray allocWithZone:[self zone]]
- initWithObjectsFromEnumerator:[set objectEnumerator]];
- }
- set = nil;
+ NSArray *array;
+ NSSet *set;
+
+ if ((set = [self mappedSetUsingSelector:_selector]) == nil)
+ return nil;
+
+ array = [[NSArray alloc]
+ initWithObjectsFromEnumerator:[set objectEnumerator]];
return [array autorelease];
}
- (NSArray *)mappedArrayUsingSelector:(SEL)_selector withObject:(id)_object {
- NSArray *array = nil;
- NSSet *set = nil;
-
- set = [self mappedSetUsingSelector:_selector withObject:_object];
- if (set) {
- array = [[NSArray allocWithZone:[self zone]]
- initWithObjectsFromEnumerator:[set objectEnumerator]];
- }
- set = nil;
+ NSArray *array;
+ NSSet *set;
+
+ if ((set = [self mappedSetUsingSelector:_selector withObject:_object])== nil)
+ return nil;
+
+ array = [[NSArray allocWithZone:[self zone]]
+ initWithObjectsFromEnumerator:[set objectEnumerator]];
return [array autorelease];
}
- (NSSet *)mappedSetUsingSelector:(SEL)_selector {
- NSMutableSet *set = [NSMutableSet setWithCapacity:[self count]];
- NSEnumerator *e = [self objectEnumerator];
- id object = nil;
+ NSMutableSet *set;
+ NSEnumerator *e;
+ id object;
- while ((object = [e nextObject])) {
+ set = [NSMutableSet setWithCapacity:[self count]];
+ e = [self objectEnumerator];
+ while ((object = [e nextObject]) != nil) {
object = [object performSelector:_selector];
-
- [set addObject:object ? object : [NSNull null]];
+
+ [set addObject:(object != nil ? object : (id)[NSNull null])];
}
return set;
}
- (NSSet *)mappedSetUsingSelector:(SEL)_selector withObject:(id)_object {
- NSMutableSet *set = [NSMutableSet setWithCapacity:[self count]];
- NSEnumerator *e = [self objectEnumerator];
- id object = nil;
-
- while ((object = [e nextObject])) {
+ NSMutableSet *set;
+ NSEnumerator *e;
+ id object;
+
+ set = [NSMutableSet setWithCapacity:[self count]];
+ e = [self objectEnumerator];
+ while ((object = [e nextObject]) != nil) {
object = [object performSelector:_selector withObject:_object];
- [set addObject:object ? object : [NSNull null]];
+ [set addObject:(object != nil ? object : (id)[NSNull null])];
}
return set;
}
-@end
+@end /* NSSet(enumerator) */
+
@implementation NSMutableSet(enumerator)
- (id)initWithObjectsFromEnumerator:(NSEnumerator *)_enumerator {
- if ((self = [self init])) {
- id obj = nil;
+ if ((self = [self init]) != nil) {
+ id obj;
- while ((obj = [_enumerator nextObject]))
+ while ((obj = [_enumerator nextObject]) != nil)
[self addObject:obj];
}
return self;
}
-@end
+@end /* NSMutableSet(enumerator) */
void __link_NGExtensions_NSSetEnumerator() {
__link_NGExtensions_NSSetEnumerator();
{
return ([self hasPrefix:_prefix])
? [self substringFromIndex:[_prefix length]]
- : [[self copy] autorelease];
+ : (NSString *)[[self copy] autorelease];
}
- (NSString *)stringWithoutSuffix:(NSString *)_suffix
{
return ([self hasSuffix:_suffix])
? [self substringToIndex:([self length] - [_suffix length])]
- : [[self copy] autorelease];
+ : (NSString *)[[self copy] autorelease];
}
- (NSString *)stringByReplacingString:(NSString *)_orignal
if (r.length > 0) {
return ([self length] > r.location)
? [self substringFromIndex:(r.location + r.length)]
- : @"";
+ : (NSString *)@"";
}
return nil;
}
$(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir))
endif
+ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64)
+SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64
+else
SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib
+endif
# Apple
- (NSString *)description {
return [NSString stringWithFormat:
- @"<NGBitSet[0x%08X]: capacity=%u count=%u content=%@>",
+ @"<NGBitSet[0x%p]: capacity=%u count=%u content=%@>",
(unsigned)self, self->universe, self->count,
[[self toArray] description]];
}
p = [bundle bundlePath];
if ([p hasSuffix:@"Libraries"]) {
if (debugOn) {
- fprintf(stderr, "%s: Dylib bundle: 0x%08X: %s\n",
+ fprintf(stderr, "%s: Dylib bundle: 0x%p: %s\n",
__PRETTY_FUNCTION__,
(unsigned int )bundle, [[bundle bundlePath] cString]);
}
}
else if ([p hasSuffix:@"Tools"]) {
if (debugOn) {
- fprintf(stderr, "%s: Tool bundle: 0x%08X: %s\n",
+ fprintf(stderr, "%s: Tool bundle: 0x%p: %s\n",
__PRETTY_FUNCTION__,
(unsigned int )bundle, [[bundle bundlePath] cString]);
}
rnKeys = ([_resourceName respondsToSelector:@selector(objectForKey:)])
? [_resourceName allKeys]
- : nil;
+ : (NSArray *)nil;
menum = NSEnumerateMapTable(self->pathToBundleInfo);
while (NSNextMapEnumeratorPair(&menum, (void *)&path, (void *)&bundleInfo)) {
ms = [NSMutableString stringWithCapacity:128];
- [ms appendFormat:@"<%@[0x%08X]: ", NSStringFromClass([self class]), self];
+ [ms appendFormat:@"<%@[0x%p]: ", NSStringFromClass([self class]), self];
[ms appendFormat:@" dir='%@'", self->topPath];
[ms appendFormat:@" cname='%@'", self->currentFileName];
NSString *r;
if (_key == nil) {
- r = [NSString stringWithFormat:@"nil key to be added in HashMap with object %@",
- _object ? _object : @"<nil>"];
- ui = [NSDictionary dictionaryWithObjectsAndKeys:
- _self, @"map",
- _key ? _key : @"<nil>",
- @"key",
- _object ? _object : @"<nil>",
- @"object",
- nil];
+ r = [[NSString alloc] initWithFormat:
+ @"nil key to be added in HashMap with object %@",
+ (_object != nil ? _object : (id)@"<nil>")];
+ ui = [[NSDictionary alloc] initWithObjectsAndKeys:
+ _self, @"map",
+ _key ? _key : (id)@"<nil>", @"key",
+ _object ? _object : (id)@"<nil>", @"object",
+ nil];
exc = [NSException exceptionWithName:NSInvalidArgumentException
reason:r userInfo:ui];
+ [r release]; r = nil;
+ [ui release]; ui = nil;
[exc raise];
}
if (_object == nil) {
- r = [NSString stringWithFormat:
- @"nil object to be added in HashMap for key %@",
- _key ? _key : @"<nil>"];
- ui = [NSDictionary dictionaryWithObjectsAndKeys:
- _self, @"map",
- _key ? _key : @"<nil>",
- @"key",
- _object ? _object : @"<nil>",
- @"object",
- nil];
+ r = [[NSString alloc] initWithFormat:
+ @"nil object to be added in HashMap for key %@",
+ _key ? _key : (id)@"<nil>"];
+ ui = [[NSDictionary alloc] initWithObjectsAndKeys:
+ _self, @"map",
+ _key ? _key : (id)@"<nil>", @"key",
+ _object ? _object : (id)@"<nil>", @"object",
+ nil];
exc = [NSException exceptionWithName:NSInvalidArgumentException
reason:r userInfo:ui];
+ [r release]; r = nil;
+ [ui release]; ui = nil;
[exc raise];
}
}
if (_object != nil && _key != nil)
return;
- r = [NSString stringWithFormat:
- @"nil object to be removed in HashMap for key %@",
- _key ? _key : @"<nil>"];
- ui = [NSDictionary dictionaryWithObjectsAndKeys:
- _self, @"map",
- _key ? _key : @"<nil>",
- @"key",
- _object ? _object : @"<nil>",
- @"object",
- nil];
+ r = [[NSString alloc] initWithFormat:
+ @"nil object to be removed in HashMap for key %@",
+ _key ? _key : (id)@"<nil>"];
+ ui = [[NSDictionary alloc] initWithObjectsAndKeys:
+ _self, @"map",
+ _key ? _key : (id)@"<nil>", @"key",
+ _object ? _object : (id)@"<nil>", @"object",
+ nil];
exc = [NSException exceptionWithName:NSInvalidArgumentException
reason:r userInfo:ui];
+ [ui release]; ui = nil;
+ [r release]; r = nil;
[exc raise];
}
if ((root = [self __structForKey:_key]) == NULL) {
if (_index > 0) {
[NSException raise:NSRangeException
- format:@"index %d out of range in map 0x%08X",
+ format:@"index %d out of range in map 0x%p",
_index, self];
return;
}
else {
if (!(_index < root->count)) {
[NSException raise:NSRangeException
- format:@"index %d out of range in map 0x%08X length %d",
+ format:@"index %d out of range in map 0x%p length %d",
_index, self, root->count];
return;
}
case NGLogLevelFatal: lvl = @"FATAL"; break;
default: lvl = @"ALL"; break;
}
- return [NSString stringWithFormat:@"<%@[0x%08X] date=%@ level=%@ msg:%@>",
+ return [NSString stringWithFormat:@"<%@[0x%p] date=%@ level=%@ msg:%@>",
NSStringFromClass([self class]), self,
[self date], lvl, self->msg];
}
case NGLogLevelFatal: lvl = @"FATAL"; break;
default: lvl = @"ALL"; break;
}
- return [NSString stringWithFormat:@"<%@[0x%08X] logLevel=%@ appenders:%@>",
+ return [NSString stringWithFormat:@"<%@[0x%p] logLevel=%@ appenders:%@>",
NSStringFromClass([self class]), self,
lvl, self->appenders];
}
- (NGLogger *)loggerForClass:(Class)_clazz {
NSString *name;
- name = _clazz != Nil ? NSStringFromClass(_clazz) : nil;
+ name = _clazz != Nil ? NSStringFromClass(_clazz) : (NSString *)nil;
return [self loggerForFacilityNamed:name];
}
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X] debugAll=%@ #loggers=%d>",
+ return [NSString stringWithFormat:@"<%@[0x%p] debugAll=%@ #loggers=%d>",
NSStringFromClass([self class]), self,
debugAll ? @"YES" : @"NO", [self->loggerMap count]];
}
unsigned count;
selector = _selector;
- signature = selector ? va_arg(*va, NSString *) : nil;
+ signature = selector ? va_arg(*va, NSString *) : (NSString *)nil;
imp = signature ? va_arg(*va, IMP) : NULL;
count = 0;
while ((selector != NULL) && (signature != nil) && (imp != NULL)) {
NSString *apath;
if (pathes != nil)
- return [pathes isNotNull] ? pathes : nil;
+ return [pathes isNotNull] ? pathes : (NSArray *)nil;
env = [[NSProcessInfo processInfo] environment];
if ((apath = [env objectForKey:@"GNUSTEP_PATHPREFIX_LIST"]) == nil)
e = ([self->gsSubPath length] > 0)
? [[self gsRootPathes] objectEnumerator]
- : nil;
- while ((p = [e nextObject])) {
+ : (NSEnumerator *)nil;
+ while ((p = [e nextObject]) != nil) {
p = [p stringByAppendingPathComponent:self->gsSubPath];
if ([ma containsObject:p])
continue;
e = ([self->fhsSubPath length] > 0)
? [[self fhsRootPathes] objectEnumerator]
- : nil;
- while ((p = [e nextObject])) {
+ : (NSEnumerator *)nil;
+ while ((p = [e nextObject]) != nil) {
p = [p stringByAppendingPathComponent:self->fhsSubPath];
if ([ma containsObject:p])
continue;
if (self->nameToPathCache == nil)
self->nameToPathCache = [[NSMutableDictionary alloc] initWithCapacity:64];
- [self->nameToPathCache setObject:_path?_path:(id)[NSNull null] forKey:_name];
+ [self->nameToPathCache setObject:(_path ? _path : (NSString *)[NSNull null])
+ forKey:_name];
}
/* operation */
if (![_name isNotNull] || [_name length] == 0)
return nil;
- if ((p = [self->nameToPathCache objectForKey:_name]))
- return [p isNotNull] ? p : nil;
+ if ((p = [self->nameToPathCache objectForKey:_name]) != nil)
+ return [p isNotNull] ? p : (NSString *)nil;
e = [[self searchPathes] objectEnumerator];
while ((p = [e nextObject]) != nil) {
NSArray *lSearchPathes;
unsigned i, count;
- _ext = [_ext length] > 0 ? [@"." stringByAppendingString:_ext] :nil;
+ _ext = ([_ext length] > 0)
+ ? [@"." stringByAppendingString:_ext]
+ : (NSString *)nil;
+
uniquer = [NSMutableSet setWithCapacity:128];
pathes = _withPath ? [NSMutableArray arrayWithCapacity:64] : nil;
lSearchPathes = [self searchPathes];
}
}
- return _withPath ? pathes : [uniquer allObjects];
+ return _withPath ? (NSArray *)pathes : [uniquer allObjects];
}
/* description */
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:128];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
[ms appendFormat:@" gs=%@ fhs=%@", self->gsSubPath, self->fhsSubPath];
/* description */
- (NSString *)valueStringValue {
- return [self->value isKindOfClass:[NSNumber class]]
- ? [self->value stringValue]
- : [NSString stringWithFormat:@"\"%@\"", self->value];
+ NSMutableString *ms;
+
+ if ([self->value isKindOfClass:[NSNumber class]])
+ return [self->value stringValue];
+
+ ms = [NSMutableString stringWithCapacity:64];
+ [ms appendString:@"\""];
+ [ms appendString:[self->value stringValue]];
+ [ms appendString:@"\""];
+ return ms;
}
- (NSString *)stringValue {
- return [NSString stringWithFormat:@"%@ = %@",
- [self keyPath],
- [self valueStringValue]];
+ NSMutableString *ms;
+
+ ms = [NSMutableString stringWithCapacity:64];
+ [ms appendString:[[self keyPath] description]];
+ [ms appendString:@" = "];
+ [ms appendString:[self valueStringValue]];
+ return ms;
}
- (NSString *)description {
@end /* NGRuleAssignment */
+
@implementation NGRuleKeyAssignment
/* operations */
[self debugWithFormat:@" rule %i matches: %@", i, rule];
v = [[rule action] fireInContext:self];
- [values addObject:(v ? v : [NSNull null])];
+ [values addObject:(v != nil ? v : (id)[NSNull null])];
}
}
if (self->debugOn)
/* calculate the rule value */
ruleValue = [self valueForKey:_kp];
- [results addObject:ruleValue ? ruleValue : [NSNull null]];
+ [results addObject:(ruleValue != nil ? ruleValue : (id)[NSNull null])];
}
return results;
}
- (NSString *)description {
return [NSString stringWithFormat:
- @"<%@[0x%08X] capacity=%u SP=%u count=%u content=%s>",
+ @"<%@[0x%p] capacity=%u SP=%u count=%u content=%s>",
NSStringFromClass([self class]), (unsigned)self,
[self capacity], [self stackPointer], [self count],
[[[self toArray] description] cString]];
# version
-SUBMINOR_VERSION:=183
+SUBMINOR_VERSION:=184
# v4.3.115 requires libFoundation v1.0.59
# v4.2.72 requires libEOControl v4.2.39
+2006-07-03 Helge Hess <helge.hess@opengroupware.org>
+
+ * use %p for pointer formats, fixed gcc 4.1 warnings (v4.5.50)
+
2005-08-10 Helge Hess <helge.hess@opengroupware.org>
* reorganized inclusion to support frameworks (v4.5.49)
$(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir))
endif
+ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64)
+SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64
+else
SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib
+endif
# activating SSL support
: (int)(self->receiveTimeout * 1000.0));
#if DEBUG
if ((readResult < 0) && (errno == EINVAL)) {
- NSLog(@"%s: invalid argument in NGDescriptorRecv(%i, 0x%08X, %i, %i)",
+ NSLog(@"%s: invalid argument in NGDescriptorRecv(%i, 0x%p, %i, %i)",
__PRETTY_FUNCTION__,
self->fd, _buf, _len, 0,
(self->receiveTimeout == 0.0)
- (NSString *)description {
NSMutableString *d = [NSMutableString stringWithCapacity:64];
- [d appendFormat:@"<%@[0x%08X]: mode=%@ address=%@",
+ [d appendFormat:@"<%@[0x%p]: mode=%@ address=%@",
NSStringFromClass([self class]),
(unsigned)self,
[self modeDescription], [self localAddress]];
ms = [NSMutableString stringWithCapacity:128];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if (self->source) [ms appendFormat:@" source=%@", self->source];
[ms appendFormat:@" mode=%@", [self modeDescription]];
}
NS_ENDHANDLER;
- return buffer ? NGCharBuffer8_makeStringAndDealloc(buffer) : nil;
+ return buffer ? NGCharBuffer8_makeStringAndDealloc(buffer) : (NSString *)nil;
}
- (NSEnumerator *)lineEnumerator {
// description
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X] source=%@ la=%d",
+ return [NSString stringWithFormat:@"<%@[0x%p] source=%@ la=%d",
NSStringFromClass([self class]),
(unsigned)self,
self->source,
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: from=%@ to=%@ size=%i>",
+ return [NSString stringWithFormat:@"<%@[0x%p]: from=%@ to=%@ size=%i>",
NSStringFromClass([self class]), (unsigned)self,
[self sender], [self receiver], [self packetSize]];
}
}
if (enableDescLogging) {
- NSLog(@"%s(fd=%i,buf=0x%08X,len=%i,flags=%i,timeout=%i)",
+ NSLog(@"%s(fd=%i,buf=0x%p,len=%i,flags=%i,timeout=%i)",
__PRETTY_FUNCTION__, _fd,_buf,_len,_flags,_timeout);
}
if (enableDescLogging) {
if ((result < 0) && (errorCode == EINVAL)) {
- NSLog(@"%s: invalid argument in recv(%i, 0x%08X, %i, %i)",
+ NSLog(@"%s: invalid argument in recv(%i, 0x%p, %i, %i)",
__PRETTY_FUNCTION__, _fd, _buf, _len, _flags);
}
}
- (NSString *)description {
return [NSString stringWithFormat:
- @"<%@[0x%08X] path=%@ mode=%@>",
+ @"<%@[0x%p] path=%@ mode=%@>",
NSStringFromClass([self class]), (unsigned)self,
- self->systemPath ? self->systemPath : @"nil",
+ self->systemPath ? self->systemPath : (NSString *)@"nil",
[self modeDescription]];
}
-@end
+@end /* NGFileStream */
+
@implementation _NGConcreteFileStreamFileHandle
- (NSString *)description {
return [NSString stringWithFormat:
- @"<%@[0x%08X] source=%@ mode=%@>",
+ @"<%@[0x%p] source=%@ mode=%@>",
NSStringFromClass([self class]), (unsigned)self,
self->source ? (id)self->source : (id)@"nil",
[self modeDescription]];
id tmp;
ms = [NSMutableString stringWithCapacity:128];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if ((tmp = [self hostName]) != nil)
[ms appendFormat:@" host=%@", tmp];
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<InternetDomain[0x%08X]>", (unsigned)self];
+ return [NSString stringWithFormat:@"<InternetDomain[0x%p]>", (unsigned)self];
}
@end /* NGInternetSocketDomain */
int addressCounter = 0;
NSString *newPath;
- newPath = [NSString stringWithFormat:@"_ngsocket_%08X_%08X_%03d",
+ newPath = [NSString stringWithFormat:@"_ngsocket_%p_%p_%03d",
getpid(), [NSThread currentThread], addressCounter];
newPath = [socketDirectoryPath stringByAppendingPathComponent:newPath];
NSString *path;
path = (_length < 3)
- ? @""
- : [NSString stringWithCString:nun->sun_path];
+ ? (id)@""
+ : [[NSString alloc] initWithCString:nun->sun_path];
- return [self initWithPath:path];
+ self = [self initWithPath:path];
+ [path release]; path = nil;
+ return self;
}
- (void)dealloc {
- (NSString *)stringValue {
NSString *p = [self path];
- return [p length] == 0 ? @"*" : (id)p;
+ return [p length] == 0 ? (NSString *)@"*" : p;
}
- (NSString *)description {
if ([p length] == 0)
p = @"[no path]";
- return [NSString stringWithFormat:@"<0x%08X[%@]: %@>",
- self, NSStringFromClass([self class]),
- p];
+ return [NSString stringWithFormat:@"<0x%p[%@]: %@>",
+ self, NSStringFromClass([self class]), p];
}
-@end
+@end /* NGLocalSocketAddress */
#endif /* !WIN32 */
- (NSString *)description {
return [NSString stringWithFormat:
- @"<UnixDomain: self=0x%08X>", (unsigned)self];
+ @"<UnixDomain: self=0x%p>", (unsigned)self];
}
@end /* NGLocalSocketDomain */
- (NSString *)description {
return [NSString stringWithFormat:
- @"<%@[0x%08X]: fd=%i type=%i bound=%@ domain=%@>",
+ @"<%@[0x%p]: fd=%i type=%i bound=%@ domain=%@>",
NSStringFromClass([self class]), (unsigned)self,
[self fileDescriptor],
[self socketType],
}
- (id)initWithHostName:(NSString *)_name reason:(NSString *)_reason {
- self = [super initWithReason:
- [NSString stringWithFormat:
- @"Could not resolve host %@: %@",
- _name, _reason ? _reason : @"error"]
- socket:nil];
- if (self) {
+ NSString *r;
+
+ r = [[NSString alloc] initWithFormat:@"Could not resolve host %@: %@",
+ _name, _reason ? _reason : (NSString *)@"error"];
+ if ((self = [super initWithReason:r socket:nil]) != nil) {
self->hostName = [_name copy];
}
+ [r release]; r = nil;
+
return self;
}
- (NSString *)description {
return [NSString stringWithFormat:
- @"<%@[0x%08X] mode=%@>",
+ @"<%@[0x%p] mode=%@>",
NSStringFromClass([self class]), (unsigned)self,
[self modeDescription]];
}
class_get_class_name(_object));
}
else {
- NSLog(@"encoding reference to object 0x%08X<%s> ..",
+ NSLog(@"encoding reference to object 0x%p<%s> ..",
_object, class_get_class_name(*(Class *)_object));
}
#endif
class_get_class_name(_object), [_object version]);
}
else {
- NSLog(@"encoding object 0x%08X<%s> ..",
+ NSLog(@"encoding object 0x%p<%s> ..",
_object, class_get_class_name(*(Class *)_object));
}
#endif
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<0x%08X[%@]: in=%i out=%i>",
+ return [NSString stringWithFormat:@"<0x%p[%@]: in=%i out=%i>",
self, NSStringFromClass([self class]),
self->fildes[0], self->fildes[1]];
}
- (NSString *)description {
return [NSString stringWithFormat:
- @"<%@[0x%08X] task=%@ mode=%@>",
+ @"<%@[0x%p] task=%@ mode=%@>",
NSStringFromClass([self class]), (unsigned)self,
self->task,
[self modeDescription]];
#if defined(WIN32)
return nil;
#else
- return [self isOpen] ? NGDescriptorGetTtyName(self->fd) : nil;
+ return [self isOpen] ? NGDescriptorGetTtyName(self->fd) : (NSString *)nil;
#endif
}
-@end
+@end /* NGFileStream(NGTerminalSupport) */
+
@implementation NGFilterStream(NGTerminalSupport)
: NO;
}
-@end
+@end /* NGFilterStream(NGTerminalSupport) */
+
@implementation NGTextStream(NGTerminalSupport)
return nil;
}
-@end
+@end /* NGTextStream(NGTerminalSupport) */
+
@implementation NGCTextStream(NGTerminalSupport)
: NO;
}
-@end
+@end /* NGCTextStream(NGTerminalSupport) */
void __link_NGStreams_NGTerminalSupport(void) {
__link_NGStreams_NGTerminalSupport();
# version file
-SUBMINOR_VERSION:=49
+SUBMINOR_VERSION:=50
ifneq ($(FHS_INSTALL_ROOT),)
FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/
-FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/
FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/
+ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64)
+FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/
+else
+FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/
+endif
+
fhs-header-dirs ::
$(MKDIRS) $(FHS_INCLUDE_DIR)$(libNGStreams_HEADER_FILES_INSTALL_DIR)
c = [NSObject subclass:@"MyObject"
ivars:@"blah", @"@", @"blub", @"c", @"blab", @"s", nil];
- printf("MyObject is 0x%08X\n", (unsigned)c);
+ printf("MyObject is 0x%p\n", (unsigned)c);
printf("MyObject name is %s\n", c->name);
printf("MyObject super-name is %s\n", c->super_class->name);
c = [NSRunLoop subclass:@"MyRunLoop"
ivars:@"blah", @"@", @"blub", @"c", @"blab", @"s", nil];
- printf("MyRunLoop is 0x%08X\n", (unsigned int)c);
+ printf("MyRunLoop is 0x%p\n", (unsigned int)c);
printf("MyRunLoop name is %s\n", c->name);
printf("MyRunLoop super-name is %s\n", c->super_class->name);