2013-07-19 04:11:45 +08:00
|
|
|
// RUN: rm -rf %t
|
2013-10-03 06:49:59 +08:00
|
|
|
// RUN: %clang_cc1 -objcmt-migrate-ns-macros -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
|
2013-07-19 04:11:45 +08:00
|
|
|
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
|
2013-09-28 04:21:48 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
|
2013-07-19 04:11:45 +08:00
|
|
|
|
2014-10-07 07:50:37 +08:00
|
|
|
typedef signed char int8_t;
|
|
|
|
typedef short int16_t;
|
|
|
|
typedef int int32_t;
|
2013-07-19 04:11:45 +08:00
|
|
|
typedef long NSInteger;
|
2014-10-07 07:50:37 +08:00
|
|
|
typedef long long int64_t;
|
|
|
|
|
|
|
|
typedef unsigned char uint8_t;
|
|
|
|
typedef unsigned short uint16_t;
|
|
|
|
typedef unsigned int uint32_t;
|
2013-07-19 09:05:49 +08:00
|
|
|
typedef unsigned long NSUInteger;
|
2014-10-07 07:50:37 +08:00
|
|
|
typedef unsigned long long uint64_t;
|
2013-07-19 09:05:49 +08:00
|
|
|
|
2013-07-19 04:11:45 +08:00
|
|
|
#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
|
2013-07-19 09:05:49 +08:00
|
|
|
#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
|
2013-09-18 05:56:04 +08:00
|
|
|
#define DEPRECATED __attribute__((deprecated))
|
2013-07-19 04:11:45 +08:00
|
|
|
|
|
|
|
typedef NS_ENUM(NSInteger, wibble) {
|
|
|
|
blah,
|
|
|
|
blarg
|
|
|
|
};
|
2013-07-19 06:17:33 +08:00
|
|
|
|
2013-08-31 01:46:01 +08:00
|
|
|
typedef NS_ENUM(NSUInteger, UITableViewCellStyle) {
|
2013-07-19 09:05:49 +08:00
|
|
|
UIViewAutoresizingNone = 0,
|
2013-07-23 02:53:45 +08:00
|
|
|
UIViewAutoresizingFlexibleLeftMargin,
|
|
|
|
UIViewAutoresizingFlexibleWidth,
|
|
|
|
UIViewAutoresizingFlexibleRightMargin,
|
|
|
|
UIViewAutoresizingFlexibleTopMargin,
|
|
|
|
UIViewAutoresizingFlexibleHeight,
|
|
|
|
UIViewAutoresizingFlexibleBottomMargin
|
2013-07-19 09:05:49 +08:00
|
|
|
};
|
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_ENUM(unsigned int, UIViewAnimationTransition) {
|
2013-07-20 04:18:36 +08:00
|
|
|
UIViewAnimationTransitionNone,
|
|
|
|
UIViewAnimationTransitionFlipFromLeft,
|
|
|
|
UIViewAnimationTransitionFlipFromRight,
|
|
|
|
UIViewAnimationTransitionCurlUp,
|
|
|
|
UIViewAnimationTransitionCurlDown,
|
2014-10-02 04:46:32 +08:00
|
|
|
};
|
2013-07-20 04:18:36 +08:00
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_OPTIONS(unsigned int, UITableView) {
|
2013-07-23 02:53:45 +08:00
|
|
|
UIViewOne = 0,
|
|
|
|
UIViewTwo = 1 << 0,
|
|
|
|
UIViewThree = 1 << 1,
|
|
|
|
UIViewFour = 1 << 2,
|
|
|
|
UIViewFive = 1 << 3,
|
|
|
|
UIViewSix = 1 << 4,
|
|
|
|
UIViewSeven = 1 << 5
|
2014-10-02 04:46:32 +08:00
|
|
|
};
|
2013-07-23 02:53:45 +08:00
|
|
|
|
|
|
|
typedef NS_OPTIONS(NSUInteger, UI) {
|
|
|
|
UIOne = 0,
|
|
|
|
UITwo = 0x1,
|
|
|
|
UIthree = 0x8,
|
|
|
|
UIFour = 0x100
|
|
|
|
};
|
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_OPTIONS(unsigned int, UIPOWER2) {
|
2013-07-23 02:53:45 +08:00
|
|
|
UIP2One = 0,
|
|
|
|
UIP2Two = 0x1,
|
|
|
|
UIP2three = 0x8,
|
|
|
|
UIP2Four = 0x100
|
2014-10-02 04:46:32 +08:00
|
|
|
};
|
2013-07-23 02:53:45 +08:00
|
|
|
|
2013-07-20 01:44:32 +08:00
|
|
|
enum {
|
|
|
|
UNOne,
|
|
|
|
UNTwo
|
|
|
|
};
|
|
|
|
|
2013-08-16 02:46:37 +08:00
|
|
|
// Should use NS_ENUM even though it is all power of 2.
|
|
|
|
typedef NS_ENUM(NSInteger, UIK) {
|
2013-08-30 08:10:37 +08:00
|
|
|
UIKOne = 1,
|
|
|
|
UIKTwo = 2,
|
2013-08-16 02:46:37 +08:00
|
|
|
};
|
|
|
|
|
2016-07-16 03:22:34 +08:00
|
|
|
typedef NS_ENUM(unsigned int, NSTickMarkPosition) {
|
2013-08-16 03:27:42 +08:00
|
|
|
NSTickMarkBelow = 0,
|
|
|
|
NSTickMarkAbove = 1,
|
|
|
|
NSTickMarkLeft = NSTickMarkAbove,
|
|
|
|
NSTickMarkRight = NSTickMarkBelow
|
2014-10-02 04:46:32 +08:00
|
|
|
};
|
2013-08-30 08:10:37 +08:00
|
|
|
|
|
|
|
typedef NS_OPTIONS(NSUInteger, UITableStyle) {
|
|
|
|
UIViewNone = 0x0,
|
|
|
|
UIViewMargin = 0x1,
|
|
|
|
UIViewWidth = 0x2,
|
|
|
|
UIViewRightMargin = 0x3,
|
|
|
|
UIViewBottomMargin = 0xbadbeef
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef NS_OPTIONS(NSUInteger, UIStyle) {
|
|
|
|
UIView0 = 0,
|
|
|
|
UIView1 = 0XBADBEEF
|
|
|
|
};
|
|
|
|
|
2013-08-31 01:46:01 +08:00
|
|
|
typedef NS_ENUM(NSUInteger, NSBitmapImageFileType) {
|
|
|
|
NSTIFFFileType,
|
|
|
|
NSBMPFileType,
|
|
|
|
NSGIFFileType,
|
|
|
|
NSJPEGFileType,
|
|
|
|
NSPNGFileType,
|
|
|
|
NSJPEG2000FileType
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef NS_ENUM(NSUInteger, NSAlertStyle) {
|
|
|
|
NSWarningAlertStyle = 0,
|
|
|
|
NSInformationalAlertStyle = 1,
|
|
|
|
NSCriticalAlertStyle = 2
|
|
|
|
};
|
|
|
|
|
2013-09-18 05:56:04 +08:00
|
|
|
enum {
|
|
|
|
D_NSTIFFFileType,
|
|
|
|
D_NSBMPFileType,
|
|
|
|
D_NSGIFFileType,
|
|
|
|
D_NSJPEGFileType,
|
|
|
|
D_NSPNGFileType,
|
|
|
|
D_NSJPEG2000FileType
|
|
|
|
};
|
|
|
|
typedef NSUInteger D_NSBitmapImageFileType DEPRECATED;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
D_NSTickMarkBelow = 0,
|
|
|
|
D_NSTickMarkAbove = 1
|
|
|
|
} D_NSTickMarkPosition DEPRECATED;
|
|
|
|
|
2013-09-18 07:32:51 +08:00
|
|
|
|
|
|
|
#define NS_ENUM_AVAILABLE(X,Y)
|
|
|
|
|
2013-10-15 08:00:28 +08:00
|
|
|
|
2013-09-18 07:32:51 +08:00
|
|
|
typedef NS_OPTIONS(NSUInteger, NSFOptions) {
|
|
|
|
NSFStrongMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (0UL << 0),
|
|
|
|
NSFOpaqueMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (2UL << 0),
|
|
|
|
NSFMallocMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (3UL << 0),
|
|
|
|
NSFMachVirtualMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (4UL << 0),
|
|
|
|
NSFWeakMemory NS_ENUM_AVAILABLE(10_8, 6_0) = (5UL << 0),
|
|
|
|
|
|
|
|
NSFObjectPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (0UL << 8),
|
|
|
|
NSFOpaquePersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (1UL << 8),
|
|
|
|
NSFObjectPointerPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (2UL << 8),
|
|
|
|
NSFCStringPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (3UL << 8),
|
|
|
|
NSFStructPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (4UL << 8),
|
|
|
|
NSFIntegerPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (5UL << 8),
|
|
|
|
NSFCopyIn NS_ENUM_AVAILABLE(10_5, 6_0) = (1UL << 16),
|
|
|
|
};
|
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_ENUM(unsigned int, UIP) {
|
2013-09-24 04:27:06 +08:00
|
|
|
UIP0One = 0,
|
|
|
|
UIP0Two = 1,
|
|
|
|
UIP0Three = 2,
|
|
|
|
UIP0Four = 10,
|
|
|
|
UIP0Last = 0x100
|
2014-10-02 04:46:32 +08:00
|
|
|
};
|
2013-09-24 04:27:06 +08:00
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_OPTIONS(unsigned int, UIP_3) {
|
2013-09-24 04:27:06 +08:00
|
|
|
UIPZero = 0x0,
|
|
|
|
UIPOne = 0x1,
|
|
|
|
UIPTwo = 0x2,
|
|
|
|
UIP10 = 0x10,
|
|
|
|
UIPHundred = 0x100
|
2014-10-02 04:46:32 +08:00
|
|
|
};
|
2013-09-24 04:27:06 +08:00
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_ENUM(unsigned int, UIP4_3) {
|
2013-09-24 04:27:06 +08:00
|
|
|
UIP4Zero = 0x0,
|
|
|
|
UIP4One = 0x1,
|
|
|
|
UIP4Two = 0x2,
|
|
|
|
UIP410 = 0x10,
|
|
|
|
UIP4Hundred = 100
|
2014-10-02 04:46:32 +08:00
|
|
|
};
|
2013-09-24 04:27:06 +08:00
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_OPTIONS(unsigned int, UIP5_3) {
|
2013-09-24 04:27:06 +08:00
|
|
|
UIP5Zero = 0x0,
|
|
|
|
UIP5Two = 0x2,
|
|
|
|
UIP510 = 0x3,
|
|
|
|
UIP5Hundred = 0x4
|
2014-10-02 04:46:32 +08:00
|
|
|
};
|
2013-09-24 04:27:06 +08:00
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_ENUM(unsigned int, UIP6_3) {
|
2013-09-24 04:27:06 +08:00
|
|
|
UIP6Zero = 0x0,
|
|
|
|
UIP6One = 0x1,
|
|
|
|
UIP6Two = 0x2,
|
|
|
|
UIP610 = 10,
|
|
|
|
UIP6Hundred = 0x100
|
2014-10-02 04:46:32 +08:00
|
|
|
};
|
2013-09-24 04:27:06 +08:00
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_ENUM(unsigned int, UIP7_3) {
|
2013-09-24 04:27:06 +08:00
|
|
|
UIP7Zero = 0x0,
|
|
|
|
UIP7One = 1,
|
|
|
|
UIP7Two = 0x2,
|
|
|
|
UIP710 = 10,
|
|
|
|
UIP7Hundred = 100
|
2014-10-02 04:46:32 +08:00
|
|
|
};
|
2013-09-24 04:27:06 +08:00
|
|
|
|
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_ENUM(unsigned int, UIP8_3) {
|
2013-09-24 04:27:06 +08:00
|
|
|
Random = 0,
|
|
|
|
Random1 = 2,
|
|
|
|
Random2 = 4,
|
|
|
|
Random3 = 0x12345,
|
|
|
|
Random4 = 0x3444444,
|
|
|
|
Random5 = 0xbadbeef,
|
|
|
|
Random6
|
2014-10-02 04:46:32 +08:00
|
|
|
};
|
2013-10-12 01:35:22 +08:00
|
|
|
|
|
|
|
// rdar://15200602
|
|
|
|
#define NS_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
|
|
|
|
#define NS_ENUM_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
|
|
|
|
|
|
|
|
typedef NS_ENUM(NSInteger, NSModalResponse) {
|
|
|
|
NSModalResponseStop = (-1000), // Also used as the default response for sheets
|
|
|
|
NSModalResponseAbort = (-1001),
|
|
|
|
NSModalResponseContinue = (-1002),
|
|
|
|
} NS_ENUM_AVAILABLE_MAC(10.9);
|
2013-10-12 05:34:56 +08:00
|
|
|
|
2013-10-15 08:00:28 +08:00
|
|
|
// rdar://15201056
|
2013-10-18 06:23:32 +08:00
|
|
|
typedef NSUInteger FarFarAwayOptions;
|
|
|
|
|
|
|
|
// rdar://15200915
|
|
|
|
typedef NS_OPTIONS(NSUInteger, FarAwayOptions) {
|
2013-10-15 08:00:28 +08:00
|
|
|
FarAway1 = 1 << 1,
|
|
|
|
FarAway2 = 1 << 2
|
|
|
|
};
|
2013-10-12 05:34:56 +08:00
|
|
|
typedef NS_OPTIONS(NSUInteger, NSWorkspaceLaunchOptions) {
|
|
|
|
NSWorkspaceLaunchAndPrint = 0x00000002,
|
|
|
|
NSWorkspaceLaunchWithErrorPresentation = 0x00000040,
|
|
|
|
NSWorkspaceLaunchInhibitingBackgroundOnly = 0x00000080,
|
|
|
|
NSWorkspaceLaunchWithoutAddingToRecents = 0x00000100,
|
|
|
|
NSWorkspaceLaunchWithoutActivation = 0x00000200,
|
|
|
|
NSWorkspaceLaunchAsync = 0x00010000,
|
|
|
|
NSWorkspaceLaunchAllowingClassicStartup = 0x00020000,
|
|
|
|
NSWorkspaceLaunchPreferringClassic = 0x00040000,
|
|
|
|
NSWorkspaceLaunchNewInstance = 0x00080000,
|
|
|
|
NSWorkspaceLaunchAndHide = 0x00100000,
|
|
|
|
NSWorkspaceLaunchAndHideOthers = 0x00200000,
|
|
|
|
NSWorkspaceLaunchDefault = NSWorkspaceLaunchAsync |
|
2013-10-18 06:23:32 +08:00
|
|
|
NSWorkspaceLaunchAllowingClassicStartup
|
2013-10-12 05:34:56 +08:00
|
|
|
};
|
|
|
|
|
2013-10-18 06:23:32 +08:00
|
|
|
typedef NS_OPTIONS(NSUInteger, NSExcludeOptions) {
|
2013-10-12 05:34:56 +08:00
|
|
|
NSExcludeQuickDrawElementsIconCreationOption = 1 << 1,
|
|
|
|
NSExclude10_4ElementsIconCreationOption = 1 << 2
|
|
|
|
};
|
|
|
|
|
2013-10-18 06:23:32 +08:00
|
|
|
typedef NS_OPTIONS(NSUInteger, NSExcludeCreationOption) {
|
2013-10-12 05:34:56 +08:00
|
|
|
NSExcludeQuickDrawElementsCreationOption = 1 << 1,
|
|
|
|
NSExclude10_4ElementsCreationOption = 1 << 2
|
|
|
|
};
|
|
|
|
|
2013-10-15 08:00:28 +08:00
|
|
|
|
2013-10-18 06:23:32 +08:00
|
|
|
typedef NS_OPTIONS(NSUInteger, NSExcludeIconOptions) {
|
2013-10-12 05:34:56 +08:00
|
|
|
NSExcludeQuickDrawElementsIconOption = 1 << 1,
|
|
|
|
NSExclude10_4ElementsIconOption = 1 << 2
|
|
|
|
};
|
2013-10-15 08:00:28 +08:00
|
|
|
|
|
|
|
@interface INTF {
|
2013-10-18 06:23:32 +08:00
|
|
|
NSExcludeIconOptions I1;
|
|
|
|
NSExcludeIconOptions I2;
|
2013-10-15 08:00:28 +08:00
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2013-10-18 06:23:32 +08:00
|
|
|
enum {
|
|
|
|
FarFarAway1 = 1 << 1,
|
|
|
|
FarFarAway2 = 1 << 2
|
|
|
|
};
|
|
|
|
|
|
|
|
// rdar://15200915
|
|
|
|
typedef NS_OPTIONS(NSUInteger, NSWindowOcclusionState) {
|
|
|
|
NSWindowOcclusionStateVisible = 1UL << 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef NS_ENUM(NSUInteger, NSWindowNumberListOptions) {
|
|
|
|
NSWindowCloseButton,
|
|
|
|
NSWindowMiniaturizeButton,
|
|
|
|
NSWindowZoomButton,
|
|
|
|
NSWindowToolbarButton,
|
|
|
|
NSWindowDocumentIconButton
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef NS_ENUM(NSUInteger, NSSelectionDirection) {
|
|
|
|
NSDirectSelection = 0,
|
|
|
|
NSSelectingNext,
|
|
|
|
NSSelectingPrevious
|
|
|
|
};
|
|
|
|
|
|
|
|
// standard window buttons
|
2014-09-16 00:41:47 +08:00
|
|
|
|
|
|
|
// rdar://18262255
|
2015-01-27 01:41:03 +08:00
|
|
|
typedef NS_ENUM(NSUInteger, Thing) {
|
2014-09-16 00:41:47 +08:00
|
|
|
ThingOne,
|
|
|
|
ThingTwo,
|
|
|
|
ThingThree,
|
2015-01-27 01:41:03 +08:00
|
|
|
};
|
2014-09-16 00:41:47 +08:00
|
|
|
|
2014-10-02 04:46:32 +08:00
|
|
|
// rdar://18498539
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_ENUM(unsigned int, NumericEnum) {
|
2014-10-02 04:46:32 +08:00
|
|
|
one = 1
|
|
|
|
};
|
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_ENUM(unsigned int, NumericEnum2) {
|
2014-10-02 04:46:32 +08:00
|
|
|
Two = 2
|
|
|
|
};
|
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_ENUM(unsigned int, NumericEnum3) {
|
2014-10-02 04:46:32 +08:00
|
|
|
Three = 3
|
|
|
|
};
|
|
|
|
|
2014-12-11 02:25:24 +08:00
|
|
|
typedef NS_OPTIONS(unsigned int, NumericEnum4) {
|
2014-10-02 04:46:32 +08:00
|
|
|
Four = 4
|
|
|
|
};
|
|
|
|
|
2014-10-07 07:50:37 +08:00
|
|
|
// rdar://18532199
|
|
|
|
typedef NS_ENUM(int8_t, MyEnumeratedType)
|
|
|
|
{
|
|
|
|
UI8one = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef NS_OPTIONS(uint16_t, UI16) {
|
|
|
|
UI16One = 0,
|
|
|
|
UI16Two = 0x1,
|
|
|
|
UI16three = 0x8,
|
|
|
|
UI16Four = 0x100
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef NS_ENUM(uint32_t, UI32TableViewCellStyle) {
|
|
|
|
UI32ViewAutoresizingNone = 0,
|
|
|
|
UI32ViewAutoresizingFlexibleLeftMargin,
|
|
|
|
UI32ViewAutoresizingFlexibleWidth,
|
|
|
|
UI32ViewAutoresizingFlexibleRightMargin,
|
|
|
|
UI32ViewAutoresizingFlexibleTopMargin,
|
|
|
|
UI32ViewAutoresizingFlexibleHeight,
|
|
|
|
UI32ViewAutoresizingFlexibleBottomMargin
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef NS_ENUM(uint8_t, UI8Type)
|
|
|
|
{
|
|
|
|
UIU8one = 1
|
|
|
|
};
|
2015-01-27 01:41:03 +08:00
|
|
|
|
|
|
|
// rdar://19352510
|
|
|
|
typedef NS_ENUM(NSInteger, MyEnum) {zero};
|
|
|
|
|
|
|
|
typedef NS_ENUM(NSUInteger, MyEnumNSUInteger) {two};
|
|
|
|
|
|
|
|
typedef NS_ENUM(int, MyEnumint) {three, four};
|
|
|
|
|
|
|
|
typedef NS_ENUM(unsigned long, MyEnumlonglong) {five};
|
|
|
|
|
|
|
|
typedef NS_ENUM(unsigned long long, MyEnumunsignedlonglong) {
|
|
|
|
ll1,
|
|
|
|
ll2= 0xff,
|
|
|
|
ll3,
|
|
|
|
ll4
|
|
|
|
};
|
2015-03-03 07:58:02 +08:00
|
|
|
|
|
|
|
// rdar://19994496
|
|
|
|
typedef NS_ENUM(int8_t, MyOneEnum) {int8_one};
|
|
|
|
|
|
|
|
typedef NS_ENUM(int16_t, Myint16_tEnum) {
|
|
|
|
int16_t_one,
|
|
|
|
int16_t_two };
|