Skip to content

Commit c30e35f

Browse files
jonthysellfacebook-github-bot
authored andcommitted
Fix "C4715 not all control paths return a value" warning in MSVC (#45827)
Summary: When integrating react-native into react-native-windows, we got the following build warning (which we treat as an error) when building ReactCommon: `C4715 not all control paths return a value` This PR adds defaults to the switches to make sure every path returns a value. See microsoft/react-native-windows#13516 ## Changelog: [GENERAL] [FIXED] Fix "C4715 not all control paths return a value" warning in MSVC when building ReactCommon Pull Request resolved: #45827 Test Plan: The switches are checking enums this code should never be hit unless new enum values are added. Reviewed By: robhogan Differential Revision: D61103286 Pulled By: NickGerleman fbshipit-source-id: 2028cb60e0b438b9ac17a828f5e1b690052a0bec
1 parent d9d638c commit c30e35f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/react-native/ReactCommon/react/renderer/core/EventQueueProcessor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ void EventQueueProcessor::flushEvents(
5959
return hasContinuousEventStarted_ ? ReactEventPriority::Continuous
6060
: ReactEventPriority::Default;
6161
}
62+
return ReactEventPriority::Default;
6263
}();
6364
} else {
6465
if (event.category == RawEvent::Category::ContinuousEnd) {

packages/react-native/ReactCommon/react/runtime/TimerManager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ inline const char* getTimerSourceName(TimerSource source) {
4848
case TimerSource::RequestAnimationFrame:
4949
return "requestAnimationFrame";
5050
}
51+
return "unknown";
5152
}
5253

5354
} // namespace

0 commit comments

Comments
 (0)