From: helge Date: Mon, 2 May 2005 23:15:00 +0000 (+0000) Subject: fixed gcc 4.0 warnings X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa9f6aa6d458bf48a4bd2adcc0f93f5afe9ea712;p=sope fixed gcc 4.0 warnings git-svn-id: http://svn.opengroupware.org/SOPE/trunk@787 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index 9aac9839..e781a53f 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,5 +1,7 @@ 2005-05-03 Helge Hess + * fixed gcc 4.0 warnings (v4.5.160) + * XmlExt.subproj/DOMNode+EOQualifier.m: reworked for new DOM (v4.5.159) diff --git a/sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m b/sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m index 05bcb166..a62c2077 100644 --- a/sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m +++ b/sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m @@ -45,22 +45,22 @@ - (void)setReason:(NSString *)_reason; @end -static NSString *_parseString (NSZone *_zone, const char *_buffer, +static NSString *_parseString (NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception); -static NSDictionary *_parseDict (NSZone *_zone, const char *_buffer, +static NSDictionary *_parseDict (NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception); -static NSArray *_parseArray (NSZone *_zone, const char *_buffer, +static NSArray *_parseArray (NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception); -static NSData *_parseData (NSZone *_zone, const char *_buffer, +static NSData *_parseData (NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception); -static id _parseProperty(NSZone *_zone, const char *_buffer, +static id _parseProperty(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception); -static NSDictionary *_parseStrings(NSZone *_zone, const char *_buffer, +static NSDictionary *_parseStrings(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception); @@ -85,7 +85,8 @@ NSString *NGParseStringFromBuffer(const unsigned char *_buffer, unsigned _len) } } - result = [_parseString(NoZone, _buffer, &idx, _len, &exception) autorelease]; + result = + [_parseString(NoZone, _buffer, &idx, _len, &exception) autorelease]; [exception raise]; return result; } @@ -155,17 +156,23 @@ NSDictionary *NGParseDictionaryFromData(NSData *_data) NSString *NGParseStringFromString(NSString *_str) { - return NGParseStringFromBuffer([_str cString], [_str cStringLength]); + // TODO: Unicode + return NGParseStringFromBuffer((unsigned char *)[_str cString], + [_str cStringLength]); } NSArray *NGParseArrayFromString(NSString *_str) { - return NGParseArrayFromBuffer([_str cString], [_str cStringLength]); + // TODO: Unicode + return NGParseArrayFromBuffer((unsigned char *)[_str cString], + [_str cStringLength]); } NSDictionary *NGParseDictionaryFromString(NSString *_str) { - return NGParseDictionaryFromBuffer([_str cString], [_str cStringLength]); + // TODO: Unicode + return NGParseDictionaryFromBuffer((unsigned char *)[_str cString], + [_str cStringLength]); } id NGParsePropertyListFromBuffer(const unsigned char *_buffer, unsigned _len) @@ -200,7 +207,8 @@ id NGParsePropertyListFromData(NSData *_data) id NGParsePropertyListFromString(NSString *_string) { - return NGParsePropertyListFromBuffer([_string cString], [_string cStringLength]); + return NGParsePropertyListFromBuffer((unsigned char *)[_string cString], + [_string cStringLength]); } id NGParsePropertyListFromFile(NSString *_path) @@ -264,7 +272,8 @@ id NGParsePropertyListFromFile(NSString *_path) #endif } -NSDictionary *NGParseStringsFromBuffer(const char *_buffer, unsigned _len) +NSDictionary *NGParseStringsFromBuffer(const unsigned char *_buffer, + unsigned _len) { NSDictionary *result = nil; NSException *exception = nil; @@ -282,7 +291,8 @@ NSDictionary *NGParseStringsFromData(NSData *_data) NSDictionary *NGParseStringsFromString(NSString *_string) { - return NGParseStringsFromBuffer([_string cString], [_string cStringLength]); + return NGParseStringsFromBuffer((unsigned char *)[_string cString], + [_string cStringLength]); } NSDictionary *NGParseStringsFromFile(NSString *_path) @@ -394,7 +404,7 @@ static inline BOOL _isHexDigit(char _c) } } -static inline int _numberOfLines(const char *_buffer, unsigned _lastIdx) +static inline int _numberOfLines(const unsigned char *_buffer, unsigned _lastIdx) { register int pos, lineCount = 1; @@ -406,7 +416,7 @@ static inline int _numberOfLines(const char *_buffer, unsigned _lastIdx) } static NSException *_makeException(NSException *_exception, - const char *_buffer, unsigned _idx, + const unsigned char *_buffer, unsigned _idx, unsigned _len, NSString *_text) { NSMutableDictionary *ui = nil; @@ -449,7 +459,7 @@ static NSException *_makeException(NSException *_exception, */ if (!atEof && (_idx > 0)) { register unsigned pos; - const char *startPos, *endPos; + const unsigned char *startPos, *endPos; for (pos = _idx; (pos >= 0) && (_buffer[pos] != '\n'); pos--) ; @@ -462,7 +472,7 @@ static NSException *_makeException(NSException *_exception, if (startPos < endPos) { NSString *s; - s = [[NSString alloc] initWithCString:startPos + s = [[NSString alloc] initWithCString:(char *)startPos length:(endPos - startPos)]; if (s != nil) { [ui setObject:s forKey:@"lastLine"]; @@ -485,7 +495,7 @@ static NSException *_makeException(NSException *_exception, return exception; } -static BOOL _skipComments(const char *_buffer, unsigned *_idx, unsigned _len, +static BOOL _skipComments(const unsigned char *_buffer, unsigned *_idx, unsigned _len, BOOL _skipSpaces, NSException **_exception) { register unsigned pos = *_idx; @@ -555,7 +565,7 @@ static BOOL _skipComments(const char *_buffer, unsigned *_idx, unsigned _len, return (pos < _len); } -static NSString *_parseString(NSZone *_zone, const char *_buffer, unsigned *_idx, +static NSString *_parseString(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception) { @@ -649,7 +659,7 @@ static NSString *_parseString(NSZone *_zone, const char *_buffer, unsigned *_idx NSCAssert(len > 0, @"invalid length .."); return [[NSString allocWithZone:_zone] - initWithCString:&(_buffer[startPos]) length:len]; + initWithCString:(char*)&(_buffer[startPos]) length:len]; } } else { // an unquoted string, may not be zero chars long ! @@ -671,13 +681,14 @@ static NSString *_parseString(NSZone *_zone, const char *_buffer, unsigned *_idx else { *_idx = pos; return [[NSString allocWithZone:_zone] - initWithCString:&(_buffer[startPos]) length:len]; + initWithCString:(char*)&(_buffer[startPos]) length:len]; } } } -static NSData *_parseData(NSZone *_zone, const char *_buffer, - unsigned *_idx, unsigned _len, NSException **_exception) +static NSData *_parseData(NSZone *_zone, const unsigned char *_buffer, + unsigned *_idx, unsigned _len, + NSException **_exception) { if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { // EOF reached during comment-skipping @@ -770,7 +781,7 @@ static NSData *_parseData(NSZone *_zone, const char *_buffer, } } -static NSDictionary *_parseDict(NSZone *_zone, const char *_buffer, unsigned *_idx, +static NSDictionary *_parseDict(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception) { if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { @@ -921,7 +932,7 @@ static NSDictionary *_parseDict(NSZone *_zone, const char *_buffer, unsigned *_i } } -static NSArray *_parseArray(NSZone *_zone, const char *_buffer, unsigned *_idx, +static NSArray *_parseArray(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception) { if (!_skipComments(_buffer, _idx, _len, YES, _exception)) { @@ -1006,7 +1017,7 @@ static NSArray *_parseArray(NSZone *_zone, const char *_buffer, unsigned *_idx, } } -static id _parseProperty(NSZone *_zone, const char *_buffer, unsigned *_idx, +static id _parseProperty(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception) { id result = nil; @@ -1037,7 +1048,7 @@ static id _parseProperty(NSZone *_zone, const char *_buffer, unsigned *_idx, return result; } -static NSDictionary *_parseStrings(NSZone *_zone, const char *_buffer, +static NSDictionary *_parseStrings(NSZone *_zone, const unsigned char *_buffer, unsigned *_idx, unsigned _len, NSException **_exception) { diff --git a/sope-core/NGExtensions/NGExtensions/NGPropertyListParser.h b/sope-core/NGExtensions/NGExtensions/NGPropertyListParser.h index e4d772d9..2ef6614a 100644 --- a/sope-core/NGExtensions/NGExtensions/NGPropertyListParser.h +++ b/sope-core/NGExtensions/NGExtensions/NGPropertyListParser.h @@ -57,7 +57,8 @@ id NGParsePropertyListFromData(NSData *_data); id NGParsePropertyListFromString(NSString *_string); id NGParsePropertyListFromFile(NSString *_path); -NSDictionary *NGParseStringsFromBuffer(const char *_buffer, unsigned _len); +NSDictionary *NGParseStringsFromBuffer(const unsigned char *_buffer, + unsigned _len); NSDictionary *NGParseStringsFromData(NSData *_data); NSDictionary *NGParseStringsFromString(NSString *_string); NSDictionary *NGParseStringsFromFile(NSString *_path); diff --git a/sope-core/NGExtensions/NGObjCRuntime.m b/sope-core/NGExtensions/NGObjCRuntime.m index 5c577f0d..2f1174fa 100644 --- a/sope-core/NGExtensions/NGObjCRuntime.m +++ b/sope-core/NGExtensions/NGObjCRuntime.m @@ -677,7 +677,7 @@ fillMethodListWithSpecs(MethodList_t methods, SEL _selector, va_list *va) } #if !LIB_FOUNDATION_LIBRARY - names[i] = [NSString stringWithCString:ivarName]; + names[i] = [NSString stringWithCString:(char *)ivarName]; #else names[i] = [NSString stringWithCStringNoCopy:(char *)ivarName freeWhenDone:NO]; diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index 67f337cd..0e49e8b7 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,6 +1,6 @@ # version -SUBMINOR_VERSION:=159 +SUBMINOR_VERSION:=160 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39