case 4:
// Methods starting with 'alloc' or contain 'copy' follow the
// create rule
- if ((AtBeginning && StringsEqualNoCase("alloc", s, len)) ||
- (C == NoConvention && StringsEqualNoCase("copy", s, len)))
+ if (C == NoConvention && StringsEqualNoCase("copy", s, len))
C = CreateRule;
else // Methods starting with 'init' follow the init rule.
if (AtBeginning && StringsEqualNoCase("init", s, len))
- C = InitRule;
+ C = InitRule;
+ break;
+ case 5:
+ if (AtBeginning && StringsEqualNoCase("alloc", s, len))
+ C = CreateRule;
break;
}
@end @protocol NSCopying - (id)copyWithZone:(NSZone *)zone;
@end @protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone;
@end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder;
-@end @interface NSObject <NSObject> {
-}
+@end
+@interface NSObject <NSObject> {}
+ (id)alloc;
++ (id)allocWithZone:(NSZone *)zone;
@end typedef float CGFloat;
@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding> - (NSUInteger)length;
- (const char *)UTF8String;
[name release];
}
+// PR 3677 - 'allocWithZone' should be treated as following the Cocoa naming
+// conventions with respect to 'return'ing ownership.
+@interface PR3677: NSObject @end
+@implementation PR3677
++ (id)allocWithZone:(NSZone *)inZone {
+ return [super allocWithZone:inZone]; // no-warning
+}
+@end
+