From 51b42f2e0b284d2ce8c99437ae872ba0fef8b5bc Mon Sep 17 00:00:00 2001 From: helge Date: Mon, 2 May 2005 22:30:25 +0000 Subject: [PATCH] removed gcc 4.0 warnings git-svn-id: http://svn.opengroupware.org/SOPE/trunk@781 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-xml/STXSaxDriver/ChangeLog | 4 +++ .../Model/StructuredTextBodyElement.m | 2 +- sope-xml/STXSaxDriver/Version | 2 +- sope-xml/libxmlSAXDriver/ChangeLog | 4 +++ sope-xml/libxmlSAXDriver/GNUmakefile.preamble | 4 ++- sope-xml/libxmlSAXDriver/Version | 2 +- sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m | 8 +++--- .../libxmlSAXDriver/libxmlHTMLSAXDriver.m | 16 ++++++------ sope-xml/libxmlSAXDriver/libxmlSAXDriver.m | 25 ++++++++++--------- sope-xml/libxmlSAXDriver/libxmlSAXLocator.m | 4 +-- 10 files changed, 40 insertions(+), 31 deletions(-) diff --git a/sope-xml/STXSaxDriver/ChangeLog b/sope-xml/STXSaxDriver/ChangeLog index a6794468..cca02cd9 100644 --- a/sope-xml/STXSaxDriver/ChangeLog +++ b/sope-xml/STXSaxDriver/ChangeLog @@ -1,3 +1,7 @@ +2005-05-03 Helge Hess + + * Model/StructuredTextBodyElement.m: fixed a gcc 4.0 warning (v1.0.11) + 2004-11-04 Helge Hess * use Version file for install directory location diff --git a/sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.m b/sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.m index db9ae93c..0b2b48e8 100644 --- a/sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.m +++ b/sope-xml/STXSaxDriver/Model/StructuredTextBodyElement.m @@ -63,7 +63,7 @@ static BOOL debugOn = NO; return _elements; } -- (void)addElement:(NSObject *)anElement { +- (void)addElement:(StructuredTextBodyElement *)anElement { if (anElement == nil) return; diff --git a/sope-xml/STXSaxDriver/Version b/sope-xml/STXSaxDriver/Version index c75b4c32..cf8d2d7a 100644 --- a/sope-xml/STXSaxDriver/Version +++ b/sope-xml/STXSaxDriver/Version @@ -2,4 +2,4 @@ MAJOR_VERSION=1 MINOR_VERSION=0 -SUBMINOR_VERSION:=10 +SUBMINOR_VERSION:=11 diff --git a/sope-xml/libxmlSAXDriver/ChangeLog b/sope-xml/libxmlSAXDriver/ChangeLog index 0922e64f..56d23123 100644 --- a/sope-xml/libxmlSAXDriver/ChangeLog +++ b/sope-xml/libxmlSAXDriver/ChangeLog @@ -1,3 +1,7 @@ +2005-05-03 Helge Hess + + * fixed loads of gcc 4.0 warnings (v4.5.18) + 2004-12-14 Marcus Mueller * libxmlSAXDriver.xcode: minor fixes diff --git a/sope-xml/libxmlSAXDriver/GNUmakefile.preamble b/sope-xml/libxmlSAXDriver/GNUmakefile.preamble index 7b69b3a8..4b5d5e56 100644 --- a/sope-xml/libxmlSAXDriver/GNUmakefile.preamble +++ b/sope-xml/libxmlSAXDriver/GNUmakefile.preamble @@ -1,4 +1,6 @@ -# $Id$ +# compilation settings + +ADDITIONAL_CPPFLAGS += -funsigned-char ADDITIONAL_INCLUDE_DIRS += -I../.. -I.. ADDITIONAL_INCLUDE_DIRS += $(shell xml2-config --cflags) diff --git a/sope-xml/libxmlSAXDriver/Version b/sope-xml/libxmlSAXDriver/Version index c74af885..beecb228 100644 --- a/sope-xml/libxmlSAXDriver/Version +++ b/sope-xml/libxmlSAXDriver/Version @@ -1,3 +1,3 @@ # version -SUBMINOR_VERSION:=17 +SUBMINOR_VERSION:=18 diff --git a/sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m b/sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m index e0d51d99..1656527d 100644 --- a/sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m +++ b/sope-xml/libxmlSAXDriver/libxmlDocSAXDriver.m @@ -46,7 +46,7 @@ static inline NSString *xmlCharsToString(const xmlChar *_s) { static Class NSStringClass = Nil; if (NSStringClass == Nil) NSStringClass = [NSString class]; - return _s ? [[NSStringClass alloc] initWithUTF8String:_s] : nil; + return _s ? [[NSStringClass alloc] initWithUTF8String:(const char*)_s] : nil; } static NSString *SaxDeclHandlerProperty = @@ -411,8 +411,7 @@ static void setLocator(void *udata, xmlSAXLocatorPtr _locator); void *data, *ts; unsigned len; - len = strlen(chars); - + len = strlen((char *)chars); data = ts = calloc(len + 1, sizeof(unichar)); /* GC ?! */ if (_UTF8ToUTF16((void *)&chars, (void *)(chars + len), @@ -453,8 +452,7 @@ static void setLocator(void *udata, xmlSAXLocatorPtr _locator); void *data, *ts; unsigned len; - len = strlen(chars); - + len = strlen((const char *)chars); data = ts = calloc(len + 1, sizeof(unichar)); /* GC ?! */ if (_UTF8ToUTF16((void *)&chars, (void *)(chars + len), diff --git a/sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m b/sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m index 77efd093..a6523d8e 100644 --- a/sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m +++ b/sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m @@ -54,11 +54,11 @@ static Class NSStringClass = Nil; localisations ... why doesn't libxml support error codes ? (or does it ?) */ -static const unsigned char *tagInvalidMsg = "tag %s invalid"; -static const unsigned char *unclosedEntityInvalidMsg = +static const char *tagInvalidMsg = "tag %s invalid"; +static const char *unclosedEntityInvalidMsg = "htmlParseEntityRef: expecting ';'"; #if 0 -static const unsigned char *unexpectedNobrCloseMsg = +static const char *unexpectedNobrCloseMsg = "Unexpected end tag : %s"; #endif @@ -78,13 +78,13 @@ static inline NSString *xmlCharsToString(const xmlChar *_s) { return [s retain]; } - newkey = malloc(strlen(_s) + 1); - strcpy(newkey, _s); + newkey = malloc(strlen((char *)_s) + 2); + strcpy(newkey, (char *)_s); if (NSStringClass == Nil) NSStringClass = [NSString class]; - s = [[NSStringClass alloc] initWithUTF8String:_s]; + s = [[NSStringClass alloc] initWithUTF8String:(const char *)_s]; NSMapInsert(uniqueStrings, newkey, s); return s; } @@ -484,7 +484,7 @@ static void setLocator(void *udata, xmlSAXLocatorPtr _locator); [self->contentHandler characters:&c length:0]; return YES; } - if ((len = strlen(chars)) == 0) { + if ((len = strlen((char *)chars)) == 0) { unichar c = '\0'; [self->contentHandler characters:&c length:0]; return YES; @@ -530,7 +530,7 @@ static void setLocator(void *udata, xmlSAXLocatorPtr _locator); else { unsigned len; - if ((len = strlen(chars)) > 0) { + if ((len = strlen((char *)chars)) > 0) { void *data, *ts; data = ts = calloc(len + 1, sizeof(unichar)); /* GC ?! */ diff --git a/sope-xml/libxmlSAXDriver/libxmlSAXDriver.m b/sope-xml/libxmlSAXDriver/libxmlSAXDriver.m index a42975de..fc0fa915 100644 --- a/sope-xml/libxmlSAXDriver/libxmlSAXDriver.m +++ b/sope-xml/libxmlSAXDriver/libxmlSAXDriver.m @@ -54,7 +54,9 @@ static inline NSString *xmlCharsToString(const xmlChar *_s) { char *newkey; if (_s == NULL) return nil; - + + // TODO: does the uniquer really make sense? + // best would to have an -initWithUTF...nocopy:YES if (uniqueStrings == NULL) { uniqueStrings = NSCreateMapTable(libxmlNonOwnedCStringMapKeyCallBacks, NSObjectMapValueCallBacks, @@ -64,14 +66,14 @@ static inline NSString *xmlCharsToString(const xmlChar *_s) { /* found a string in cache ... */ return [s retain]; } - - newkey = malloc(strlen(_s) + 1); - strcpy(newkey, _s); + + newkey = malloc(strlen((const char *)_s) + 2); + strcpy(newkey, (const char *)_s); if (NSStringClass == Nil) NSStringClass = [NSString class]; - s = [[NSStringClass alloc] initWithUTF8String:_s]; + s = [[NSStringClass alloc] initWithUTF8String:(const char *)_s]; NSMapInsert(uniqueStrings, newkey, s); return s; } @@ -431,7 +433,7 @@ static xmlSAXHandler saxHandler = { if (len > 5) { unsigned char *tmp; - if ((tmp = strstr(src, "ctxt = - xmlCreateMemoryParserCtxt(start, len); + self->ctxt = xmlCreateMemoryParserCtxt((void *)start, len); if (self->ctxt == nil) { SaxParseException *e; @@ -789,9 +790,9 @@ _startElement(libxmlSAXDriver *self, const xmlChar *name, const xmlChar **atts) if (!self->fNamespacePrefixes) { if (atts[i][0] == 'x') { - const char *an = atts[i]; + const unsigned char *an = atts[i]; - if (strstr(an, "xmlns") == an) + if (strstr((char *)an, "xmlns") == (char *)an) continue; } } @@ -987,7 +988,7 @@ static void _comment(libxmlSAXDriver *self, const xmlChar *value) { unichar *data; register int i, len; - len = strlen(value); + len = strlen((const char *)value); data = calloc(len +1 ,sizeof(unichar)); /* GC ?! */ @@ -1056,7 +1057,7 @@ static xmlEntityPtr _getEntity(libxmlSAXDriver *self, const xmlChar *name) { /* fill entity structure */ p = self->entity; - p->name = [ename cString]; + p->name = (unsigned char *)[ename cString]; p->etype = XML_INTERNAL_GENERAL_ENTITY; p->orig = (void *)[ename cString]; p->content = (void *)[s cString]; diff --git a/sope-xml/libxmlSAXDriver/libxmlSAXLocator.m b/sope-xml/libxmlSAXDriver/libxmlSAXLocator.m index 27098a7b..e0b9505f 100644 --- a/sope-xml/libxmlSAXDriver/libxmlSAXLocator.m +++ b/sope-xml/libxmlSAXDriver/libxmlSAXLocator.m @@ -58,14 +58,14 @@ const xmlChar *s; //return nil; s = self->getPublicId ? self->getPublicId(self->ctx) : NULL; - return s ? [NSString stringWithCString:s] : nil; + return s ? [NSString stringWithCString:(const char *)s] : nil; } - (NSString *)systemId { const xmlChar *s; //return nil; s = self->getSystemId ? self->getSystemId(self->ctx) : NULL; - return s ? [NSString stringWithCString:s] : nil; + return s ? [NSString stringWithCString:(const char *)s] : nil; } /* description */ -- 2.39.5