Skip to content

Commit b8f0e97

Browse files
philIipfacebook-github-bot
authored andcommitted
use NSInteger for NS_ENUM instead of NSUInteger
Summary: as title in practice, this doesn't make any difference, but this is to follow the apple recommendation and for us to have a more consistent codebase. https://developer.apple.com/library/content/releasenotes/ObjectiveC/ModernizationObjC/AdoptingModernObjective-C/AdoptingModernObjective-C.html >The NS_ENUM macro helps define both the name and type of the enumeration, in this case named UITableViewCellStyle of type NSInteger. The type for enumerations should be NSInteger. >Like enumerations, the NS_OPTIONS macro defines both a name and a type. However, the type for options should usually be NSUInteger. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D32641990 fbshipit-source-id: 56e4cd44cdefe54f61c90844665a685ee2d6ffad
1 parent d4c1c5f commit b8f0e97

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

Libraries/Image/RCTImageLoaderProtocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
3434
* Use PriorityPrefetch to prefetch images at a lower priority.
3535
* The priority logic is up to each @RCTImageLoaderProtocol implementation
3636
*/
37-
typedef NS_ENUM(NSUInteger, RCTImageLoaderPriority) {
37+
typedef NS_ENUM(NSInteger, RCTImageLoaderPriority) {
3838
RCTImageLoaderPriorityImmediate,
3939
RCTImageLoaderPriorityPrefetch
4040
};

React/Base/RCTBridgeMethod.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
@class RCTBridge;
1111

12-
typedef NS_ENUM(NSUInteger, RCTFunctionType) {
12+
typedef NS_ENUM(NSInteger, RCTFunctionType) {
1313
RCTFunctionTypeNormal,
1414
RCTFunctionTypePromise,
1515
RCTFunctionTypeSync,

React/Base/RCTNullability.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#import <Foundation/Foundation.h>
99

10-
typedef NS_ENUM(NSUInteger, RCTNullability) {
10+
typedef NS_ENUM(NSInteger, RCTNullability) {
1111
RCTNullabilityUnspecified,
1212
RCTNullable,
1313
RCTNonnullable,

React/Base/RCTPerformanceLogger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#import <Foundation/Foundation.h>
99

1010
// Keep this in sync with _labelsForTags
11-
typedef NS_ENUM(NSUInteger, RCTPLTag) {
11+
typedef NS_ENUM(NSInteger, RCTPLTag) {
1212
RCTPLScriptDownload = 0,
1313
RCTPLScriptExecution,
1414
RCTPLRAMBundleLoad,

React/CxxBridge/RCTCxxBridge.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
/**
7777
* Must be kept in sync with `MessageQueue.js`.
7878
*/
79-
typedef NS_ENUM(NSUInteger, RCTBridgeFields) {
79+
typedef NS_ENUM(NSInteger, RCTBridgeFields) {
8080
RCTBridgeFieldRequestModuleIDs = 0,
8181
RCTBridgeFieldMethodIDs,
8282
RCTBridgeFieldParams,

packages/rn-tester/RCTTest/FBSnapshotTestCase/FBSnapshotTestController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ - (BOOL)compareReferenceImage:(UIImage *)referenceImage toImage:(UIImage *)image
208208

209209
#pragma mark - Private API
210210

211-
typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
211+
typedef NS_ENUM(NSInteger, FBTestSnapshotFileNameType) {
212212
FBTestSnapshotFileNameTypeReference,
213213
FBTestSnapshotFileNameTypeFailedReference,
214214
FBTestSnapshotFileNameTypeFailedTest,

0 commit comments

Comments
 (0)