Transform the Count enum values into private constants

Summary:
Hides implementation details for the C, Objective-C and Swift APIs.
Closes https://github.com/facebook/yoga/pull/292

Differential Revision: D4351523

Pulled By: emilsjolander

fbshipit-source-id: 18a1149d169f0d52bd078714295000b5d07434dd
This commit is contained in:
David Hart 2016-12-22 02:57:19 -08:00 committed by Facebook Github Bot
parent 05e0b6719b
commit c1aff605ed
3 changed files with 13 additions and 22 deletions

View File

@ -599,8 +599,6 @@ static inline void RCTAssignSuggestedDimension(YGNodeRef cssNode, YGDimension di
YGNodeStyleSetHeight(cssNode, amount);
}
break;
case YGDimensionCount:
break;
}
}
}

View File

@ -13,28 +13,29 @@
YG_EXTERN_C_BEGIN
#define YGFlexDirectionCount 4
typedef enum YGFlexDirection {
YGFlexDirectionColumn,
YGFlexDirectionColumnReverse,
YGFlexDirectionRow,
YGFlexDirectionRowReverse,
YGFlexDirectionCount,
} YGFlexDirection;
#define YGMeasureModeCount 3
typedef enum YGMeasureMode {
YGMeasureModeUndefined,
YGMeasureModeExactly,
YGMeasureModeAtMost,
YGMeasureModeCount,
} YGMeasureMode;
#define YGPrintOptionsCount 3
typedef enum YGPrintOptions {
YGPrintOptionsLayout = 1,
YGPrintOptionsStyle = 2,
YGPrintOptionsChildren = 4,
YGPrintOptionsCount,
} YGPrintOptions;
#define YGEdgeCount 9
typedef enum YGEdge {
YGEdgeLeft,
YGEdgeTop,
@ -45,72 +46,71 @@ typedef enum YGEdge {
YGEdgeHorizontal,
YGEdgeVertical,
YGEdgeAll,
YGEdgeCount,
} YGEdge;
#define YGPositionTypeCount 2
typedef enum YGPositionType {
YGPositionTypeRelative,
YGPositionTypeAbsolute,
YGPositionTypeCount,
} YGPositionType;
#define YGDimensionCount 2
typedef enum YGDimension {
YGDimensionWidth,
YGDimensionHeight,
YGDimensionCount,
} YGDimension;
#define YGJustifyCount 5
typedef enum YGJustify {
YGJustifyFlexStart,
YGJustifyCenter,
YGJustifyFlexEnd,
YGJustifySpaceBetween,
YGJustifySpaceAround,
YGJustifyCount,
} YGJustify;
#define YGDirectionCount 3
typedef enum YGDirection {
YGDirectionInherit,
YGDirectionLTR,
YGDirectionRTL,
YGDirectionCount,
} YGDirection;
#define YGLogLevelCount 5
typedef enum YGLogLevel {
YGLogLevelError,
YGLogLevelWarn,
YGLogLevelInfo,
YGLogLevelDebug,
YGLogLevelVerbose,
YGLogLevelCount,
} YGLogLevel;
#define YGWrapCount 2
typedef enum YGWrap {
YGWrapNoWrap,
YGWrapWrap,
YGWrapCount,
} YGWrap;
#define YGOverflowCount 3
typedef enum YGOverflow {
YGOverflowVisible,
YGOverflowHidden,
YGOverflowScroll,
YGOverflowCount,
} YGOverflow;
#define YGExperimentalFeatureCount 2
typedef enum YGExperimentalFeature {
YGExperimentalFeatureRounding,
YGExperimentalFeatureWebFlexBasis,
YGExperimentalFeatureCount,
} YGExperimentalFeature;
#define YGAlignCount 5
typedef enum YGAlign {
YGAlignAuto,
YGAlignFlexStart,
YGAlignCenter,
YGAlignFlexEnd,
YGAlignStretch,
YGAlignCount,
} YGAlign;
YG_EXTERN_C_END

View File

@ -133,8 +133,6 @@ static int YGAndroidLog(YGLogLevel level, const char *format, va_list args) {
case YGLogLevelVerbose:
androidLevel = ANDROID_LOG_VERBOSE;
break;
case YGLogLevelCount:
break;
}
const int result = __android_log_vprint(androidLevel, "YG-layout", format, args);
return result;
@ -951,8 +949,6 @@ static void YGConstrainMaxSizeForMode(const float maxSize, YGMeasureMode *mode,
*size = maxSize;
}
break;
case YGMeasureModeCount:
break;
}
}
@ -1968,7 +1964,6 @@ static void YGNodelayoutImpl(const YGNodeRef node,
leadingMainDim = betweenMainDim / 2;
break;
case YGJustifyFlexStart:
case YGJustifyCount:
break;
}
@ -2171,7 +2166,6 @@ static void YGNodelayoutImpl(const YGNodeRef node,
break;
case YGAlignAuto:
case YGAlignFlexStart:
case YGAlignCount:
break;
}
@ -2231,7 +2225,6 @@ static void YGNodelayoutImpl(const YGNodeRef node,
break;
}
case YGAlignAuto:
case YGAlignCount:
break;
}
}