From: helge Date: Mon, 21 Nov 2005 13:22:03 +0000 (+0000) Subject: fixed a gcc4 warning X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd5b4496b0da3c106a7609bee1fbce65dfaf7baa;p=sope fixed a gcc4 warning git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1185 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/NGObjWeb/Associations/WOAssociation.m b/sope-appserver/NGObjWeb/Associations/WOAssociation.m index 6620b506..7f375028 100644 --- a/sope-appserver/NGObjWeb/Associations/WOAssociation.m +++ b/sope-appserver/NGObjWeb/Associations/WOAssociation.m @@ -236,30 +236,25 @@ static Class WOKeyPathAssociationClass = Nil; return NO; } -// convenience methods - -// description +/* description */ - (NSString *)description { - return [NSString stringWithFormat:@"", self]; + return [NSString stringWithFormat:@"<0x%08X[%@]>", + self, NSStringFromClass([self class])]; } -@end /* WOAssociation */ - -@implementation WOAssociation(SpecialsValues) - /* special values */ - (void)setUnsignedCharValue:(unsigned char)_v inComponent:(WOComponent *)_c { [self setValue:[NSNumber numberWithUnsignedChar:_v] inComponent:_c]; } -- (void)setCharValue:(char)_value inComponent:(WOComponent *)_component { - [self setValue:[NSNumber numberWithChar:_value] inComponent:_component]; +- (void)setCharValue:(signed char)_val inComponent:(WOComponent *)_component { + [self setValue:[NSNumber numberWithChar:_val] inComponent:_component]; } - (void)setUnsignedIntValue:(unsigned int)_v inComponent:(WOComponent *)_c { [self setValue:[NSNumber numberWithUnsignedInt:_v] inComponent:_c]; } -- (void)setIntValue:(int)_value inComponent:(WOComponent *)_component { +- (void)setIntValue:(signed int)_value inComponent:(WOComponent *)_component { [self setValue:[NSNumber numberWithInt:_value] inComponent:_component]; } - (void)setBoolValue:(BOOL)_value inComponent:(WOComponent *)_component { @@ -269,13 +264,13 @@ static Class WOKeyPathAssociationClass = Nil; - (unsigned char)unsignedCharValueInComponent:(WOComponent *)_component { return [[self valueInComponent:_component] unsignedCharValue]; } -- (char)charValueInComponent:(WOComponent *)_component { - return [[self valueInComponent:_component] charValue]; +- (signed char)charValueInComponent:(WOComponent *)_component { + return [(id)[self valueInComponent:_component] charValue]; } - (unsigned int)unsignedIntValueInComponent:(WOComponent *)_component { return [[self valueInComponent:_component] unsignedIntValue]; } -- (int)intValueInComponent:(WOComponent *)_component { +- (signed int)intValueInComponent:(WOComponent *)_component { return [[self valueInComponent:_component] intValue]; } - (BOOL)boolValueInComponent:(WOComponent *)_component { @@ -294,13 +289,13 @@ static Class WOKeyPathAssociationClass = Nil; - (void)setUnsignedCharValue:(unsigned char)_v inContext:(WOContext *)_c { [self setUnsignedCharValue:_v inComponent:(id)[_c cursor]]; } -- (void)setCharValue:(char)_value inContext:(WOContext *)_ctx { +- (void)setCharValue:(signed char)_value inContext:(WOContext *)_ctx { [self setCharValue:_value inComponent:(id)[_ctx cursor]]; } - (void)setUnsignedIntValue:(unsigned int)_v inContext:(WOContext *)_c { [self setUnsignedIntValue:_v inComponent:(id)[_c cursor]]; } -- (void)setIntValue:(int)_value inContext:(WOContext *)_ctx { +- (void)setIntValue:(signed int)_value inContext:(WOContext *)_ctx { [self setIntValue:_value inComponent:(id)[_ctx cursor]]; } - (void)setBoolValue:(BOOL)_value inContext:(WOContext *)_ctx { @@ -310,13 +305,13 @@ static Class WOKeyPathAssociationClass = Nil; - (unsigned char)unsignedCharValueInContext:(WOContext *)_ctx { return [self unsignedCharValueInComponent:[_ctx cursor]]; } -- (char)charValueInContext:(WOContext *)_ctx { +- (signed char)charValueInContext:(WOContext *)_ctx { return [self charValueInComponent:[_ctx cursor]]; } - (unsigned int)unsignedIntValueInContext:(WOContext *)_ctx { return [self unsignedIntValueInComponent:[_ctx cursor]]; } -- (int)intValueInContext:(WOContext *)_ctx { +- (signed int)intValueInContext:(WOContext *)_ctx { return [self intValueInComponent:[_ctx cursor]]; } - (BOOL)boolValueInContext:(WOContext *)_ctx { @@ -334,18 +329,16 @@ static Class WOKeyPathAssociationClass = Nil; - (id)copyWithZone:(NSZone *)_zone { // WOAssociations are immutable - return RETAIN(self); + return [self retain]; } -@end /* WOAssociation(SpecialsValues) */ - -@implementation WOAssociation(BugTrap) +/* BugTrap */ - (unsigned int)unsignedIntValue { [self notImplemented:_cmd]; return 0; } -- (int)intValue { +- (signed int)intValue { [self notImplemented:_cmd]; return 0; } @@ -363,4 +356,4 @@ static Class WOKeyPathAssociationClass = Nil; return nil; } -@end /* WOAssociation(BugTrap) */ +@end /* WOAssociation */ diff --git a/sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m b/sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m index 32b1a221..61d7ad1b 100644 --- a/sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m +++ b/sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m @@ -801,7 +801,8 @@ static BOOL _setValue(WOKeyPathAssociation *self, id _value, id root) { break; case _C_CHR: - sm.cmethod(object, setSel, [_value charValue]); + sm.cmethod(object, setSel, + [(id)_value charValue]); break; case _C_UCHR: sm.ucmethod(object, setSel, [_value unsignedCharValue]); diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index 5eb55d98..c969f729 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,3 +1,8 @@ +2005-11-21 Helge Hess + + * Associations/WOAssociation.[hm]. WOKeyPathAssociation.m: explicitly + type signed char values to avoid gcc4 warnings (v4.5.214) + 2005-11-20 Helge Hess * v4.5.213 diff --git a/sope-appserver/NGObjWeb/NGObjWeb/WOAssociation.h b/sope-appserver/NGObjWeb/NGObjWeb/WOAssociation.h index bc20d0ec..7105cd9b 100644 --- a/sope-appserver/NGObjWeb/NGObjWeb/WOAssociation.h +++ b/sope-appserver/NGObjWeb/NGObjWeb/WOAssociation.h @@ -53,15 +53,15 @@ @interface WOAssociation(SpecialsValues) - (void)setUnsignedCharValue:(unsigned char)_v inComponent:(WOComponent *)_c; -- (void)setCharValue:(char)_value inComponent:(WOComponent *)_component; +- (void)setCharValue:(signed char)_value inComponent:(WOComponent *)_component; - (void)setUnsignedIntValue:(unsigned int)_v inComponent:(WOComponent *)_comp; -- (void)setIntValue:(int)_value inComponent:(WOComponent *)_component; +- (void)setIntValue:(signed int)_value inComponent:(WOComponent *)_component; - (void)setBoolValue:(BOOL)_value inComponent:(WOComponent *)_component; - (unsigned char)unsignedCharValueInComponent:(WOComponent *)_component; -- (char)charValueInComponent:(WOComponent *)_component; +- (signed char)charValueInComponent:(WOComponent *)_component; - (unsigned int)unsignedIntValueInComponent:(WOComponent *)_component; -- (int)intValueInComponent:(WOComponent *)_component; +- (signed int)intValueInComponent:(WOComponent *)_component; - (BOOL)boolValueInComponent:(WOComponent *)_component; - (void)setStringValue:(NSString *)_v inComponent:(WOComponent *)_component; @@ -70,15 +70,15 @@ /* special context values */ - (void)setUnsignedCharValue:(unsigned char)_v inContext:(WOContext *)_c; -- (void)setCharValue:(char)_value inContext:(WOContext *)_ctx; +- (void)setCharValue:(signed char)_value inContext:(WOContext *)_ctx; - (void)setUnsignedIntValue:(unsigned int)_v inContext:(WOContext *)_c; -- (void)setIntValue:(int)_value inContext:(WOContext *)_ctx; +- (void)setIntValue:(signed int)_value inContext:(WOContext *)_ctx; - (void)setBoolValue:(BOOL)_value inContext:(WOContext *)_ctx; - (unsigned char)unsignedCharValueInContext:(WOContext *)_ctx; -- (char)charValueInContext:(WOContext *)_ctx; +- (signed char)charValueInContext:(WOContext *)_ctx; - (unsigned int)unsignedIntValueInContext:(WOContext *)_ctx; -- (int)intValueInContext:(WOContext *)_ctx; +- (signed int)intValueInContext:(WOContext *)_ctx; - (BOOL)boolValueInContext:(WOContext *)_ctx; - (void)setStringValue:(NSString *)_v inContext:(WOContext *)_ctx; diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index 08121c7d..0c1be35d 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,7 +1,8 @@ # version file -SUBMINOR_VERSION:=213 +SUBMINOR_VERSION:=214 +# v4.5.214 requires libNGExtensions v4.5.179 # v4.5.122 requires libNGExtensions v4.5.153 # v4.5.91 requires libNGExtensions v4.5.134 # v4.5.84 requires libNGExtensions v4.5.127 diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index 93a9bdbf..2c7f35ae 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,3 +1,9 @@ +2005-11-21 Helge Hess + + * NGExtensions/NSObject+Values.h: added NGBaseTypeValues protocol to + be able to refer to the statically typed 'signed' set of basetypes + (v4.5.179) + 2005-11-17 Helge Hess * FdExt.subproj/NSObject+Values.m: explicitly mark signed values as diff --git a/sope-core/NGExtensions/NGExtensions/NSObject+Values.h b/sope-core/NGExtensions/NGExtensions/NSObject+Values.h index d9a3c0bb..4750c3c1 100644 --- a/sope-core/NGExtensions/NGExtensions/NSObject+Values.h +++ b/sope-core/NGExtensions/NGExtensions/NSObject+Values.h @@ -25,14 +25,10 @@ #import #import -@interface NSObject(NGValues) +@protocol NGBaseTypeValues -- (BOOL)boolValue; // this returns always YES (the id != nil) +- (BOOL)boolValue; -/* - these methods perform their operation on the string-representation of the - object -*/ - (signed char)charValue; - (unsigned char)unsignedCharValue; - (signed short)shortValue; @@ -44,6 +40,17 @@ - (signed long long)longLongValue; - (unsigned long long)unsignedLongLongValue; - (float)floatValue; + +@end + +/* + The default basetype methods perform their operation on the + string-representation of the object. + + -boolValue returns YES per default. (id != nil) +*/ +@interface NSObject(NGValues) < NGBaseTypeValues > + - (double)doubleValue; - (NSString *)stringValue; diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index d6b947f0..4d437fa9 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,6 +1,6 @@ # version -SUBMINOR_VERSION:=178 +SUBMINOR_VERSION:=179 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39