Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default case to
facebook::react::displayModeToInt()
(#48711)
Summary: In the `displayModeToInt()` function, there is no default case defined which is causing the following warning in React Native Windows when trying to build on the New Architecture: ``` ##[error]node_modules\react-native\ReactCommon\react\renderer\uimanager\primitives.h(163,1): Error C2220: the following warning is treated as an error D:\a\_work\1\s\node_modules\react-native\ReactCommon\react\renderer\uimanager\primitives.h(163,1): error C2220: the following warning is treated as an error [D:\a\_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj] ##[warning]node_modules\react-native\ReactCommon\react\renderer\uimanager\primitives.h(163,1): Warning C4715: 'facebook::react::displayModeToInt': not all control paths return a value D:\a\_work\1\s\node_modules\react-native\ReactCommon\react\renderer\uimanager\primitives.h(163,1): warning C4715: 'facebook::react::displayModeToInt': not all control paths return a value [D:\a\_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj] ``` Adding the default case removes the warning and resolves the issue. Not sure if using the -1 value in this case is appropriate. ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [General] [Fixed] - Add default case to `displayModeToInt()` function Pull Request resolved: #48711 Test Plan: Tested on React Native Windows New Arch application and was able to build successfully. Reviewed By: javache Differential Revision: D68265335 Pulled By: rshest fbshipit-source-id: 4724a4c7391b9bf651a122f5de227a0c5e0b6212
- Loading branch information