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 https://github.com/microsoft/react-native-windows/issues/13516

## Changelog:

[GENERAL] [FIXED] Fix "C4715 not all control paths return a value" warning in MSVC when building ReactCommon

Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
Jon Thysell
2024-08-12 10:00:24 -07:00
committed by Facebook GitHub Bot
parent d9d638c06b
commit c30e35fb44
2 changed files with 2 additions and 0 deletions
@@ -59,6 +59,7 @@ void EventQueueProcessor::flushEvents(
return hasContinuousEventStarted_ ? ReactEventPriority::Continuous
: ReactEventPriority::Default;
}
return ReactEventPriority::Default;
}();
} else {
if (event.category == RawEvent::Category::ContinuousEnd) {
@@ -48,6 +48,7 @@ inline const char* getTimerSourceName(TimerSource source) {
case TimerSource::RequestAnimationFrame:
return "requestAnimationFrame";
}
return "unknown";
}
} // namespace