From: helge Date: Mon, 3 Jul 2006 18:51:41 +0000 (+0000) Subject: use %p for pointer formats X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84df079967b1c1d9f3dec96e9eb46538abb324e8;p=sope use %p for pointer formats fixed gcc 4.1 warnings minor improvs git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1281 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-xml/DOM/ChangeLog b/sope-xml/DOM/ChangeLog index 9012be97..70511cbb 100644 --- a/sope-xml/DOM/ChangeLog +++ b/sope-xml/DOM/ChangeLog @@ -1,3 +1,7 @@ +2006-07-03 Helge Hess + + * fixed gcc 4.1 warnings, use %p for pointer formats (v4.5.22) + 2006-06-04 Helge Hess * DOMElement.m: added missing -localName implementation (v4.5.21) diff --git a/sope-xml/DOM/DOMAttribute.m b/sope-xml/DOM/DOMAttribute.m index bccd18b9..98376fc5 100644 --- a/sope-xml/DOM/DOMAttribute.m +++ b/sope-xml/DOM/DOMAttribute.m @@ -163,7 +163,7 @@ /* description */ - (NSString *)description { - return [NSString stringWithFormat:@"<0x%08X[%@]: {%@}%@%s '%@'>", + return [NSString stringWithFormat:@"<0x%p[%@]: {%@}%@%s '%@'>", self, NSStringFromClass([self class]), self->namespaceURI, [self name], diff --git a/sope-xml/DOM/DOMElement.m b/sope-xml/DOM/DOMElement.m index cbd6eeb4..ed23183e 100644 --- a/sope-xml/DOM/DOMElement.m +++ b/sope-xml/DOM/DOMElement.m @@ -507,7 +507,7 @@ static NSNull *null = nil; - (NSString *)description { return [NSString stringWithFormat: - @"<0x%08X[%@]: name=%@ parent=%@ #attrs=%i #children=%i>", + @"<0x%p[%@]: name=%@ parent=%@ #attrs=%i #children=%i>", self, NSStringFromClass([self class]), [self nodeName], [[self parentNode] nodeName], @@ -785,7 +785,7 @@ static NSString *_XNSLocalName(NSString *_name) { id attr; ms = [NSMutableString stringWithCapacity:1024]; - [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])]; + [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; [ms appendFormat:@" element=%@", self->element]; [ms appendString:@" attributes:\n"]; diff --git a/sope-xml/DOM/DOMNode.m b/sope-xml/DOM/DOMNode.m index d7e6c4e0..621efec3 100644 --- a/sope-xml/DOM/DOMNode.m +++ b/sope-xml/DOM/DOMNode.m @@ -209,7 +209,7 @@ NSString *DOMNodeValue(id _node) { - (NSString *)description { return [NSString stringWithFormat: - @"<0x%08X[%@]: name=%@ parent=%@ type=%i #children=%i>", + @"<0x%p[%@]: name=%@ parent=%@ type=%i #children=%i>", self, NSStringFromClass([self class]), [self nodeName], [[self parentNode] nodeName], diff --git a/sope-xml/DOM/DOMProcessingInstruction.m b/sope-xml/DOM/DOMProcessingInstruction.m index 8efe4a05..18824745 100644 --- a/sope-xml/DOM/DOMProcessingInstruction.m +++ b/sope-xml/DOM/DOMProcessingInstruction.m @@ -96,7 +96,7 @@ /* description */ - (NSString *)description { - return [NSString stringWithFormat:@"<0x%08X[%@]: target=%@ data='%@'>", + return [NSString stringWithFormat:@"<0x%p[%@]: target=%@ data='%@'>", self, NSStringFromClass([self class]), [self target], [self data]]; } diff --git a/sope-xml/DOM/DOMQueryPathExpression.m b/sope-xml/DOM/DOMQueryPathExpression.m index 48e92f80..f6b93a13 100644 --- a/sope-xml/DOM/DOMQueryPathExpression.m +++ b/sope-xml/DOM/DOMQueryPathExpression.m @@ -345,7 +345,7 @@ ps = ((i - s) > 0) ? [_path substringWithRange:NSMakeRange(s, (i - s))] - : @""; + : (NSString *)@""; if ((predicate = [self parsePredicateExpression:ps])) { if (predicates == nil) @@ -573,7 +573,7 @@ NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; - [ms appendFormat:@"<%@[0x%08X]:", NSStringFromClass([self class]), self]; + [ms appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self]; [ms appendFormat:@" element='%@'", self->elementName]; [ms appendString:self->deep ? @" deep" : @" shallow"]; [ms appendFormat:@" nodeType=%i", self->nodeType]; @@ -599,7 +599,7 @@ } - (NSString *)description { - return [NSString stringWithFormat:@"<0x%08X[%@]: keypath='%@'>", + return [NSString stringWithFormat:@"<0x%p[%@]: keypath='%@'>", self, NSStringFromClass([self class]), self->keyPath]; } @@ -630,7 +630,7 @@ } - (NSString *)description { - return [NSString stringWithFormat:@"<0x%08X[%@]: op=%i>", + return [NSString stringWithFormat:@"<0x%p[%@]: op=%i>", self, NSStringFromClass([self class]), self->queryOp]; } @@ -727,7 +727,7 @@ NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; - [ms appendFormat:@"<%@[0x%08X]: ", NSStringFromClass([self class]), self]; + [ms appendFormat:@"<%@[0x%p]: ", NSStringFromClass([self class]), self]; [ms appendString:@"sequence="]; [ms appendString:[self->queryPaths description]]; [ms appendString:@">"]; @@ -772,7 +772,7 @@ self->uri = [_spec substringToIndex:r.location]; self->uri = ([self->uri length] > 1) ? [self->uri copy] - : @"*"; + : (id)@"*"; } else { /* usual 'blah' */ @@ -827,7 +827,7 @@ NSMutableString *ms; ms = [NSMutableString stringWithCapacity:64]; - [ms appendFormat:@"<%@[0x%08X]:", NSStringFromClass([self class]), self]; + [ms appendFormat:@"<%@[0x%p]:", NSStringFromClass([self class]), self]; [ms appendFormat:@" attrSpec='%@'", self->attrSpec]; if (self->uri) [ms appendFormat:@" uri='%@'", self->uri]; diff --git a/sope-xml/DOM/DOMSaxHandler.m b/sope-xml/DOM/DOMSaxHandler.m index 40757cfd..3e952169 100644 --- a/sope-xml/DOM/DOMSaxHandler.m +++ b/sope-xml/DOM/DOMSaxHandler.m @@ -200,7 +200,7 @@ static BOOL printErrors = NO; r = [_rawName rangeOfString:@":"]; nsPrefix = (r.length > 0) ? [_rawName substringToIndex:r.location] - : nil; + : (NSString *)nil; } else nsPrefix = nil; diff --git a/sope-xml/DOM/DOMXMLOutputter.m b/sope-xml/DOM/DOMXMLOutputter.m index bc369b85..2715849f 100644 --- a/sope-xml/DOM/DOMXMLOutputter.m +++ b/sope-xml/DOM/DOMXMLOutputter.m @@ -359,8 +359,8 @@ - (void)pushPrefix:(NSString *)_prefix namespace:(NSString *)_namespace { [self _checkPrefixStack]; - [self->stack addObject:(_prefix) ? _prefix : @""]; - [self->stack addObject:(_namespace) ? _namespace : @""]; + [self->stack addObject:(_prefix) ? _prefix : (NSString *)@""]; + [self->stack addObject:(_namespace) ? _namespace : (NSString *)@""]; } - (void)popPrefixAndNamespace { @@ -410,8 +410,8 @@ attr = [_attrs objectAtIndex:j]; attrNamespace = [attr namespaceURI]; attrPrefix = [attr prefix]; - attrNamespace = (attrNamespace) ? attrNamespace : @""; - attrPrefix = (attrPrefix) ? attrPrefix : @""; + attrNamespace = (attrNamespace) ? attrNamespace : (NSString *)@""; + attrPrefix = (attrPrefix) ? attrPrefix : (NSString *)@""; if (([attrNamespace length] == 0 && [attrPrefix length] == 0)) continue; diff --git a/sope-xml/DOM/NSObject+QPEval.m b/sope-xml/DOM/NSObject+QPEval.m index 1be5e8c4..40566788 100644 --- a/sope-xml/DOM/NSObject+QPEval.m +++ b/sope-xml/DOM/NSObject+QPEval.m @@ -122,7 +122,7 @@ else { } - NSLog(@"0x%08X<%@> eval QP '%@': %@", self, NSStringFromClass([self class]), + NSLog(@"0x%p<%@> eval QP '%@': %@", self, NSStringFromClass([self class]), _pc, result); return result; diff --git a/sope-xml/DOM/Version b/sope-xml/DOM/Version index e6164a36..6cc7ab75 100644 --- a/sope-xml/DOM/Version +++ b/sope-xml/DOM/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=21 +SUBMINOR_VERSION:=22 diff --git a/sope-xml/STXSaxDriver/ChangeLog b/sope-xml/STXSaxDriver/ChangeLog index 24bd2f97..34ebc679 100644 --- a/sope-xml/STXSaxDriver/ChangeLog +++ b/sope-xml/STXSaxDriver/ChangeLog @@ -1,3 +1,7 @@ +2006-07-03 Helge Hess + + * fixed gcc 4.1 warnings, use %p for pointers formats (v4.5.14) + 2005-08-27 Helge Hess * added common.h in project subdirs for PCH support (v4.5.13) diff --git a/sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m b/sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m index 25323e27..25742a57 100644 --- a/sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m +++ b/sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m @@ -511,7 +511,7 @@ NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; - [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])]; + [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (self->_text) [ms appendFormat:@" text-len=%d", [self->_text length]]; if (self->_document) diff --git a/sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.m b/sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.m index 0b2b48e8..76e55c6c 100644 --- a/sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.m +++ b/sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.m @@ -80,7 +80,7 @@ static BOOL debugOn = NO; int i, length, start; if (debugOn) - NSLog(@"PARSE TEXT: '%@' (delegate=0x%08X)", _str, self->_delegate); + NSLog(@"PARSE TEXT: '%@' (delegate=0x%p)", _str, self->_delegate); _str = [self preprocessText:_str inContext:_ctx]; if (debugOn) NSLog(@" preprocessed: '%@'", _str); @@ -956,13 +956,13 @@ static BOOL debugOn = NO; NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; - [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])]; + [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (self->_elements) [ms appendFormat:@" #elements=%d", [self->_elements count]]; if (self->_delegate) { - [ms appendFormat:@" delegate=0x%08X<%@>", + [ms appendFormat:@" delegate=0x%p<%@>", self->_delegate, NSStringFromClass([(id)self->_delegate class])]; } diff --git a/sope-xml/STXSaxDriver/Model/StructuredTextHeader.m b/sope-xml/STXSaxDriver/Model/StructuredTextHeader.m index b6fd54ec..5ff49293 100644 --- a/sope-xml/STXSaxDriver/Model/StructuredTextHeader.m +++ b/sope-xml/STXSaxDriver/Model/StructuredTextHeader.m @@ -62,7 +62,7 @@ NSMutableString *ms; ms = [NSMutableString stringWithCapacity:128]; - [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])]; + [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; /* header specific */ @@ -75,7 +75,7 @@ [ms appendFormat:@" #elements=%d", [self->_elements count]]; if (self->_delegate) { - [ms appendFormat:@" delegate=0x%08X<%@>", + [ms appendFormat:@" delegate=0x%p<%@>", self->_delegate, NSStringFromClass([(id)self->_delegate class])]; } diff --git a/sope-xml/STXSaxDriver/STXSaxDriver.m b/sope-xml/STXSaxDriver/STXSaxDriver.m index dd7a18da..bfb2379e 100644 --- a/sope-xml/STXSaxDriver/STXSaxDriver.m +++ b/sope-xml/STXSaxDriver/STXSaxDriver.m @@ -452,15 +452,17 @@ static BOOL debugOn = NO; SaxParseException *e; NSDictionary *ui; - ui = [NSDictionary dictionaryWithObjectsAndKeys: - _url ? _url : (id)@"", @"url", - _sysId ? _sysId : (id)@"", @"publicId", - self, @"parser", + ui = [[NSDictionary alloc] initWithObjectsAndKeys: + _url ? _url : (NSURL *)@"", @"url", + _sysId ? _sysId : (NSString *)@"", @"publicId", + self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"could not retrieve URL content" userInfo:ui]; + [ui release]; ui = nil; + [self->errorHandler fatalError:e]; return; } @@ -474,14 +476,16 @@ static BOOL debugOn = NO; SaxParseException *e; NSDictionary *ui; - ui = [NSDictionary dictionaryWithObjectsAndKeys: - _sysId ? _sysId : (id)@"", @"publicId", - self, @"parser", + ui = [[NSDictionary alloc] initWithObjectsAndKeys: + _sysId ? _sysId : (NSString *)@"", @"publicId", + self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"missing source for parsing!" userInfo:ui]; + [ui release]; ui = nil; + [self->errorHandler fatalError:e]; return; } @@ -505,15 +509,16 @@ static BOOL debugOn = NO; SaxParseException *e; NSDictionary *ui; - ui = [NSDictionary dictionaryWithObjectsAndKeys: - _source ? _source : @"", @"source", - _sysId ? _sysId : @"", @"publicId", + ui = [[NSDictionary alloc] initWithObjectsAndKeys: + _source ? _source : (id)@"", @"source", + _sysId ? _sysId : (NSString *)@"", @"publicId", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"can not handle data-source" userInfo:ui]; + [ui release]; ui = nil; [self->errorHandler fatalError:e]; return; diff --git a/sope-xml/STXSaxDriver/Version b/sope-xml/STXSaxDriver/Version index bb0b16a8..35b388e6 100644 --- a/sope-xml/STXSaxDriver/Version +++ b/sope-xml/STXSaxDriver/Version @@ -2,4 +2,4 @@ MAJOR_VERSION=4 MINOR_VERSION=5 -SUBMINOR_VERSION:=13 +SUBMINOR_VERSION:=14 diff --git a/sope-xml/SaxObjC/ChangeLog b/sope-xml/SaxObjC/ChangeLog index 7b4843a4..7a8a5d4c 100644 --- a/sope-xml/SaxObjC/ChangeLog +++ b/sope-xml/SaxObjC/ChangeLog @@ -1,3 +1,11 @@ +2006-07-03 Helge Hess + + * v4.5.58 + + * SaxAttributes.m: fixed gcc 4.1 warnings + + * use %p for pointer formats + 2006-07-02 Helge Hess * XMLNamespaces.h: added ATOM namespace, gCal namespace, OpenSearch diff --git a/sope-xml/SaxObjC/SaxAttributes.m b/sope-xml/SaxObjC/SaxAttributes.m index 380fa5b6..261b42a3 100644 --- a/sope-xml/SaxObjC/SaxAttributes.m +++ b/sope-xml/SaxObjC/SaxAttributes.m @@ -94,9 +94,9 @@ value:(NSString *)_value { [self->names addObject:_localName ? _localName : _rawName]; - [self->uris addObject:_uri ? _uri : @""]; - [self->rawNames addObject:_rawName ? _rawName : @""]; - [self->types addObject:_type ? _type : @"CDATA"]; + [self->uris addObject:_uri ? _uri : (NSString *)@""]; + [self->rawNames addObject:_rawName ? _rawName : (NSString *)@""]; + [self->types addObject:_type ? _type : (NSString *)@"CDATA"]; [self->values addObject:_value]; } diff --git a/sope-xml/SaxObjC/Version b/sope-xml/SaxObjC/Version index 4096e97f..31494853 100644 --- a/sope-xml/SaxObjC/Version +++ b/sope-xml/SaxObjC/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=57 +SUBMINOR_VERSION:=58 diff --git a/sope-xml/XmlRpc/ChangeLog b/sope-xml/XmlRpc/ChangeLog index 7e3c01b2..3ba1f8a2 100644 --- a/sope-xml/XmlRpc/ChangeLog +++ b/sope-xml/XmlRpc/ChangeLog @@ -1,3 +1,7 @@ +2006-07-03 Helge Hess + + * fixed gcc 4.1 warnings, use %p for pointer formats (v4.5.28) + 2006-02-26 Marcus Mueller * XmlRpcValue.m: fixed stupid bugs in -isException and -isDictionary, diff --git a/sope-xml/XmlRpc/Version b/sope-xml/XmlRpc/Version index e2240cc2..59de9cb5 100644 --- a/sope-xml/XmlRpc/Version +++ b/sope-xml/XmlRpc/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=27 +SUBMINOR_VERSION:=28 diff --git a/sope-xml/XmlRpc/XmlRpcDecoder.m b/sope-xml/XmlRpc/XmlRpcDecoder.m index e2cc643a..4965f4f4 100644 --- a/sope-xml/XmlRpc/XmlRpcDecoder.m +++ b/sope-xml/XmlRpc/XmlRpcDecoder.m @@ -112,7 +112,7 @@ static BOOL doDebug = NO; xmlDecl = [_string substringFromIndex:(r.location + 10)]; r = [xmlDecl rangeOfString:@"'"]; xmlDecl = r.length == 0 - ? nil + ? (NSString *)nil : [xmlDecl substringToIndex:r.location]; } else { @@ -121,7 +121,7 @@ static BOOL doDebug = NO; xmlDecl = [_string substringFromIndex:(r.location + 10)]; r = [xmlDecl rangeOfString:@"\""]; xmlDecl = r.length == 0 - ? nil + ? (NSString *)nil : [xmlDecl substringToIndex:r.location]; } else @@ -350,7 +350,7 @@ static BOOL doDebug = NO; return ([result isKindOfClass:[XmlRpcMethodCall class]]) ? result - : nil; + : (XmlRpcMethodCall *)nil; } - (XmlRpcMethodResponse *)decodeMethodResponse { @@ -371,7 +371,7 @@ static BOOL doDebug = NO; return [result isKindOfClass:[XmlRpcMethodResponse class]] ? result - : nil; + : (XmlRpcMethodResponse *)nil; } - (id)_decodeObject:(XmlRpcValue *)_value { diff --git a/sope-xml/XmlRpc/XmlRpcMethodCall.m b/sope-xml/XmlRpc/XmlRpcMethodCall.m index 241e1773..5ffe77f1 100644 --- a/sope-xml/XmlRpc/XmlRpcMethodCall.m +++ b/sope-xml/XmlRpc/XmlRpcMethodCall.m @@ -133,7 +133,7 @@ - (NSString *)description { NSMutableString *s; - s = [NSMutableString stringWithFormat:@"<0x%08X[%@]: ", + s = [NSMutableString stringWithFormat:@"<0x%p[%@]: ", self, NSStringFromClass([self class])]; [s appendFormat:@"method=%@", [self methodName]]; [s appendFormat:@" #paras=%d", [self->parameters count]]; diff --git a/sope-xml/XmlRpc/XmlRpcMethodResponse.m b/sope-xml/XmlRpc/XmlRpcMethodResponse.m index 22b29cdf..7e0bde6f 100644 --- a/sope-xml/XmlRpc/XmlRpcMethodResponse.m +++ b/sope-xml/XmlRpc/XmlRpcMethodResponse.m @@ -106,7 +106,7 @@ NSMutableString *ms; ms = [NSMutableString stringWithCapacity:64]; - [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])]; + [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (result) [ms appendFormat:@" %@", self->result]; diff --git a/sope-xml/XmlRpc/XmlRpcSaxHandler.m b/sope-xml/XmlRpc/XmlRpcSaxHandler.m index 9bb863fd..c67712fa 100644 --- a/sope-xml/XmlRpc/XmlRpcSaxHandler.m +++ b/sope-xml/XmlRpc/XmlRpcSaxHandler.m @@ -246,8 +246,8 @@ static BOOL doDebug = NO; [self->dateTime release]; self->dateTime = nil; tz = ((idx = [_attrs indexOfRawName:@"timeZone"]) != NSNotFound) - ? [_attrs valueAtIndex:idx] - : nil; + ? (id)[_attrs valueAtIndex:idx] + : nil; if (tz) { self->timeZone = [[NSTimeZone timeZoneWithAbbreviation:tz] retain]; @@ -534,8 +534,8 @@ static BOOL doDebug = NO; [self->tagStack addObject:_rawName]; tmp = ((idx = [_attrs indexOfRawName:@"NSObjectClass"]) != NSNotFound) - ? [_attrs valueAtIndex:idx] - : nil; + ? (id)[_attrs valueAtIndex:idx] + : nil; [self->className autorelease]; self->className = [tmp retain]; diff --git a/sope-xml/libxmlSAXDriver/ChangeLog b/sope-xml/libxmlSAXDriver/ChangeLog index 8642e41b..387c2f3d 100644 --- a/sope-xml/libxmlSAXDriver/ChangeLog +++ b/sope-xml/libxmlSAXDriver/ChangeLog @@ -1,3 +1,11 @@ +2006-07-03 Helge Hess + + * v4.5.24 + + * use %p for pointer formats, fixed gcc 4.1 warnings + + * improved retain-count for exception userInfo dicts + 2005-11-17 Helge Hess * properly include string.h to avoid warnings (v4.5.23) diff --git a/sope-xml/libxmlSAXDriver/Version b/sope-xml/libxmlSAXDriver/Version index 02c5970d..d20c0852 100644 --- a/sope-xml/libxmlSAXDriver/Version +++ b/sope-xml/libxmlSAXDriver/Version @@ -1,3 +1,3 @@ # version -SUBMINOR_VERSION:=23 +SUBMINOR_VERSION:=24 diff --git a/sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m b/sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m index d5ec3f97..06b1c795 100644 --- a/sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m +++ b/sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m @@ -237,7 +237,7 @@ static void setLocator(void *udata, xmlSAXLocatorPtr _locator); NSData *data; data = [_source isFileURL] - ? [NSData dataWithContentsOfMappedFile:[_source path]] + ? (NSData *)[NSData dataWithContentsOfMappedFile:[_source path]] : [_source resourceDataUsingCache:YES]; [self _parseFromData:data systemId:[_source absoluteString]]; @@ -248,14 +248,15 @@ static void setLocator(void *udata, xmlSAXLocatorPtr _locator); SaxParseException *e; NSDictionary *ui; - ui = [NSDictionary dictionaryWithObjectsAndKeys: - _source ? _source : @"", @"source", - self, @"parser", - nil]; + ui = [[NSDictionary alloc] initWithObjectsAndKeys: + _source ? _source : (id)@"", @"source", + self, @"parser", + nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"cannot handle data-source" userInfo:ui]; + [ui release]; ui = nil; [self->errorHandler fatalError:e]; } @@ -332,7 +333,7 @@ static void setLocator(void *udata, xmlSAXLocatorPtr _locator); nsuri = (attribute->ns != NULL) ? xmlCharsToString(attribute->ns->href) - : nil; + : (NSString *)nil; [attributes addAttribute:name uri:nsuri @@ -512,7 +513,7 @@ static void setLocator(void *udata, xmlSAXLocatorPtr _locator); tagName = xmlCharsToString(node->name); nsuri = (node->ns != NULL) ? xmlCharsToString(node->ns->href) - : nil; + : (NSString *)nil; attrs = [self processAttributes:node->properties]; diff --git a/sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m b/sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m index 77fc04b0..265987e9 100644 --- a/sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m +++ b/sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m @@ -331,7 +331,7 @@ static void setLocator(void *udata, xmlSAXLocatorPtr _locator); NSData *data; data = [_source isFileURL] - ? [NSData dataWithContentsOfMappedFile:[_source path]] + ? (NSData *)[NSData dataWithContentsOfMappedFile:[_source path]] : [_source resourceDataUsingCache:YES]; [self _parseFromData:data systemId:[_source absoluteString]]; @@ -342,14 +342,15 @@ static void setLocator(void *udata, xmlSAXLocatorPtr _locator); SaxParseException *e; NSDictionary *ui; - ui = [NSDictionary dictionaryWithObjectsAndKeys: - _source ? _source : @"", @"source", - self, @"parser", - nil]; + ui = [[NSDictionary alloc] initWithObjectsAndKeys: + _source ? _source : (id)@"", @"source", + self, @"parser", + nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" - reason:@"can't handle data-source" + reason:@"can not handle data-source" userInfo:ui]; + [ui release]; ui = nil; [self->errorHandler fatalError:e]; } diff --git a/sope-xml/libxmlSAXDriver/libxmlSAXDriver.m b/sope-xml/libxmlSAXDriver/libxmlSAXDriver.m index 5388b6e9..d12055fe 100644 --- a/sope-xml/libxmlSAXDriver/libxmlSAXDriver.m +++ b/sope-xml/libxmlSAXDriver/libxmlSAXDriver.m @@ -87,7 +87,7 @@ static libxmlSAXDriver *activeDriver = nil; // THREAD #define SETUP_ACTDRIVER \ { if (activeDriver != nil) { \ - NSLog(@"ERROR(%s): %@ there is an active driver set (0x%08X), " \ + NSLog(@"ERROR(%s): %@ there is an active driver set (0x%p), " \ @"override!", \ __PRETTY_FUNCTION__, self, activeDriver);\ }\ @@ -96,7 +96,7 @@ static libxmlSAXDriver *activeDriver = nil; // THREAD #define TEARDOWN_ACTDRIVER \ { if (activeDriver == self) activeDriver = nil; \ else if (activeDriver != nil) { \ - NSLog(@"ERROR(%s): %@ activeDriver global var mixed up 0x%08X, " \ + NSLog(@"ERROR(%s): %@ activeDriver global var mixed up 0x%p, " \ @"probably a THREAD issue.", \ __PRETTY_FUNCTION__, self, activeDriver); } } @@ -355,7 +355,7 @@ static xmlSAXHandler saxHandler = { r = [xmlDecl rangeOfString:@"'"]; xmlDecl = (r.length > 0) ? [xmlDecl substringToIndex:r.location] - : nil; + : (NSString *)nil; } else { r = [xmlDecl rangeOfString:@"encoding=\""]; @@ -364,7 +364,7 @@ static xmlSAXHandler saxHandler = { r = [xmlDecl rangeOfString:@"\""]; xmlDecl = r.length > 0 ? [xmlDecl substringToIndex:r.location] - : nil; + : (NSString *)nil; } else xmlDecl = nil; @@ -414,14 +414,15 @@ static xmlSAXHandler saxHandler = { SaxParseException *e; NSDictionary *ui; - ui = [NSDictionary dictionaryWithObjectsAndKeys: - _source ? _source : @"", @"source", - self, @"parser", - nil]; + ui = [[NSDictionary alloc] initWithObjectsAndKeys: + _source ? _source : (id)@"", @"source", + self, @"parser", + nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"cannot handle data-source" userInfo:ui]; + [ui release]; ui = nil; [self->errorHandler fatalError:e]; return; @@ -468,7 +469,7 @@ static xmlSAXHandler saxHandler = { SaxParseException *e; NSDictionary *ui; - NSLog(@"%s: couldn't create memory parser ctx (src=0x%08X, len=%d) !", + NSLog(@"%s: couldn't create memory parser ctx (src=0x%p, len=%d) !", __PRETTY_FUNCTION__, src, len); TEARDOWN_ACTDRIVER; @@ -544,14 +545,15 @@ static int mfclose(void *f) { return; } - ui = [NSDictionary dictionaryWithObjectsAndKeys: - _sysId ? _sysId : @"", @"systemID", + ui = [[NSDictionary alloc] initWithObjectsAndKeys: + _sysId ? _sysId : (NSString *)@"", @"systemID", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"cannot handle system-id" userInfo:ui]; + [ui release]; ui = nil; [self->errorHandler fatalError:e]; return; @@ -579,13 +581,14 @@ static int mfclose(void *f) { #if DEBUG NSLog(@"%s: missing file '%@'", __PRETTY_FUNCTION__, _sysId); #endif - ui = [NSDictionary dictionaryWithObjectsAndKeys: - _sysId ? _sysId : @"", @"path", + ui = [[NSDictionary alloc] initWithObjectsAndKeys: + _sysId ? _sysId : (NSString *)@"", @"path", self, @"parser", nil]; e = (id)[SaxParseException exceptionWithName:@"SaxIOException" reason:@"can't find file" userInfo:ui]; + [ui release]; ui = nil; [self->errorHandler fatalError:e]; [pool release]; @@ -891,7 +894,7 @@ static void _startDocument(libxmlSAXDriver *self) { static NSDictionary *defNS = nil; id keys[2], values[2]; - //NSLog(@"start doc 0x%08X", self); + //NSLog(@"start doc 0x%p", self); if (defNS == nil) { keys[0] = @"xml"; values[0] = @"http://www.w3.org/XML/1998/namespace"; diff --git a/sope-xml/libxmlSAXDriver/libxmlSAXLocator.m b/sope-xml/libxmlSAXDriver/libxmlSAXLocator.m index e0b9505f..9765e9f1 100644 --- a/sope-xml/libxmlSAXDriver/libxmlSAXLocator.m +++ b/sope-xml/libxmlSAXDriver/libxmlSAXLocator.m @@ -71,7 +71,7 @@ /* description */ - (NSString *)description { - return [NSString stringWithFormat:@"<0x%08X[%@]: pub=%@ sys=%@ L%i C%i>", + return [NSString stringWithFormat:@"<0x%p[%@]: pub=%@ sys=%@ L%i C%i>", self, NSStringFromClass([self class]), [self publicId], [self systemId], [self lineNumber], [self columnNumber]]; diff --git a/sope-xml/samples/rssparse.m b/sope-xml/samples/rssparse.m index fb41a930..d7079f27 100644 --- a/sope-xml/samples/rssparse.m +++ b/sope-xml/samples/rssparse.m @@ -78,7 +78,7 @@ - (NSString *)description { NSMutableString *s = [NSMutableString stringWithCapacity:64]; - [s appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])]; + [s appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])]; if (self->title) [s appendFormat:@" title='%@'", self->title]; if (self->link) [s appendFormat:@" link='%@'", self->link]; //[s appendFormat:@" info='%@'", self->info];