/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<0x%08X[%@]>",
+ return [NSString stringWithFormat:@"<0x%p[%@]>",
self, NSStringFromClass([self class])];
}
if (info->type == WOKeyType_method) {
#if HEAVY_DEBUG
[self logWithFormat:@"get key %s of keyPath %@\n"
- @" from: 0x%08X[%@]\n"
+ @" from: 0x%p[%@]\n"
@" via method (ret %c)",
info->ckey, [self keyPath], object,
NSStringFromClass([object class]), info->retType];
if ((info->retType == _C_ID) || (info->retType == _C_CLASS)) {
retValue.object = info->access.method(object, info->extra.sel.get);
#if HEAVY_DEBUG
- [self logWithFormat:@" got result 0x%08X[%@]: %@", retValue.object,
+ [self logWithFormat:@" got result 0x%p[%@]: %@", retValue.object,
NSStringFromClass([retValue.object class]),
retValue.object];
#endif
break;
}
- // NSLog(@"made %@[0x%08X].", NSStringFromClass([result class]), result);
+ // NSLog(@"made %@[0x%p].", NSStringFromClass([result class]), result);
return result;
}
}
#if 0
- [self logWithFormat:@"ret value object for key '%s' is 0x%08X",
+ [self logWithFormat:@"ret value object for key '%s' is 0x%p",
info->ckey, retValue.object];
[self logWithFormat:@"ret value object class is %@",
[retValue.object class]];
}
- (NSString *)description {
- return [StringClass stringWithFormat:@"<%@[0x%08X]: keyPath=%@>",
+ return [StringClass stringWithFormat:@"<%@[0x%p]: keyPath=%@>",
NSStringFromClass([self class]), self,
[self keyPath]];
}
NSMutableString *str;
str = [NSMutableString stringWithCapacity:64];
- [str appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [str appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if (self->flags.isKeyKeyPath)
[str appendFormat:@" key=%@", self->key];
return doDebug;
}
- (NSString *)loggingPrefix {
- return [NSString stringWithFormat:@"[rsrc:url assoc:0x%08X]", self];
+ return [NSString stringWithFormat:@"[rsrc:url assoc:0x%p]", self];
}
/* description */
NSMutableString *str;
str = [NSMutableString stringWithCapacity:64];
- [str appendFormat:@"<%@[0x%08X]:", NSStringFromClass([self class]), self];
+ [str appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self];
[str appendFormat:@" rsrc='%@'", [self resourceName]];
[str appendString:@">"];
return str;
NSString *v;
str = [NSMutableString stringWithCapacity:64];
- [str appendFormat:@"<%@[0x%08X]: script(%@)=",
+ [str appendFormat:@"<%@[0x%p]: script(%@)=",
NSStringFromClass([self class]), self, [self language]];
v = self->script;
NSMutableString *str;
str = [NSMutableString stringWithCapacity:64];
- [str appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [str appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
[str appendString:@" value="];
if ([self->value isKindOfClass:StrClass]) {
NSString *v = self->value;
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: %s",
+ return [NSString stringWithFormat:@"<%@[0x%p]: %s",
NSStringFromClass([self class]), self,
self->value ? "YES" : "NO"];
}
+2006-07-03 Helge Hess <helge.hess@opengroupware.org>
+
+ * use %p for pointer formats, fixed gcc 4.1 warnings, use
+ -warnWithFormat: when appropriate (v4.5.239)
+
2006-06-22 Helge Hess <helge.hess@opengroupware.org>
* DAVPropMap.plist: added three more WebDrive properties,
- (id)invokeActionForRequest:(WORequest *)_request
inContext:(WOContext *)_ctx
{
- [[_ctx session] logWithFormat:@"%@[0x%08X]: no action/page set !",
+ [[_ctx session] logWithFormat:@"%@[0x%p]: no action/page set !",
NSStringFromClass([self class]), self];
return nil;
}
if (page == nil) {
[[_ctx session] logWithFormat:
- @"%@[0x%08X]: did not find page with name %@ !",
+ @"%@[0x%p]: did not find page with name %@ !",
NSStringFromClass([self class]), self, name];
}
return page;
NSString *key;
keys = [self->queryParameters keyEnumerator];
- while ((key = [keys nextObject])) {
+ while ((key = [keys nextObject]) != nil) {
id assoc, value;
assoc = [self->queryParameters objectForKey:key];
value = [assoc stringValueInComponent:sComponent];
- [qd setObject:(value ? value : @"") forKey:key];
+ [qd setObject:(value != nil ? value : (id)@"") forKey:key];
}
}
- (NSString *)associationDescription {
NSMutableString *str = [NSMutableString stringWithCapacity:256];
- if (self->actionClass)
+ if (self->actionClass != nil)
[str appendFormat:@" actionClass=%@", self->actionClass];
- if (self->directActionName)
+ if (self->directActionName != nil)
[str appendFormat:@" directAction=%@", self->directActionName];
[str appendString:[super associationDescription]];
v = (self->value != nil)
? [self->value stringValueInComponent:sComponent]
- : [NSString stringWithFormat:@"%i", i]; // TODO: slow
+ : (NSString *)[NSString stringWithFormat:@"%i", i]; // TODO: slow
displayV = self->string
? [self->string stringValueInComponent:sComponent]
[_response appendContentHTMLAttributeValue:
OWFormElementName(self, _ctx)];
WOResponse_AddCString(_response, "\" value=\"");
- [_response appendContentHTMLAttributeValue:([v length] > 0) ? v : @"1"];
+ [_response appendContentHTMLAttributeValue:
+ ([v isNotEmpty] ? v : (NSString *)@"1")];
WOResponse_AddCString(_response, "\"");
if ([self->disabled boolValueInComponent:[_ctx component]]) {
NSMutableString *desc;
desc = [NSMutableString stringWithCapacity:64];
- [desc appendFormat:@"<%@[0x%08X]:", NSStringFromClass([self class]), self];
+ [desc appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self];
if (self->child != nil) {
- [desc appendFormat:@" child=%@[0x%08X] childName=%@",
+ [desc appendFormat:@" child=%@[0x%p] childName=%@",
NSStringFromClass([self->child class]),
self->child, [self->child name]];
}
for (j = [_ctx componentStackCount] + depth; j >= 0; j--)
printf(" ");
#endif
- printf(" Child of 0x%08X: i[%i] %s <%s>: %0.3fs\n",
- (unsigned int)self,
- i, [[_ctx elementID] cString],
- [child class]->name,
+ printf(" Child of 0x%p: i[%i] %s <%s>: %0.3fs\n",
+ self, i, [[_ctx elementID] cString], [child class]->name,
diff);
}
}
for (i = [_ctx componentStackCount] + depth; i >= 0; i--)
printf(" ");
#endif
- printf("CompoundElem0x%08X(#%i) %s (component=%s): %0.3fs\n",
- (unsigned int)self,
- self->count,
- [[_ctx elementID] cString],
+ printf("CompoundElem0x%p(#%i) %s (component=%s): %0.3fs\n",
+ self, self->count, [[_ctx elementID] cString],
[[(WOComponent *)[_ctx component] name] cString],
diff);
}
template:(WOElement *)_c
{
#if DEBUG
- self->condName = _name ? [_name copy] : @"condYES";
+ self->condName = _name ? [_name copy] : (id)@"condYES";
#endif
if ((self = [super initWithName:_name associations:_config template:_c])) {
self->template = [_c retain];
if (self->condition == nil) {
- [self logWithFormat:
- @"WARNING: missing 'condition' association in element: '%@'",
- _name];
+ [self warnWithFormat:
+ @"missing 'condition' association in element: '%@'", _name];
}
}
return self;
}
#if DEBUG
- [_ctx appendElementIDComponent:descriptiveIDs ? self->condName : @"1"];
+ [_ctx appendElementIDComponent:
+ descriptiveIDs ? self->condName : (NSString *)@"1"];
#else
[_ctx appendElementIDComponent:@"1"];
#endif
[_ctx consumeElementID]; // consume state-id (on or off)
#if DEBUG
- key = descriptiveIDs ? self->condName : @"1";
+ key = descriptiveIDs ? self->condName : (NSString *)@"1";
#else
key = @"1";
#endif
if (!_doShow(self, _ctx))
return;
#if DEBUG
- [_ctx appendElementIDComponent:descriptiveIDs ? self->condName : @"1"];
+ [_ctx appendElementIDComponent:
+ descriptiveIDs ? self->condName : (NSString *)@"1"];
#else
[_ctx appendElementIDComponent:@"1"];
#endif
response = [_ctx response];
[response setContent:adata];
- [response setHeader:atype ? atype : @"application/octet-stream"
+ [response setHeader:
+ (atype != nil ? atype :(NSString *)@"application/octet-stream")
forKey:@"content-type"];
return response;
if (page == nil) {
[[_ctx session] logWithFormat:
- @"%@[0x%08X]: did not find page with name %@ !",
+ @"%@[0x%p]: did not find page with name %@ !",
NSStringFromClass([self class]), self, pname];
}
NSLog(@"showing page %@", page);
assoc = [self->queryParameters objectForKey:key];
value = [assoc stringValueInComponent:sComponent];
-
- [qd setObject:(value ? value : @"") forKey:key];
+
+ [qd setObject:(value != nil ? value : (id)@"") forKey:key];
}
}
assoc = [self->queryParameters objectForKey:key];
value = [assoc stringValueInComponent:sComponent];
- [qd setObject:(value ? value : @"") forKey:key];
+ [qd setObject:(value != nil ? value : (id)@"") forKey:key];
}
}
children = [_element hasChildNodes]
? [_builder buildNodes:[_element childNodes] templateBuilder:_builder]
- : nil;
+ : (NSArray *)nil;
/* construct self ... */
self = [(WODynamicElement *)self initWithName:name
return [object performSelector:act];
[[_ctx component] logWithFormat:
- @"%@[0x%08X]: %@ does not respond to action @%@",
+ @"%@[0x%p]: %@ does not respond to action @%@",
NSStringFromClass([self class]), self,
object,
NSStringFromSelector(act)];
/* add ?style parameters */
- if (self->queryParameters) {
+ if (self->queryParameters != nil) {
NSEnumerator *keys;
NSString *key;
assoc = [self->queryParameters objectForKey:key];
value = [assoc stringValueInComponent:sComponent];
- [qd setObject:(value ? value : @"") forKey:key];
+ [qd setObject:(value != nil ? value : (id)@"") forKey:key];
}
}
return (self == WOImageClass)
? (id)temporaryImage
- : NSAllocateObject(self, 0, zone);
+ : (id)NSAllocateObject(self, 0, zone);
}
/* request handling */
response = [_ctx response];
[response setContent:adata];
- [response setHeader:atype ? atype : @"application/octet-stream"
+ [response setHeader:
+ (atype != nil ? atype : (NSString *)@"application/octet-stream")
forKey:@"content-type"];
return response;
#endif
return;
-#if __APPLE__
- // TODO: same issue with gcc 4.1 on Linux ...
- // make Tiger GCC happy
- [super dealloc];
-#endif
+ // same issue with gcc 4.1 on Linux ..., make Tiger GCC happy
+ if (0) [super dealloc];
}
@end /* _WOTemporaryImage */
if (page == nil) {
[[_ctx session] logWithFormat:
- @"%@[0x%08X]: did not find page with name %@ !",
+ @"%@[0x%p]: did not find page with name %@ !",
NSStringFromClass([self class]), self, pname];
}
NSLog(@"%@: showing page %@", self, page);
if (page == nil) {
[[_ctx component] logWithFormat:
- @"%@[0x%08X]: did not find page with name %@ !",
+ @"%@[0x%p]: did not find page with name %@ !",
NSStringFromClass([self class]), self, name];
}
[self debugWithFormat:@"showing page %@", page];
}
[[_ctx component]
- logWithFormat:@"%@[0x%08X]: no action/page set !",
+ logWithFormat:@"%@[0x%p]: no action/page set !",
NSStringFromClass([self class]), self];
return nil;
}
[self->item setValue:object inComponent:sComponent];
isSelected = sel ? [sel isEqual:object] : NO;
- v = self->value
+ v = (self->value != nil)
? [self->value stringValueInComponent:sComponent]
- : [NSString stringWithFormat:@"%i", i];
+ : (NSString *)[NSString stringWithFormat:@"%i", i];
if (byVal){
isSelected = sel ? [sel isEqual:v] : NO;
group = self->itemGroup != nil
? [self->itemGroup stringValueInComponent:sComponent]
- : nil;
+ : (NSString *)nil;
if (group != nil) {
BOOL groupChanged = NO;
return (self == WORepetitionClass)
? (id)temporaryRepetition
- : NSAllocateObject(self, 0, zone);
+ : (id)NSAllocateObject(self, 0, zone);
}
- (id)initWithName:(NSString *)_name
}
#if DEBUG
- self->repName = _name ? [_name copy] : @"R";
+ self->repName = _name ? [_name copy] : (id)@"R";
#endif
if ((self = [super initWithName:_name associations:_config template:_c])) {
response = [_ctx response];
[response setContent:adata];
- [response setHeader:atype ? atype : @"application/octet-stream"
+ [response setHeader:
+ (atype != nil ? atype : (NSString *)@"application/octet-stream")
forKey:@"content-type"];
return response;
lObject = (self->object != nil)
? [self->object valueInContext:_ctx]
- : [_ctx response];
+ : (id)[_ctx response];
if ([lObject isKindOfClass:[NSString class]])
lObject = [self objectForKey:(NSString *)lObject inContext:_ctx];
[lObject appendHeader:v forKey:k];
}
else
- [lObject setHeader:([v isNotNull] ? v : nil) forKey:k];
+ [lObject setHeader:([v isNotNull] ? v : (NSString *)nil) forKey:k];
}
@end /* WOSetHeader */
return (self == WOStringClass)
? (id)temporaryString
- : NSAllocateObject(self, 0, zone);
+ : (id)NSAllocateObject(self, 0, zone);
}
@end /* WOString */
+
@implementation _WOSimpleDynamicString
- (id)initWithName:(NSString *)_name
#endif
return;
-#if __APPLE__
- // make Tiger GCC happy
- [super dealloc];
-#endif
+ /* make Tiger GCC / gcc 4.1 happy */
+ if (0) [super dealloc];
}
@end /* _WOTemporaryString */
if (page == nil) {
[[_ctx session] logWithFormat:
- @"%@[0x%08X]: did not find page with name %@ !",
+ @"%@[0x%p]: did not find page with name %@ !",
NSStringFromClass([self class]), self, pname];
}
[self logWithFormat:@"showing page %@", page];
WOResponse_AddCString(_response, "<a href=\"");
/* href */
- if (self->queryParameters) {
+ if (self->queryParameters != nil) {
NSEnumerator *keys;
NSString *key;
assoc = [self->queryParameters objectForKey:key];
value = [assoc stringValueInComponent:sComponent];
- [qd setObject:(value ? value : @"") forKey:key];
+ [qd setObject:(value != nil ? value : (NSString *)@"") forKey:key];
}
}
else
return [self->template invokeActionForRequest:_rq inContext:_ctx];
/* link is active */
- [[_ctx session] logWithFormat:@"%@[0x%08X]: no action/page set !",
+ [[_ctx session] logWithFormat:@"%@[0x%p]: no action/page set !",
NSStringFromClass([self class]), self];
return nil;
}
/* avoid creating a new URL for ".", just return the base */
url = [s isEqualToString:@"."]
? base
- : [NSURLClass URLWithString:s relativeToURL:base];
+ : (NSURL *)[NSURLClass URLWithString:s relativeToURL:base];
}
else {
- [self logWithFormat:@"WARNING: missing base URL in context ..."];
+ [self warnWithFormat:@"missing base URL in context ..."];
WOResponse_AddString(_r, s);
return YES;
}
if (page == nil) {
[[_ctx session] logWithFormat:
- @"%@[0x%08X]: did not find page with name %@ !",
+ @"%@[0x%p]: did not find page with name %@ !",
NSStringFromClass([self class]), self, name];
}
return page;
/* add ?style parameters */
- if (self->queryParameters) {
+ if (self->queryParameters != nil) {
NSEnumerator *keys;
NSString *key;
assoc = [self->queryParameters objectForKey:key];
value = [assoc stringValueInComponent:sComponent];
- [qd setObject:(value ? value : @"") forKey:key];
+ [qd setObject:(value != nil ? value : (id)@"") forKey:key];
}
}
if ((rm = [[_ctx component] resourceManager]) == nil)
rm = [[_ctx application] resourceManager];
- languages = [_ctx hasSession] ? [[_ctx session] languages] : nil;
+ languages = [_ctx hasSession] ? [[_ctx session] languages] : (NSArray *)nil;
/* If 'framework' binding is not set, use parent component's framework */
if (self->framework){
#endif
return;
-#if __APPLE__
- // make Tiger GCC happy
- [super dealloc];
-#endif
+ // make Tiger GCC / gcc 4.1 happy
+ if (0) [super dealloc];
}
@end /* _WOTemporaryHyperlink */
- (NSString *)description {
NSMutableString *str = [NSMutableString stringWithCapacity:128];
- [str appendFormat:@"<%@[0x%08X]: name=%@ value=%@",
+ [str appendFormat:@"<%@[0x%p]: name=%@ value=%@",
NSStringFromClass([self class]), self,
self->name, self->value];
}
- (NSString *)description {
- return [NSString stringWithFormat:@"<HostField[0x%08X]: host=%@ port=%i>",
+ return [NSString stringWithFormat:@"<HostField[0x%p]: host=%@ port=%i>",
self, [self hostName], [self port]];
}
}
- (NSString *)description {
- return [NSString stringWithFormat:@"<HttpCharset[0x%08X]: %@>",
+ return [NSString stringWithFormat:@"<HttpCharset[0x%p]: %@>",
self, self->charsets];
}
}
- (NSString *)description {
- return [NSString stringWithFormat:@"<HttpMimeTypes[0x%08X]: %@>",
+ return [NSString stringWithFormat:@"<HttpMimeTypes[0x%p]: %@>",
self, self->types];
}
}
- (NSString *)description {
- return [NSString stringWithFormat:@"<HttpLanguages[0x%08X]: %@>",
+ return [NSString stringWithFormat:@"<HttpLanguages[0x%p]: %@>",
self, self->languages];
}
- (NSString *)description {
return [NSString stringWithFormat:
- @"<HttpUserAgent[0x%08X]: %@ "
+ @"<HttpUserAgent[0x%p]: %@ "
@"(detected=%@, major=%i, minor=%i)>",
self, self->value, self->browser,
self->majorVersion, self->minorVersion];
- (NSString *)description {
return [NSString stringWithFormat:
- @"<HttpConnection[0x%08X]: keepAlive=%s close=%s TE=%s>",
+ @"<HttpConnection[0x%p]: keepAlive=%s close=%s TE=%s>",
self,
self->keepAlive ? "yes" : "no",
self->close ? "yes" : "no",
}
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: %@>",
+ return [NSString stringWithFormat:@"<%@[0x%p]: %@>",
NSStringFromClass([self class]), self,
[self stringValue]];
}
- (NSString *)description {
return [NSString stringWithFormat:
- @"<BasicCredentials[0x%08X]: user=%@ hasPassword=%s>",
+ @"<BasicCredentials[0x%p]: user=%@ hasPassword=%s>",
self,
[self userName],
self->password ? "yes" : "no"
}
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: %@>",
+ return [NSString stringWithFormat:@"<%@[0x%p]: %@>",
NSStringFromClass([self class]), self,
[self stringValue]];
}
return _cdef;
cacheKey = [NSArray arrayWithObjects:_name, _languages, nil];
- NSMapInsert(self->componentDefinitions, cacheKey, _cdef ? _cdef : null);
+ NSMapInsert(self->componentDefinitions, cacheKey, _cdef ? _cdef : (id)null);
return _cdef;
}
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: path=%@>",
+ return [NSString stringWithFormat:@"<%@[0x%p]: path=%@>",
[self class], self, self->base];
}
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
[self appendAttributesToDescription:ms];
[ms appendString:@">"];
return ms;
/* Logging */
- (NSString *)loggingPrefix {
- return [NSString stringWithFormat:@"[so-action 0x%08X %@]",
+ return [NSString stringWithFormat:@"[so-action 0x%p %@]",
self, self->actionClassName];
}
- (BOOL)isDebuggingEnabled {
[self logWithFormat:@"attempt to set value for invalid slot '%@'", _key];
return;
}
- [self->slots setObject:(_value ? _value : [NSNull null]) forKey:_key];
+ [self->slots setObject:(_value != nil ? _value : (id)[NSNull null])
+ forKey:_key];
}
- (id)valueForSlot:(NSString *)_key {
id value;
return value;
}
- (NSArray *)slotNames {
- return self->slots ? [self->slots allKeys] : [NSArray array];
+ return self->slots != nil
+ ? [self->slots allKeys] : (NSArray *)[NSArray array];
}
/* security */
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self,
+ [ms appendFormat:@"<0x%p[%@]:", self,
NSStringFromClass((Class)*(void**)self)];
if (self->soSuperClass)
- [ms appendFormat:@" super=0x%08X", self->soSuperClass];
+ [ms appendFormat:@" super=0x%p", self->soSuperClass];
else
[ms appendString:@" root"];
}
}
- (void)declareObjectProtected:(NSString *)_perm {
- _perm = [_perm isNotNull] ? [_perm lowercaseString] : nil;
+ _perm = [_perm isNotNull] ? [_perm lowercaseString] : (NSString *)nil;
if ([_perm length] == 0) {
[self logWithFormat:@"tried to declare empty permission !", _perm];
- (void)declareRole:(NSString *)_role asDefaultForPermission:(NSString *)_per{
id tmp;
- _per = [_per isNotNull] ? [_per lowercaseString] : nil;
+ _per = [_per isNotNull] ? [_per lowercaseString] : (NSString *)nil;
if (self->defRoles == nil)
self->defRoles = [[NSMutableDictionary alloc] initWithCapacity:8];
- (void)declareRoles:(NSArray *)_roles asDefaultForPermission:(NSString *)_p {
id tmp;
- _p = [_p isNotNull] ? [_p lowercaseString] : nil;
+ _p = [_p isNotNull] ? [_p lowercaseString] : (NSString *)nil;
if (self->defRoles == nil)
self->defRoles = [[NSMutableDictionary alloc] initWithCapacity:8];
return;
}
- tmp = [_roles isNotNull] ? _roles : [NSArray array];
+ tmp = [_roles isNotNull] ? _roles : (NSArray *)[NSArray array];
[self->defRoles setObject:tmp forKey:_p];
}
- (NSString *)loggingPrefix {
return [self->className length] > 0
? [NSString stringWithFormat:@"[so-secinfo %@]", self->className]
- : [NSString stringWithFormat:@"[so-secinfo 0x%08X]", self];
+ : [NSString stringWithFormat:@"[so-secinfo 0x%p]", self];
}
- (BOOL)isDebuggingEnabled {
static int debugOn = -1;
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self,
+ [ms appendFormat:@"<0x%p[%@]:", self,
NSStringFromClass((Class)*(void**)self)];
if (self->soSuperClass)
- [ms appendFormat:@" super=0x%08X", self->soSuperClass];
+ [ms appendFormat:@" super=0x%p", self->soSuperClass];
else
[ms appendString:@" root"];
/*
- Copyright (C) 2002-2005 SKYRIX Software AG
+ Copyright (C) 2002-2006 SKYRIX Software AG
+ Copyright (C) 2006 Helge Hess
This file is part of SOPE.
#include "SoClass.h"
#include "SoSecurityManager.h"
#include "WOContext+SoObjects.h"
-// #import <EOControl/EOClassDescription.h>
+#import <EOControl/EOClassDescription.h> // for -shallowCopy
#include <NGObjWeb/WOApplication.h>
#include <NGObjWeb/WORequest.h>
#include "common.h"
NSString *oname;
oname = [object nameInContainer];
- [ma addObject:(oname ? oname : (id)[NSNull null])];
+ [ma addObject:(oname != nil ? oname : (NSString *)[NSNull null])];
}
return ma;
}
inContext:_ctx];
if (debugOn) {
if ([resultObject isKindOfClass:[WOResponse class]]) {
- [self debugWithFormat:@"call produced response: 0x%08X (code=%i)",
+ [self debugWithFormat:@"call produced response: 0x%p (code=%i)",
resultObject, [(WOResponse *)resultObject status]];
}
else
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self,
+ [ms appendFormat:@"<0x%p[%@]:", self,
NSStringFromClass((Class)*(void**)self)];
if (self->object)
renderer = nil;
e = [[_ctx objectTraversalStack] reverseObjectEnumerator];
- while ((container = [e nextObject])) {
+ while ((container = [e nextObject]) != nil) {
if (![container respondsToSelector:
@selector(rendererForObject:inContext:)]) {
/* does not provide a renderer factory ... */
BOOL doDispatch;
if (debugLogger) {
- [self debugWithFormat:@"request 0x%08X: %@ %@ (ctx=0x%08X)", _rq,
+ [self debugWithFormat:@"request 0x%p: %@ %@ (ctx=0x%p)", _rq,
[_rq method], [_rq uri], _ctx];
- if (_sn) [self debugWithFormat:@"session 0x%08X: %@", _sn, _sn];
+ if (_sn) [self debugWithFormat:@"session 0x%p: %@", _sn, _sn];
}
/* first check safety marker */
else if ([object isKindOfClass:[WOResponse class]]) {
r = object;
[self debugWithFormat:
- @"got response: 0x%08X (status=%i,len=%@,type=%@)",
+ @"got response: 0x%p (status=%i,len=%@,type=%@)",
r, [r status],
[r headerForKey:@"content-length"],
[r headerForKey:@"content-type"]];
else {
if (debugLogger) {
if ([object isKindOfClass:[NSData class]]) {
- [self debugWithFormat:@"render data 0x%08X[len=%i]",
+ [self debugWithFormat:@"render data 0x%p[len=%i]",
object, [object length]];
}
else
if (debugLogger) {
[self debugWithFormat:
- @"made response: 0x%08X (status=%i,len=%@,type=%@)",
+ @"made response: 0x%p (status=%i,len=%@,type=%@)",
r, [r status],
[r headerForKey:@"content-length"],
[r headerForKey:@"content-type"]];
/* Logging */
- (NSString *)loggingPrefix {
- return [NSString stringWithFormat:@"[so-page 0x%08X %@]",
+ return [NSString stringWithFormat:@"[so-page 0x%p %@]",
self, [self pageName]];
}
- (BOOL)isDebuggingEnabled {
unsigned cnt;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if (self->flags.isLoaded)
[ms appendFormat:@" loaded"];
[ms appendFormat:@" #pubrsrc=%d", cnt];
if (self->resourceManager)
- [ms appendFormat:@" rm=0x%08X", self->resourceManager];
+ [ms appendFormat:@" rm=0x%p", self->resourceManager];
[ms appendString:@">"];
return ms;
unsigned cnt;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
[ms appendFormat:@" name=%@", self->className];
/* register */
- [self debugWithFormat:@"register product bundle: '%@' (0x%08X[%@])",
+ [self debugWithFormat:@"register product bundle: '%@' (0x%p[%@])",
bundlePath, _bundle, NSStringFromClass([_bundle class])];
[self debugWithFormat:@" register as product: %@", productName];
WOResourceManager *rm;
rm = [[WOApplication application] resourceManager];
- return (rm == self) ? nil : rm; /* avoid recursion */
+ return (rm == self) ? (WOResourceManager *)nil : rm; /* avoid recursion */
}
/* lookup resources */
_frameworkName, bundle, bproduct];
}
return (bproduct == self->product)
- ? self : (id)[bproduct resourceManager];
+ ? self : (SoProductResourceManager *)[bproduct resourceManager];
}
- (NSString *)primaryLookupPathForResourceNamed:(NSString *)_name
NSMutableString *str;
str = [NSMutableString stringWithCapacity:64];
- [str appendFormat:@"<%@[0x%08X]:", NSStringFromClass([self class]), self];
+ [str appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self];
[str appendFormat:@" product='%@'", [self->product productName]];
[str appendString:@">"];
return str;
NSString *r;
r = [NSString stringWithFormat:@"tried to access private object "
- @"(0x%08X, SoClass=%@)",
+ @"(0x%p, SoClass=%@)",
_object, [[_object soClass] className]];
return [self makeExceptionForObject:_object reason:r];
}
NSString *r;
r = [NSString stringWithFormat:@"missing permission '%@' on object "
- @"(0x%08X, SoClass=%@)",
+ @"(0x%p, SoClass=%@)",
_perm, _object, [[_object soClass] className]];
return [self makeExceptionForObject:_object reason:r];
}
NSException *e;
if ((e = [self validateObject:_value inContext:_ctx])) {
- [self debugWithFormat:@"value (0x%08X,%@) of key %@ didn't validate",
+ [self debugWithFormat:@"value (0x%p,%@) of key %@ didn't validate",
_value, NSStringFromClass([_value class]), _key];
return e;
}
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if (self->sel) {
[ms appendFormat:@" sel=%@", NSStringFromSelector(self->sel)];
[ms appendFormat:@"(%i args)", self->argCount];
}
if (self->object) {
- [ms appendFormat:@" bound(0x%08X,%@)",
+ [ms appendFormat:@" bound(0x%p,%@)",
self->object, NSStringFromClass([self->object class])];
}
- (NSString *)description {
return [NSString stringWithFormat:
- @"<0x%08X[%@]: parent=0x%08X>",
+ @"<0x%p[%@]: parent=0x%p>",
(unsigned)self, NSStringFromClass([self class]),
[self parentContext]];
}
SoSecurityManager *sm;
NSException *e;
- [self debugWithFormat:@"template renderer render: %@ in ctx 0x%08X",
+ [self debugWithFormat:@"template renderer render: %@ in ctx 0x%p",
_object, _ctx];
sm = [_ctx soSecurityManager];
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:16];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
[ms appendFormat:@" login=%@", self->login];
[ms appendFormat:@" roles=%@", [self->roles componentsJoinedByString:@","]];
[ms appendString:@">"];
- (void)addObjectToTraversalStack:(id)_object {
if (self->traversalStack == nil)
self->traversalStack = [[NSMutableArray alloc] initWithCapacity:16];
- [self->traversalStack addObject:_object ? _object : [NSNull null]];
+ [self->traversalStack addObject:
+ (_object != nil ? _object : (id)[NSNull null])];
}
- (id)traversalRoot {
return YES;
}
- (id)callOnObject:(id)_object inContext:(id)_ctx {
- return [_object ? _object : self->parent performActionNamed:self->daName];
+ return [(_object != nil)
+ ? _object
+ : (id)self->parent performActionNamed:self->daName];
}
/* description */
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
[ms appendFormat:@" action=%@", self->daName];
[ms appendFormat:@" class=%@", NSStringFromClass([self->parent class])];
[ms appendString:@">"];
WODirectAction *actionObject;
WOContext *ctx;
- ctx = _ctx ? _ctx : [[WOApplication application] context];
+ ctx = _ctx != nil ? _ctx : (id)[[WOApplication application] context];
if ((actionObject = [[clazz alloc] initWithContext:ctx]) == nil) {
/* failed to create object */
return lookupInAction
? [actionObject lookupName:_name inContext:ctx acquire:_ac]
- : actionObject;
+ : (id)actionObject;
}
return [super lookupName:_name inContext:_ctx acquire:_ac];
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:32];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if ([self->language length] > 0)
[ms appendFormat:@" language=%@", self->language];
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:32];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if (self->url) {
if ([self->url isFileURL])
[ll release];
}
else {
- NSLog(@"%s: startPos=0x%08X endPos=0x%08X", __PRETTY_FUNCTION__,
+ NSLog(@"%s: startPos=0x%p endPos=0x%p", __PRETTY_FUNCTION__,
startPos, endPos);
}
}
}
#if HEAVY_DEBUG
else {
- //NSLog(@"startPos=0x%08X endPos=0x%08X", startPos, endPos);
+ //NSLog(@"startPos=0x%p endPos=0x%p", startPos, endPos);
}
#endif
}
- (NSString *)description {
NSMutableString *ms = [NSMutableString stringWithCapacity:128];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if (self->url) {
if ([self->url isFileURL])
Class clazz;
r = [key rangeOfString:@":"];
- uri = [self namespaceURIForPrefix:
- (r.length > 0) ? [key substringToIndex:r.location] : nil];
+ uri = (r.length > 0)
+ ? [key substringToIndex:r.location] : (NSString *)nil;
+ uri = [self namespaceURIForPrefix:uri];
name = (r.length > 0)
? [key substringFromIndex:(r.location + r.length)]
: key;
# version file
-SUBMINOR_VERSION:=238
+SUBMINOR_VERSION:=239
# v4.5.234 requires libDOM v4.5.21
# v4.5.214 requires libNGExtensions v4.5.179
- (NSString *)description {
NSMutableString *s;
- s = [NSMutableString stringWithFormat:@"<%@[0x%08X]:",
+ s = [NSMutableString stringWithFormat:@"<%@[0x%p]:",
NSStringFromClass([self class]), self];
//[s appendFormat:@" ua='%@'", self->userAgent];
* to explicitly set it. However all accompanied methods should be
* extended to pass the correct context where needed.
*/
- page = [rm pageWithName:(_name != nil ? _name : @"Main")
+ page = [rm pageWithName:(_name != nil ? _name : (NSString *)@"Main")
languages:languages];
[page _setContext:_ctx];
[page ensureAwakeInContext:_ctx];
if ((rm = [self resourceManager]) == nil)
return nil;
- return [rm pageWithName:(_name != nil) ? _name : @"Main"
+ return [rm pageWithName:(_name != nil) ? _name : (NSString *)@"Main"
languages:[_req browserLanguages]];
}
str = [NSString stringWithFormat:pageFormat,
[_ctx hasSession]
? [[_ctx session] sessionID]
- : @"[no session]",
+ : (NSString *)@"[no session]",
[_ctx elementID],
[_ctx description],
[rq description],
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: name=%@%@>",
+ return [NSString stringWithFormat:@"<%@[0x%p]: name=%@%@>",
NSStringFromClass([self class]), self,
[self name],
[self isTerminating] ? @" terminating" : @""
if (self->componentFlags.isAwake) {
[self warnWithFormat:
- @"session will dealloc, but component 0x%08X is awake (ctx=%@) !",
+ @"session will dealloc, but component 0x%p is awake (ctx=%@) !",
self, self->context];
[self _sleepWithContext:self->context];
}
#endif
if (debugComponentAwake)
- [self debugWithFormat:@"0x%08X ensureAwakeInContext:0x%08X", self, _ctx];
+ [self debugWithFormat:@"0x%p ensureAwakeInContext:0x%p", self, _ctx];
/* sanity check */
if (self->componentFlags.isAwake) {
if (self->context == _ctx) {
if (debugComponentAwake)
- [self debugWithFormat:@"0x%08X already awake:0x%08X", self, _ctx];
+ [self debugWithFormat:@"0x%p already awake:0x%p", self, _ctx];
return;
}
}
}
- (void)_sleepWithContext:(WOContext *)_ctx {
if (debugComponentAwake)
- [self debugWithFormat:@"0x%08X _sleepWithContext:0x%08X", self, _ctx];
+ [self debugWithFormat:@"0x%p _sleepWithContext:0x%p", self, _ctx];
if (_ctx != self->context) {
if ((self->context != nil) && (_ctx != nil)) {
/* component is active in different context ... */
[self warnWithFormat:
- @"sleep context mismatch (own=0x%08X vs given=0x%08X)",
+ @"sleep context mismatch (own=0x%p vs given=0x%p)",
self->context, _ctx];
return;
}
return self->context;
[self debugWithFormat:
- @"missing context in component 0x%08X (component%s)",
+ @"missing context in component 0x%p (component%s)",
self,
self->componentFlags.isAwake ? " is awake" : " is not awake"];
if (abortOnMissingCtx) {
WOElement *template = nil;
if (debugTakeValues)
- [self debugWithFormat:@"take values from rq 0x%08X", _req];
+ [self debugWithFormat:@"take values from rq 0x%p", _req];
NSAssert1(self->componentFlags.isAwake,
@"component %@ is not awake !", self);
id tmp;
str = [NSMutableString stringWithCapacity:128];
- [str appendFormat:@"<0x%08X[%@]: name=%@", self,
+ [str appendFormat:@"<0x%p[%@]: name=%@", self,
NSStringFromClass([self class]), [self name]];
if (self->parentComponent)
[str appendFormat:@" #subs=%i", [self->subcomponents count]];
if (self->componentFlags.isAwake)
- [str appendFormat:@" awake=0x%08X", self->context];
+ [str appendFormat:@" awake=0x%p", self->context];
else if (self->context == nil)
[str appendString:@" no-ctx"];
it just checks the path extension to select the proper builder.
*/
url = [self->path isKindOfClass:[NSURL class]]
- ? (NSURL *)self->path
+ ? (id)self->path
: [[[NSURL alloc] initFileURLWithPath:self->path] autorelease];
if (debugOn) [self debugWithFormat:@"url: %@", [url absoluteString]];
- (NSString *)description {
NSMutableString *ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if (self->name) [ms appendFormat:@" name=%@", self->name];
if (self->path) [ms appendFormat:@" path=%@", self->path];
sid = [[self session] sessionID];
return [NSString stringWithFormat:
- @"<0x%08X[%@]: %@ app=%@ sn=%@ eid=%@ rqeid=%@>",
+ @"<0x%p[%@]: %@ app=%@ sn=%@ eid=%@ rqeid=%@>",
(unsigned)self, NSStringFromClass([self class]),
[self contextID],
[app name],
- sid ? sid : @"none",
+ sid != nil ? sid : (NSString *)@"none",
[self elementID],
[self senderID]];
}
else [qs appendString:self->qpJoin];
// TODO: code duplication ...
- value = ![value isNotNull] ? nil : [value stringValue];
+ value = ![value isNotNull] ? (NSString *)nil : [value stringValue];
key = [key stringByEscapingURL];
value = [value stringByEscapingURL];
if (isFirst) isFirst = NO;
else [qs appendString:self->qpJoin];
- value = ![value isNotNull] ? nil : [value stringValue];
+ value = ![value isNotNull] ? (NSString *)nil : [value stringValue];
key = [key stringByEscapingURL];
value = [value stringByEscapingURL];
self->cycleContext = [[NSMutableArray alloc] initWithCapacity:8];
/* add to cursor stack */
- [self->cycleContext addObject:(_obj ? _obj : [NSNull null])];
+ [self->cycleContext addObject:(_obj != nil ? _obj : (id)[NSNull null])];
/* set active cursor */
[self setObject:_obj forKey:@"_"];
NSMutableString *str;
str = [NSMutableString stringWithCapacity:128];
- [str appendFormat:@"<%@[0x%08X]: name=%@ value=%@",
+ [str appendFormat:@"<%@[0x%p]: name=%@ value=%@",
NSStringFromClass([self class]), self,
self->name, self->value];
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: %@>",
+ return [NSString stringWithFormat:@"<%@[0x%p]: %@>",
NSStringFromClass([self class]), self,
[self isTerminating] ? @" terminating" : @""
];
// TODO: maybe we need to retain the selection array and just swap the first
idx = [self->objects indexOfObject:_obj];
- idxNumber = (idx != NSNotFound) ? [NSNumber numberWithUnsignedInt:idx] : nil;
+ idxNumber = (idx != NSNotFound)
+ ? [NSNumber numberWithUnsignedInt:idx] : (NSNumber *)nil;
- if (idxNumber != nil)
- [self setSelectionIndexes:[NSArray arrayWithObjects:&idxNumber count:1]];
+ if (idxNumber != nil) {
+ NSArray *a;
+
+ a = [[NSArray alloc] initWithObjects:&idxNumber count:1];
+ [self setSelectionIndexes:a];
+ [a release]; a = nil;
+ }
else
[self setSelectionIndexes:nil];
}
return NO;
idx = [self->objects indexOfObject:_obj];
- idxNumber = (idx != NSNotFound) ? [NSNumber numberWithUnsignedInt:idx] : nil;
+ idxNumber = (idx != NSNotFound)
+ ? [NSNumber numberWithUnsignedInt:idx] : (NSNumber *)nil;
// TODO: should we just exchange the first item and/or call
// -setSelectedObject: ?
EODataSource *ds;
return ([(ds = [self dataSource]) respondsToSelector:_cmd])
- ? [(EODetailDataSource *)ds detailKey] : nil;
+ ? [(EODetailDataSource *)ds detailKey] : (NSString *)nil;
}
- (void)setMasterObject:(id)_object {
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<0x%08X %@: ds=%@>",
+ return [NSString stringWithFormat:@"<0x%p %@: ds=%@>",
self, NSStringFromClass([self class]),
[self dataSource]];
}
}
- (id)init {
- return [self initWithName:[NSString stringWithFormat:@"0x%08X", self]
+ return [self initWithName:[NSString stringWithFormat:@"0x%p", self]
associations:nil
template:nil];
}
NSMutableString *desc = [NSMutableString stringWithCapacity:100];
NSString *assocDesc = [self associationDescription];
- [desc appendFormat:@"<%@[0x%08X]:", NSStringFromClass([self class]), self];
+ [desc appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self];
if (assocDesc) [desc appendString:assocDesc];
[desc appendString:@">"];
}
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]>",
+ return [NSString stringWithFormat:@"<%@[0x%p]>",
NSStringFromClass([self class]), self];
}
keys = [_paras keyEnumerator];
while ((key = [keys nextObject]) != nil) {
value = [[_paras objectForKey:key] stringValueInComponent:sComponent];
- value = value ? [value stringByEscapingURL] : @"";
- key = key ? [key stringByEscapingURL] : @"";
+ value = value != nil ? [value stringByEscapingURL] : (NSString *)@"";
+ key = key != nil ? [key stringByEscapingURL] : (NSString *)@"";
if (isFirst) isFirst = NO;
else [str appendString:@"&"];
for (i = 0, count = [values count]; i < count; i++) {
value = [values objectAtIndex:i];
value = [value stringValue];
- value = value ? [value stringByEscapingURL] : @"";
- key = key ? [key stringByEscapingURL] : @"";
+ value = value ? [value stringByEscapingURL] : (NSString *)@"";
+ key = key ? [key stringByEscapingURL] : (NSString *)@"";
if (isFirst) isFirst = NO;
else [str appendString:@"&"];
}
else {
value = [value stringValue];
- value = value ? [value stringByEscapingURL] : @"";
- key = key ? [key stringByEscapingURL] : @"";
+ value = value ? [value stringByEscapingURL] : (NSString *)@"";
+ key = key ? [key stringByEscapingURL] : (NSString *)@"";
if (isFirst) isFirst = NO;
else [str appendString:@"&"];
}
}
- return [str length] > 0 ? str : nil;
+ return [str isNotEmpty] ? str : (NSMutableString *)nil;
}
@end /* WOElement */
- (id)currentElementID {
return (self->idPos >= self->elementIdCount)
? nil
- : self->elementId[(int)self->idPos].string;
+ : (id)self->elementId[(int)self->idPos].string;
}
- (id)consumeElementID {
(self->idPos)++;
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: path=%@>",
+ return [NSString stringWithFormat:@"<%@[0x%p]: path=%@>",
NSStringFromClass([self class]), self, self->snPath];
}
- (NSString *)loggingPrefix {
/* improve perf ... */
if (self->url) {
- return [NSString stringWithFormat:@"WOHTTP[0x%08X]<%@>",
+ return [NSString stringWithFormat:@"WOHTTP[0x%p]<%@>",
self, [self->url absoluteString]];
}
else
- return [NSString stringWithFormat:@"WOHTTP[0x%08X]", self];
+ return [NSString stringWithFormat:@"WOHTTP[0x%p]", self];
}
/* accessors */
self->log = nil;
self->io = [NGCTextStream alloc]; // keep gcc happy
- self->io = [self->io initWithSource:(id)(self->log ? self->log : bStr)];
+ self->io = [self->io initWithSource:
+ (id)(self->log != nil ? self->log : (id)bStr)];
[bStr release]; bStr = nil;
}
NSMutableString *str;
str = [NSMutableString stringWithCapacity:128];
- [str appendFormat:@"<%@[0x%08X]:", NSStringFromClass([self class]), self];
+ [str appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self];
if (self->url) [str appendFormat:@" url=%@", self->url];
if (self->useProxy) [str appendString:@" proxy"];
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: address=%@>",
+ return [NSString stringWithFormat:@"<%@[0x%p]: address=%@>",
NSStringFromClass([self class]), self,
self->address];
}
#if DEBUG
[self warnWithFormat:
- @"using NSString to add a character %i,0x%08X"
+ @"using NSString to add a character %i,0x%p"
@"(slow, encoding=%i).", _c, _c, self->contentEncoding];
#endif
printf("'\n");
for (i = len - 20; i < len; i++)
- printf("%5i: 0x%08X %4i\n", i, cstr[i], cstr[i]);
+ printf("%5i: 0x%p %4i\n", i, cstr[i], cstr[i]);
fflush(stdout);
}
#endif
tmp++;
component = ((tmp - cstr) == 0)
- ? @""
+ ? (id)@""
: [[NSString alloc] initWithCString:cstr length:(tmp - cstr)];
if (component) {
r = [self->_uri rangeOfString:@"?"];
query = (r.length > 0)
? [self->_uri substringFromIndex:(r.location + r.length)]
- : nil;
+ : (NSString *)nil;
if ((ctype = [self headerForKey:@"content-type"]) != nil) {
isFormContent = [ctype hasPrefix:@"application/x-www-form-urlencoded"];
id paras = [self _getFormParameters];
return [paras respondsToSelector:@selector(objectsForKey:)]
? [paras objectsForKey:_key]
- : nil;
+ : (NSArray *)nil;
}
- (NSDictionary *)formValues {
return debugOn;
}
- (NSString *)loggingPrefix {
- return [NSString stringWithFormat:@"|Rq:%@ 0x%08X|",
+ return [NSString stringWithFormat:@"|Rq:%@ 0x%p|",
[self method], self];
}
NSMutableString *str;
str = [NSMutableString stringWithCapacity:256];
- [str appendFormat:@"<%@[0x%08X]:", NSStringFromClass([self class]), self];
+ [str appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self];
[str appendFormat:@" method=%@", [self method]];
[str appendFormat:@" uri=%@", [self uri]];
[str appendFormat:@" app=%@", self->appName];
}
- (NSString *)loggingPrefix {
char buf[32];
- sprintf(buf, "[wo-rm-0x%08X]", (unsigned)self);
+ sprintf(buf, "[wo-rm-0x%p]", self);
return [NSString stringWithCString:buf];
}
return _cdef;
cacheKey = [NSArray arrayWithObjects:_name, _languages, nil];
- NSMapInsert(self->componentDefinitions, cacheKey, _cdef ? _cdef : null);
+ NSMapInsert(self->componentDefinitions, cacheKey, _cdef ? _cdef : (id)null);
return _cdef;
}
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:32];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if ([self->base length] > 0)
[ms appendFormat:@" path='%@'", self->base];
[ms appendString:@">"];
NSData *data;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self,
+ [ms appendFormat:@"<0x%p[%@]:", self,
NSStringFromClass((Class)*(void**)self)];
[ms appendFormat:@" status=%i", [self status]];
- (NSString *)description
{
return [NSString stringWithFormat:
- @"<%@[0x%08X]: object=%@ actitivity=%s>",
+ @"<%@[0x%p]: object=%@ actitivity=%s>",
NSStringFromClass([self class]), self,
self->fileObject,
activityDesc[self->watchedActivities]
/* logging */
- (NSString *)loggingPrefix {
- return [NSString stringWithFormat:@"script<%@>[0x%08X]", [self name], self];
+ return [NSString stringWithFormat:@"script<%@>[0x%p]", [self name], self];
}
@end /* WOScriptedComponent */
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: active=%i>",
+ return [NSString stringWithFormat:@"<%@[0x%p]: active=%i>",
NSStringFromClass([self class]), self,
[self activeSessionsCount]
];
page = entry->page;
if (logPageCache) {
[self debugWithFormat:@"restored permanent page %@ for ctx %@",
- page ? [page name] : (id)@"<nil>",
- _contextID ? _contextID : (id)@"<nil>"];
+ page != nil ? [page name] : (NSString *)@"<nil>",
+ _contextID != nil ? _contextID : (NSString *)@"<nil>"];
}
break;
}
if ([_contextID isEqualToString:entry->contextID]) {
page = entry->page;
if (logPageCache) {
- [self debugWithFormat:@"restored page %@<0x%08X> for ctx %@",
+ [self debugWithFormat:@"restored page %@<0x%p> for ctx %@",
[page name], page, _contextID];
}
break;
/* description */
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@[0x%08X]: id=%@>",
+ return [NSString stringWithFormat:@"<%@[0x%p]: id=%@>",
NSStringFromClass([self class]), self,
[self sessionID]];
}
NSString *scope;
scope = [[self hints] objectForKey:@"scope"];
- return [scope length] == 0 ? @"flat" : (id)scope;
+ return [scope isNotNull] ? scope : (NSString *)@"flat";
}
- (BOOL)queryWebDAVPropertyNamesOnly {
id v;
- if ((v = [[self hints] objectForKey:@"namesOnly"]))
+
+ if ((v = [[self hints] objectForKey:@"namesOnly"]) != nil)
return [v boolValue];
return NO;
}
lockInfo = nil;
}
}
- return lockInfo ? lockInfo->token : nil;
+ return [lockInfo isNotNull] ? lockInfo->token : (NSString *)nil;
}
@end /* SoDAVLockManager */
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self,
+ [ms appendFormat:@"<0x%p[%@]:", self,
NSStringFromClass((Class)*(void**)self)];
if (self->href)
[ms appendFormat:@" uri=%@", self->href];
if (self->object) {
- [ms appendFormat:@" obj=0x%08X[%@]",
+ [ms appendFormat:@" obj=0x%p[%@]",
self->object, NSStringFromClass([self->object class])];
}
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self,
+ [ms appendFormat:@"<0x%p[%@]:", self,
NSStringFromClass((Class)*(void**)self)];
if (self->href)
[ms appendFormat:@" uri=%@", self->href];
if (self->object) {
- [ms appendFormat:@" obj=0x%08X[%@]",
+ [ms appendFormat:@" obj=0x%p[%@]",
self->object, NSStringFromClass([self->object class])];
}
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self,
+ [ms appendFormat:@"<0x%p[%@]:", self,
NSStringFromClass((Class)*(void**)self)];
if (self->object)
}
if (debugOn) {
- [self debugWithFormat:@" render entry: 0x%08X<%@>%s%s",
+ [self debugWithFormat:@" render entry: 0x%p<%@>%s%s",
entry, NSStringFromClass([entry class]),
isBrief ? " brief" : "",
_namesOnly ? " names-only" : ""];
propMap = [_object davAttributeMapInContext:_ctx];
if (debugOn) {
- [self debugWithFormat:@"render search result 0x%08X<%@>",
+ [self debugWithFormat:@"render search result 0x%p<%@>",
_object, NSStringFromClass([_object class])];
}
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:128];
- [ms appendFormat:@"<0x%08X[%@]: ", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]: ", self, NSStringFromClass([self class])];
if (self->path) [ms appendFormat:@" path='%@'", self->path];
if (self->data) [ms appendFormat:@" strings=#%d", [self->data count]];
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/
-FHS_SO_DIR=$(FHS_LIB_DIR)sope-$(MAJOR_VERSION).$(MINOR_VERSION)/products/
FHS_MAN_DIR=$(FHS_INSTALL_ROOT)/man
+ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64)
+FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/
+else
+FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/
+endif
+FHS_SO_DIR=$(FHS_LIB_DIR)sope-$(MAJOR_VERSION).$(MINOR_VERSION)/products/
+
NONFHS_LIBDIR="$(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR)/"
NONFHS_LIBNAME="$(LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)"
NONFHS_BINDIR="$(GNUSTEP_TOOLS)/$(GNUSTEP_TARGET_LDIR)"