diff --git a/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.h b/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.h index a42d43fdd7a..e6399abe46a 100644 --- a/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.h +++ b/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.h @@ -158,8 +158,9 @@ class PerformanceEntryReporter { return resourceTimingBuffer_; case PerformanceEntryType::_NEXT: throw std::logic_error("Cannot get buffer for _NEXT entry type"); + default: + throw std::logic_error("Unhandled PerformanceEntryType"); } - throw std::logic_error("Unhandled PerformanceEntryType"); } inline PerformanceEntryBuffer& getBufferRef(PerformanceEntryType entryType) { @@ -176,8 +177,9 @@ class PerformanceEntryReporter { return resourceTimingBuffer_; case PerformanceEntryType::_NEXT: throw std::logic_error("Cannot get buffer for _NEXT entry type"); + default: + throw std::logic_error("Unhandled PerformanceEntryType"); } - throw std::logic_error("Unhandled PerformanceEntryType"); } void traceMark( diff --git a/packages/react-native/ReactCommon/react/renderer/graphics/ValueUnit.h b/packages/react-native/ReactCommon/react/renderer/graphics/ValueUnit.h index 793f3bb2ef6..4777ef3f217 100644 --- a/packages/react-native/ReactCommon/react/renderer/graphics/ValueUnit.h +++ b/packages/react-native/ReactCommon/react/renderer/graphics/ValueUnit.h @@ -36,9 +36,9 @@ struct ValueUnit { case UnitType::Percent: return value * referenceLength * 0.01f; case UnitType::Undefined: + default: return 0.0f; } - return 0.0f; } constexpr operator bool() const { diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/SchedulerPriorityUtils.h b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/SchedulerPriorityUtils.h index d3b5ed8a6a1..68523e4a26b 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/SchedulerPriorityUtils.h +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/SchedulerPriorityUtils.h @@ -32,9 +32,10 @@ static inline SchedulerPriority fromRawValue(double value) { return SchedulerPriority::LowPriority; case 5: return SchedulerPriority::IdlePriority; + default: + react_native_assert(false && "Unsupported SchedulerPriority value"); + return SchedulerPriority::NormalPriority; } - react_native_assert(false && "Unsupported SchedulerPriority value"); - return SchedulerPriority::NormalPriority; } static inline HighResDuration timeoutForSchedulerPriority( @@ -50,9 +51,10 @@ static inline HighResDuration timeoutForSchedulerPriority( return HighResDuration::fromChrono(std::chrono::seconds(10)); case SchedulerPriority::IdlePriority: return HighResDuration::fromChrono(std::chrono::minutes(5)); + default: + react_native_assert(false && "Unsupported SchedulerPriority value"); + return HighResDuration::fromChrono(std::chrono::seconds(5)); } - react_native_assert(false && "Unsupported SchedulerPriority value"); - return HighResDuration::fromChrono(std::chrono::seconds(5)); } } // namespace facebook::react