Skip to content

Commit c499fc9

Browse files
coadofacebook-github-bot
authored andcommitted
Make RendererCore conversions Apple warning-clean
Summary: Add safe fallback cases to RendererCore enum conversions so public umbrella consumers compile with Apple's -Wswitch-default policy. Changelog: [Internal] Differential Revision: D120687424
1 parent 251edcd commit c499fc9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • packages/react-native/ReactCommon/react/renderer/core

packages/react-native/ReactCommon/react/renderer/core/conversions.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ inline std::string toString(const LayoutDirection &layoutDirection)
2222
return "ltr";
2323
case LayoutDirection::RightToLeft:
2424
return "rtl";
25+
default:
26+
return "undefined";
2527
}
2628
}
2729

@@ -34,6 +36,8 @@ inline int toInt(const LayoutDirection &layoutDirection)
3436
return 1;
3537
case LayoutDirection::RightToLeft:
3638
return 2;
39+
default:
40+
return 0;
3741
}
3842
}
3943

@@ -48,6 +52,8 @@ inline int toInt(const DisplayType &displayType)
4852
return 2;
4953
case DisplayType::Grid:
5054
return 3;
55+
default:
56+
return 0;
5157
}
5258
}
5359

@@ -62,6 +68,8 @@ inline std::string toString(const DisplayType &displayType)
6268
return "contents";
6369
case DisplayType::Grid:
6470
return "grid";
71+
default:
72+
return "none";
6573
}
6674
}
6775

0 commit comments

Comments
 (0)