diff --git a/ChangeLog b/ChangeLog index 16d2455ee..4a5af17ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,17 @@ content. * Source/NSPredicate.m: Revert to previous version as last change contained broken code and wouldn't compile. + * Source/NSKeyValueCoding.m: + * Source/GSArray.m: + * Source/GSFFCallInvocation.m: + * Source/NSInvocation.m: + * Source/NSCoder.m: + * Source/NSObject.m: + * Source/Additions/GSCategories.m: + * Headers/Foundation/NSLock.h: + * Tools/AGSHtml.m: + * Tools/autogsdoc.m: + Use casts to avoid spurious warnings from gcc-4.1 2006-05-15 Fred Kiefer diff --git a/Headers/Foundation/NSLock.h b/Headers/Foundation/NSLock.h index 3d4c332b8..674723cc7 100644 --- a/Headers/Foundation/NSLock.h +++ b/Headers/Foundation/NSLock.h @@ -222,7 +222,7 @@ * */ #define GS_INITIALIZED_LOCK(IDENT,CLASSNAME) \ - (IDENT != nil ? IDENT : [CLASSNAME newLockAt: &IDENT]) + (IDENT != nil ? (id)IDENT : (id)[CLASSNAME newLockAt: &IDENT]) /** * Defines the newLockAt: method. diff --git a/Source/Additions/GSCategories.m b/Source/Additions/GSCategories.m index 3e6a05a96..a2e551517 100644 --- a/Source/Additions/GSCategories.m +++ b/Source/Additions/GSCategories.m @@ -992,7 +992,7 @@ static void MD5Transform (uint32_t buf[4], uint32_t const in[16]) * Ordering objects by their address is pretty useless, * so subclasses should override this is some useful way. */ - if (self > anObject) + if ((id)self > anObject) { return NSOrderedDescending; } diff --git a/Source/GSArray.m b/Source/GSArray.m index 4184ee8e5..5f5b77aa9 100644 --- a/Source/GSArray.m +++ b/Source/GSArray.m @@ -19,7 +19,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. $Date$ $Revision$ */ @@ -121,9 +122,9 @@ static Class GSInlineArrayClass; + (id) allocWithZone: (NSZone*)zone { - GSArray *array = NSAllocateObject(self, 0, zone); + GSArray *array = (GSArray*)NSAllocateObject(self, 0, zone); - return array; + return (id)array; } - (id) copyWithZone: (NSZone*)zone diff --git a/Source/GSFFCallInvocation.m b/Source/GSFFCallInvocation.m index b6785ead0..bc491be9e 100644 --- a/Source/GSFFCallInvocation.m +++ b/Source/GSFFCallInvocation.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #include "Foundation/NSException.h" #include "Foundation/NSCoder.h" @@ -684,8 +685,8 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp) { GSMethod method; method = GSGetMethod((GSObjCIsInstance(_target) - ? GSObjCClass(_target) - : _target), + ? (id)GSObjCClass(_target) + : (id)_target), _selector, GSObjCIsInstance(_target), YES); diff --git a/Source/NSCoder.m b/Source/NSCoder.m index ed96a8d90..ef49c62af 100644 --- a/Source/NSCoder.m +++ b/Source/NSCoder.m @@ -123,8 +123,9 @@ - (void) encodePropertyList: (id)plist { - id anObject = plist ? [NSSerializer serializePropertyList: plist] : nil; + id anObject; + anObject = plist ? (id)[NSSerializer serializePropertyList: plist] : nil; [self encodeValueOfObjCType: @encode(id) at: &anObject]; } diff --git a/Source/NSInvocation.m b/Source/NSInvocation.m index 9f4f9c75d..5b9b05d40 100644 --- a/Source/NSInvocation.m +++ b/Source/NSInvocation.m @@ -19,7 +19,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. NSInvocation class reference $Date$ $Revision$ @@ -602,8 +603,8 @@ _arg_addr(NSInvocation *inv, int index) { GSMethod method; method = GSGetMethod((GSObjCIsInstance(_target) - ? GSObjCClass(_target) - : _target), + ? (id)GSObjCClass(_target) + : (id)_target), _selector, GSObjCIsInstance(_target), YES); diff --git a/Source/NSKeyValueCoding.m b/Source/NSKeyValueCoding.m index 293a322a7..75b38eebd 100644 --- a/Source/NSKeyValueCoding.m +++ b/Source/NSKeyValueCoding.m @@ -217,11 +217,9 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size) - (id) handleQueryWithUnboundKey: (NSString*)aKey { NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: - self, - @"NSTargetObjectUserInfoKey", - (aKey ? aKey : @"(nil)"), - @"NSUnknownUserInfoKey", - nil]; + self, @"NSTargetObjectUserInfoKey", + (aKey ? (id)aKey : (id)@"(nil)"), @"NSUnknownUserInfoKey", + nil]; NSException *exp = [NSException exceptionWithName: NSUndefinedKeyException reason: @"Unable to find value for key" userInfo: dict]; @@ -235,11 +233,9 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size) - (void) handleTakeValue: (id)anObject forUnboundKey: (NSString*)aKey { NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: - (anObject ? anObject : @"(nil)"), - @"NSTargetObjectUserInfoKey", - (aKey ? aKey : @"(nil)"), - @"NSUnknownUserInfoKey", - nil]; + (anObject ? (id)anObject : (id)@"(nil)"), @"NSTargetObjectUserInfoKey", + (aKey ? (id)aKey : (id)@"(nil)"), @"NSUnknownUserInfoKey", + nil]; NSException *exp = [NSException exceptionWithName: NSUndefinedKeyException reason: @"Unable to set value for key" userInfo: dict]; @@ -345,11 +341,9 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size) } dict = [NSDictionary dictionaryWithObjectsAndKeys: - (anObject ? anObject : @"(nil)"), - @"NSTargetObjectUserInfoKey", - (aKey ? aKey : @"(nil)"), - @"NSUnknownUserInfoKey", - nil]; + (anObject ? (id)anObject : (id)@"(nil)"), @"NSTargetObjectUserInfoKey", + (aKey ? (id)aKey : (id)@"(nil)"), @"NSUnknownUserInfoKey", + nil]; exp = [NSException exceptionWithName: NSInvalidArgumentException reason: @"Unable to set nil value for key" userInfo: dict]; @@ -801,11 +795,9 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size) return [self handleQueryWithUnboundKey: aKey]; } dict = [NSDictionary dictionaryWithObjectsAndKeys: - self, - @"NSTargetObjectUserInfoKey", - (aKey ? aKey : @"(nil)"), - @"NSUnknownUserInfoKey", - nil]; + self, @"NSTargetObjectUserInfoKey", + (aKey ? (id)aKey : (id)@"(nil)"), @"NSUnknownUserInfoKey", + nil]; exp = [NSException exceptionWithName: NSUndefinedKeyException reason: @"Unable to find value for key" userInfo: dict]; diff --git a/Source/NSObject.m b/Source/NSObject.m index e891b8cdf..ddb30d22b 100644 --- a/Source/NSObject.m +++ b/Source/NSObject.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. NSObject class reference $Date$ $Revision$ @@ -1388,8 +1389,9 @@ GSDescriptionForClassMethod(pcl self, SEL aSel) format: @"%@ null selector given", NSStringFromSelector(_cmd)]; mth = GSGetMethod(self, aSelector, YES, YES); - return mth ? [NSMethodSignature signatureWithObjCTypes:mth->method_types] - : nil; + if (mth == 0) + return nil; + return [NSMethodSignature signatureWithObjCTypes:mth->method_types]; } /** @@ -2075,8 +2077,9 @@ GSDescriptionForClassMethod(pcl self, SEL aSel) format: @"%@ null selector given", NSStringFromSelector(_cmd)]; mth = GSGetMethod(self, aSelector, YES, YES); - return mth ? [NSMethodSignature signatureWithObjCTypes:mth->method_types] - : nil; + if (mth == 0) + return nil; + return [NSMethodSignature signatureWithObjCTypes:mth->method_types]; } - (IMP) methodFor: (SEL)aSel diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 7e8455a0e..08fbe5cc1 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -2290,7 +2290,7 @@ static NSString *mainFont = nil; { NSArray *a; NSMutableString *ivarBuf = ivarsAtEnd ? - [NSMutableString stringWithCapacity: 1024] : nil; + (id)[NSMutableString stringWithCapacity: 1024] : nil; NSDictionary *prop = [node attributes]; node = [node firstChildElement]; diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index fa4da63bd..f90d596b3 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -2203,7 +2203,7 @@ main(int argc, char **argv, char **env) { NSLog(@"Replace %@ with %@", [s substringWithRange: replace], - repstr ? repstr : @"self"); + repstr ? (id)repstr : (id)@"self"); } if (repstr != nil) {