diff --git a/ReactCommon/react/renderer/.clang-tidy b/ReactCommon/react/renderer/.clang-tidy index 244e901f289..d709ad73853 100644 --- a/ReactCommon/react/renderer/.clang-tidy +++ b/ReactCommon/react/renderer/.clang-tidy @@ -4,6 +4,7 @@ Checks: '> clang-diagnostic-*, modernize-avoid-bind, modernize-avoid-c-arrays, +modernize-concat-nested-namespaces, modernize-deprecated-headers, modernize-deprecated-ios-base-aliases, modernize-loop-convert, @@ -182,5 +183,6 @@ clang-analyzer-unix.cstring.NullArg, clang-analyzer-valist.CopyToSelf, clang-analyzer-valist.Uninitialized, clang-analyzer-valist.Unterminated, +google-build-using-namespace, ' ... diff --git a/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp b/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp index 7c91b6b329c..d045f05f721 100644 --- a/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp +++ b/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp @@ -12,8 +12,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { void LayoutAnimationDriver::animationMutationsForFrame( SurfaceId surfaceId, @@ -107,5 +106,4 @@ void LayoutAnimationDriver::animationMutationsForFrame( &shouldFirstComeBeforeSecondMutation); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp index fe321a2f1e5..b4caab94d44 100644 --- a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +++ b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp @@ -30,8 +30,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { #ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING static std::string GetMutationInstructionString( @@ -1683,5 +1682,4 @@ void LayoutAnimationKeyFrameManager::simulateImagePropsMemoryAccess( } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp b/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp index da1aa6cdcb0..53fe2d986c4 100644 --- a/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +++ b/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp @@ -32,8 +32,7 @@ MockClock::time_point MockClock::time_ = {}; -namespace facebook { -namespace react { +namespace facebook::react { static void testShadowNodeTreeLifeCycleLayoutAnimations( uint_fast32_t seed, @@ -309,8 +308,7 @@ static void testShadowNodeTreeLifeCycleLayoutAnimations( SUCCEED(); } -} // namespace react -} // namespace facebook +} // namespace facebook::react using namespace facebook::react; diff --git a/ReactCommon/react/renderer/animations/utils.cpp b/ReactCommon/react/renderer/animations/utils.cpp index 36b2307e024..d4b638e3b14 100644 --- a/ReactCommon/react/renderer/animations/utils.cpp +++ b/ReactCommon/react/renderer/animations/utils.cpp @@ -8,8 +8,7 @@ #include "utils.h" #include -namespace facebook { -namespace react { +namespace facebook::react { std::pair calculateAnimationProgress( uint64_t now, @@ -67,5 +66,4 @@ std::pair calculateAnimationProgress( } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/attributedstring/AttributedString.cpp b/ReactCommon/react/renderer/attributedstring/AttributedString.cpp index 124d44c6be3..f4d4c4af987 100644 --- a/ReactCommon/react/renderer/attributedstring/AttributedString.cpp +++ b/ReactCommon/react/renderer/attributedstring/AttributedString.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { using Fragment = AttributedString::Fragment; using Fragments = AttributedString::Fragments; @@ -166,5 +165,4 @@ SharedDebugStringConvertibleList AttributedString::getDebugChildren() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/attributedstring/AttributedStringBox.cpp b/ReactCommon/react/renderer/attributedstring/AttributedStringBox.cpp index d644a5164d3..9f134d8e977 100644 --- a/ReactCommon/react/renderer/attributedstring/AttributedStringBox.cpp +++ b/ReactCommon/react/renderer/attributedstring/AttributedStringBox.cpp @@ -11,8 +11,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { AttributedStringBox::AttributedStringBox() : mode_(Mode::Value), @@ -86,5 +85,4 @@ bool operator!=( return !(lhs == rhs); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp b/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp index 773c8d6a38a..cec544ea1f7 100644 --- a/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +++ b/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp @@ -12,8 +12,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { bool ParagraphAttributes::operator==(const ParagraphAttributes &rhs) const { return std::tie( @@ -55,5 +54,4 @@ SharedDebugStringConvertibleList ParagraphAttributes::getDebugProps() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp b/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp index 3728f0c3612..c1c657c4fbe 100644 --- a/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +++ b/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp @@ -15,8 +15,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { void TextAttributes::apply(TextAttributes textAttributes) { // Color @@ -208,5 +207,4 @@ SharedDebugStringConvertibleList TextAttributes::getDebugProps() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/attributedstring/tests/AttributedStringBoxTest.cpp b/ReactCommon/react/renderer/attributedstring/tests/AttributedStringBoxTest.cpp index e8c0047f987..b9ddd65ef86 100644 --- a/ReactCommon/react/renderer/attributedstring/tests/AttributedStringBoxTest.cpp +++ b/ReactCommon/react/renderer/attributedstring/tests/AttributedStringBoxTest.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { TEST(AttributedStringBoxTest, testDefaultConstructor) { auto attributedStringBox = AttributedStringBox{}; @@ -101,5 +100,4 @@ TEST(AttributedStringBoxTest, testMoveAssignment) { } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp b/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp index 1019578e8c1..d435dc3213d 100644 --- a/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp +++ b/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { #ifdef ANDROID @@ -32,5 +31,4 @@ TEST(ParagraphAttributesTest, testToDynamic) { #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/componentregistry/ComponentDescriptorProviderRegistry.cpp b/ReactCommon/react/renderer/componentregistry/ComponentDescriptorProviderRegistry.cpp index 29e144cfc28..1869439cbc7 100644 --- a/ReactCommon/react/renderer/componentregistry/ComponentDescriptorProviderRegistry.cpp +++ b/ReactCommon/react/renderer/componentregistry/ComponentDescriptorProviderRegistry.cpp @@ -7,8 +7,7 @@ #include "ComponentDescriptorProviderRegistry.h" -namespace facebook { -namespace react { +namespace facebook::react { void ComponentDescriptorProviderRegistry::add( const ComponentDescriptorProvider &provider) const { @@ -81,5 +80,4 @@ ComponentDescriptorProviderRegistry::createComponentDescriptorRegistry( return registry; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp b/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp index 0a29a334664..23e0330a860 100644 --- a/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +++ b/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp @@ -16,8 +16,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { ComponentDescriptorRegistry::ComponentDescriptorRegistry( ComponentDescriptorParameters parameters, @@ -160,5 +159,4 @@ ComponentDescriptorRegistry::getFallbackComponentDescriptor() const { return _fallbackComponentDescriptor; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.cpp b/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.cpp index 1588f2e619d..f50a76ab01f 100644 --- a/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.cpp +++ b/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.cpp @@ -7,8 +7,7 @@ #include "componentNameByReactViewName.h" -namespace facebook { -namespace react { +namespace facebook::react { std::string componentNameByReactViewName(std::string viewName) { // We need this function only for the transition period; @@ -69,5 +68,4 @@ std::string componentNameByReactViewName(std::string viewName) { return viewName; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/componentregistry/native/NativeComponentRegistryBinding.cpp b/ReactCommon/react/renderer/componentregistry/native/NativeComponentRegistryBinding.cpp index 4b7e9c69917..d3e071d0f2f 100644 --- a/ReactCommon/react/renderer/componentregistry/native/NativeComponentRegistryBinding.cpp +++ b/ReactCommon/react/renderer/componentregistry/native/NativeComponentRegistryBinding.cpp @@ -12,8 +12,7 @@ using namespace facebook; -namespace facebook { -namespace react { +namespace facebook::react { /** * Public API to install the NativeComponentRegistryBinding. @@ -49,7 +48,7 @@ bool NativeComponentRegistryBinding::hasComponent(const std::string &name) { jsi::Value NativeComponentRegistryBinding::jsProxy( jsi::Runtime &runtime, - const jsi::Value &thisVal, + const jsi::Value & /*thisVal*/, const jsi::Value *args, size_t count) { if (count != 1) { @@ -64,5 +63,4 @@ jsi::Value NativeComponentRegistryBinding::jsProxy( return {result}; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/image/ImageEventEmitter.cpp b/ReactCommon/react/renderer/components/image/ImageEventEmitter.cpp index 731a592ad92..9ebf3a3d23d 100644 --- a/ReactCommon/react/renderer/components/image/ImageEventEmitter.cpp +++ b/ReactCommon/react/renderer/components/image/ImageEventEmitter.cpp @@ -7,8 +7,7 @@ #include "ImageEventEmitter.h" -namespace facebook { -namespace react { +namespace facebook::react { void ImageEventEmitter::onLoadStart() const { dispatchEvent("loadStart"); @@ -38,5 +37,4 @@ void ImageEventEmitter::onPartialLoad() const { dispatchEvent("partialLoad"); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/image/ImageProps.cpp b/ReactCommon/react/renderer/components/image/ImageProps.cpp index ac5b5245277..7feac6300f8 100644 --- a/ReactCommon/react/renderer/components/image/ImageProps.cpp +++ b/ReactCommon/react/renderer/components/image/ImageProps.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { ImageProps::ImageProps( const PropsParserContext &context, @@ -99,5 +98,4 @@ void ImageProps::setProp( } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/image/ImageShadowNode.cpp b/ReactCommon/react/renderer/components/image/ImageShadowNode.cpp index 5edd7966c89..a655f9c3ea5 100644 --- a/ReactCommon/react/renderer/components/image/ImageShadowNode.cpp +++ b/ReactCommon/react/renderer/components/image/ImageShadowNode.cpp @@ -12,8 +12,7 @@ #include #include "ImageState.h" -namespace facebook { -namespace react { +namespace facebook::react { const char ImageComponentName[] = "Image"; @@ -94,5 +93,4 @@ void ImageShadowNode::layout(LayoutContext layoutContext) { ConcreteViewShadowNode::layout(layoutContext); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/image/ImageState.cpp b/ReactCommon/react/renderer/components/image/ImageState.cpp index 17b8261d71f..1de16951a9c 100644 --- a/ReactCommon/react/renderer/components/image/ImageState.cpp +++ b/ReactCommon/react/renderer/components/image/ImageState.cpp @@ -7,8 +7,7 @@ #include "ImageState.h" -namespace facebook { -namespace react { +namespace facebook::react { ImageSource ImageState::getImageSource() const { return imageSource_; @@ -22,5 +21,4 @@ Float ImageState::getBlurRadius() const { return blurRadius_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/modal/ModalHostViewShadowNode.cpp b/ReactCommon/react/renderer/components/modal/ModalHostViewShadowNode.cpp index bdf59f88ca1..3598549813a 100644 --- a/ReactCommon/react/renderer/components/modal/ModalHostViewShadowNode.cpp +++ b/ReactCommon/react/renderer/components/modal/ModalHostViewShadowNode.cpp @@ -10,10 +10,8 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { extern const char ModalHostViewComponentName[] = "ModalHostView"; -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/modal/ModalHostViewState.cpp b/ReactCommon/react/renderer/components/modal/ModalHostViewState.cpp index 1105a3883eb..9feec1d3856 100644 --- a/ReactCommon/react/renderer/components/modal/ModalHostViewState.cpp +++ b/ReactCommon/react/renderer/components/modal/ModalHostViewState.cpp @@ -7,8 +7,7 @@ #include "ModalHostViewState.h" -namespace facebook { -namespace react { +namespace facebook::react { #ifdef ANDROID folly::dynamic ModalHostViewState::getDynamic() const { @@ -17,5 +16,4 @@ folly::dynamic ModalHostViewState::getDynamic() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.cpp b/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.cpp index 71ce1f60798..ea69e87e644 100644 --- a/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.cpp +++ b/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.cpp @@ -13,8 +13,7 @@ using namespace facebook::jni; -namespace facebook { -namespace react { +namespace facebook::react { Size AndroidProgressBarMeasurementsManager::measure( SurfaceId surfaceId, @@ -71,5 +70,4 @@ Size AndroidProgressBarMeasurementsManager::measure( return measurement; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.cpp b/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.cpp index 85d7b8da139..34af9074884 100644 --- a/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.cpp +++ b/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { extern const char AndroidProgressBarComponentName[] = "AndroidProgressBar"; @@ -31,5 +30,4 @@ Size AndroidProgressBarShadowNode::measureContent( getSurfaceId(), getConcreteProps(), layoutConstraints); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/root/RootProps.cpp b/ReactCommon/react/renderer/components/root/RootProps.cpp index df7e709b9ec..777e7998bd0 100644 --- a/ReactCommon/react/renderer/components/root/RootProps.cpp +++ b/ReactCommon/react/renderer/components/root/RootProps.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { // Note that a default/empty context may be passed here from RootShadowNode. // If that's a problem and the context is necesary here, refactor RootShadowNode @@ -34,5 +33,4 @@ RootProps::RootProps( layoutConstraints(layoutConstraints), layoutContext(layoutContext){}; -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/root/RootShadowNode.cpp b/ReactCommon/react/renderer/components/root/RootShadowNode.cpp index 20380d42288..ed1165861f9 100644 --- a/ReactCommon/react/renderer/components/root/RootShadowNode.cpp +++ b/ReactCommon/react/renderer/components/root/RootShadowNode.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { const char RootComponentName[] = "RootView"; @@ -57,5 +56,4 @@ RootShadowNode::Unshared RootShadowNode::clone( return newRootShadowNode; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/scrollview/ScrollViewEventEmitter.cpp b/ReactCommon/react/renderer/components/scrollview/ScrollViewEventEmitter.cpp index c009fa42775..3aaeb4c6f13 100644 --- a/ReactCommon/react/renderer/components/scrollview/ScrollViewEventEmitter.cpp +++ b/ReactCommon/react/renderer/components/scrollview/ScrollViewEventEmitter.cpp @@ -7,8 +7,7 @@ #include "ScrollViewEventEmitter.h" -namespace facebook { -namespace react { +namespace facebook::react { static jsi::Value scrollViewMetricsPayload( jsi::Runtime &runtime, @@ -97,5 +96,4 @@ void ScrollViewEventEmitter::dispatchScrollViewEvent( priority); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp b/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp index 1628b80fc5e..4eff278fdfc 100644 --- a/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp +++ b/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp @@ -14,8 +14,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { ScrollViewProps::ScrollViewProps( const PropsParserContext &context, @@ -483,5 +482,4 @@ SharedDebugStringConvertibleList ScrollViewProps::getDebugProps() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp b/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp index 41ddcdb4175..f4d7a883b18 100644 --- a/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp +++ b/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { const char ScrollViewComponentName[] = "ScrollView"; @@ -63,5 +62,4 @@ Point ScrollViewShadowNode::getContentOriginOffset() const { return {-contentOffset.x, -contentOffset.y + stateData.scrollAwayPaddingTop}; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/scrollview/ScrollViewState.cpp b/ReactCommon/react/renderer/components/scrollview/ScrollViewState.cpp index 4bbfaa4a3e5..ac184051d68 100644 --- a/ReactCommon/react/renderer/components/scrollview/ScrollViewState.cpp +++ b/ReactCommon/react/renderer/components/scrollview/ScrollViewState.cpp @@ -7,12 +7,10 @@ #include "ScrollViewState.h" -namespace facebook { -namespace react { +namespace facebook::react { Size ScrollViewState::getContentSize() const { return contentBoundingRect.size; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/slider/SliderShadowNode.cpp b/ReactCommon/react/renderer/components/slider/SliderShadowNode.cpp index b4d24e69feb..bb70718bf54 100644 --- a/ReactCommon/react/renderer/components/slider/SliderShadowNode.cpp +++ b/ReactCommon/react/renderer/components/slider/SliderShadowNode.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { extern const char SliderComponentName[] = "Slider"; @@ -98,5 +97,4 @@ void SliderShadowNode::layout(LayoutContext layoutContext) { ConcreteViewShadowNode::layout(layoutContext); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/slider/SliderState.cpp b/ReactCommon/react/renderer/components/slider/SliderState.cpp index c27e7139cd0..adce049789d 100644 --- a/ReactCommon/react/renderer/components/slider/SliderState.cpp +++ b/ReactCommon/react/renderer/components/slider/SliderState.cpp @@ -7,8 +7,7 @@ #include "SliderState.h" -namespace facebook { -namespace react { +namespace facebook::react { ImageSource SliderState::getTrackImageSource() const { return trackImageSource_; @@ -42,5 +41,4 @@ ImageRequest const &SliderState::getThumbImageRequest() const { return *thumbImageRequest_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/slider/platform/android/react/renderer/components/slider/SliderMeasurementsManager.cpp b/ReactCommon/react/renderer/components/slider/platform/android/react/renderer/components/slider/SliderMeasurementsManager.cpp index 07119bd68a3..2f161fec5c0 100644 --- a/ReactCommon/react/renderer/components/slider/platform/android/react/renderer/components/slider/SliderMeasurementsManager.cpp +++ b/ReactCommon/react/renderer/components/slider/platform/android/react/renderer/components/slider/SliderMeasurementsManager.cpp @@ -13,8 +13,7 @@ using namespace facebook::jni; -namespace facebook { -namespace react { +namespace facebook::react { Size SliderMeasurementsManager::measure( SurfaceId surfaceId, @@ -70,5 +69,4 @@ Size SliderMeasurementsManager::measure( return measurement; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchMeasurementsManager.cpp b/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchMeasurementsManager.cpp index 7a683eecc03..5f9033666bf 100644 --- a/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchMeasurementsManager.cpp +++ b/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchMeasurementsManager.cpp @@ -13,8 +13,7 @@ using namespace facebook::jni; -namespace facebook { -namespace react { +namespace facebook::react { Size AndroidSwitchMeasurementsManager::measure( SurfaceId surfaceId, @@ -64,5 +63,4 @@ Size AndroidSwitchMeasurementsManager::measure( return measurement; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchShadowNode.cpp b/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchShadowNode.cpp index af2d201d0f3..63cfc616a4a 100644 --- a/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchShadowNode.cpp +++ b/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchShadowNode.cpp @@ -7,8 +7,7 @@ #include "AndroidSwitchShadowNode.h" -namespace facebook { -namespace react { +namespace facebook::react { extern const char AndroidSwitchComponentName[] = "AndroidSwitch"; @@ -27,5 +26,4 @@ Size AndroidSwitchShadowNode::measureContent( return measurementsManager_->measure(getSurfaceId(), layoutConstraints); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/text/BaseTextProps.cpp b/ReactCommon/react/renderer/components/text/BaseTextProps.cpp index 5b4294c22ee..0b4b5f88aa9 100644 --- a/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +++ b/ReactCommon/react/renderer/components/text/BaseTextProps.cpp @@ -13,8 +13,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { static TextAttributes convertRawProp( PropsParserContext const &context, @@ -291,5 +290,4 @@ SharedDebugStringConvertibleList BaseTextProps::getDebugProps() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/text/BaseTextShadowNode.cpp b/ReactCommon/react/renderer/components/text/BaseTextShadowNode.cpp index 88cf821aac0..b0758dcd6e8 100644 --- a/ReactCommon/react/renderer/components/text/BaseTextShadowNode.cpp +++ b/ReactCommon/react/renderer/components/text/BaseTextShadowNode.cpp @@ -13,8 +13,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { inline ShadowView shadowViewFromShadowNode(ShadowNode const &shadowNode) { auto shadowView = ShadowView{shadowNode}; @@ -73,5 +72,4 @@ void BaseTextShadowNode::buildAttributedString( } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/text/ParagraphEventEmitter.cpp b/ReactCommon/react/renderer/components/text/ParagraphEventEmitter.cpp index 3ea12516759..3ae6e664598 100644 --- a/ReactCommon/react/renderer/components/text/ParagraphEventEmitter.cpp +++ b/ReactCommon/react/renderer/components/text/ParagraphEventEmitter.cpp @@ -7,8 +7,7 @@ #include "ParagraphEventEmitter.h" -namespace facebook { -namespace react { +namespace facebook::react { static jsi::Value linesMeasurementsPayload( jsi::Runtime &runtime, @@ -51,5 +50,4 @@ void ParagraphEventEmitter::onTextLayout( }); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/text/ParagraphProps.cpp b/ReactCommon/react/renderer/components/text/ParagraphProps.cpp index 3b018e94fa3..c666e5e2d86 100644 --- a/ReactCommon/react/renderer/components/text/ParagraphProps.cpp +++ b/ReactCommon/react/renderer/components/text/ParagraphProps.cpp @@ -15,8 +15,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { ParagraphProps::ParagraphProps( const PropsParserContext &context, @@ -143,5 +142,4 @@ SharedDebugStringConvertibleList ParagraphProps::getDebugProps() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp b/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp index 7c42ae7672e..48b3a2128f7 100644 --- a/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp +++ b/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp @@ -18,8 +18,7 @@ #include "ParagraphState.h" -namespace facebook { -namespace react { +namespace facebook::react { using Content = ParagraphShadowNode::Content; @@ -70,7 +69,7 @@ Content ParagraphShadowNode::getContentWithMeasuredAttachments( auto laytableShadowNode = traitCast(attachment.shadowNode); - if (!laytableShadowNode) { + if (laytableShadowNode == nullptr) { continue; } @@ -189,7 +188,8 @@ void ParagraphShadowNode::layout(LayoutContext layoutContext) { for (size_t i = 0; i < content.attachments.size(); i++) { auto &attachment = content.attachments.at(i); - if (!traitCast(attachment.shadowNode)) { + if (traitCast(attachment.shadowNode) == + nullptr) { // Not a layoutable `ShadowNode`, no need to lay it out. continue; } @@ -237,5 +237,4 @@ void ParagraphShadowNode::layout(LayoutContext layoutContext) { } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/text/ParagraphState.cpp b/ReactCommon/react/renderer/components/text/ParagraphState.cpp index aa5ca1a8b39..559a1796d81 100644 --- a/ReactCommon/react/renderer/components/text/ParagraphState.cpp +++ b/ReactCommon/react/renderer/components/text/ParagraphState.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { #ifdef ANDROID folly::dynamic ParagraphState::getDynamic() const { @@ -23,5 +22,4 @@ MapBuffer ParagraphState::getMapBuffer() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/text/RawTextProps.cpp b/ReactCommon/react/renderer/components/text/RawTextProps.cpp index 40e49859d29..92ddbf1e10b 100644 --- a/ReactCommon/react/renderer/components/text/RawTextProps.cpp +++ b/ReactCommon/react/renderer/components/text/RawTextProps.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { RawTextProps::RawTextProps( const PropsParserContext &context, @@ -29,5 +28,4 @@ SharedDebugStringConvertibleList RawTextProps::getDebugProps() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/text/RawTextShadowNode.cpp b/ReactCommon/react/renderer/components/text/RawTextShadowNode.cpp index 55ee95cc2a8..ed138a8f847 100644 --- a/ReactCommon/react/renderer/components/text/RawTextShadowNode.cpp +++ b/ReactCommon/react/renderer/components/text/RawTextShadowNode.cpp @@ -7,10 +7,8 @@ #include "RawTextShadowNode.h" -namespace facebook { -namespace react { +namespace facebook::react { extern const char RawTextComponentName[] = "RawText"; -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/text/TextProps.cpp b/ReactCommon/react/renderer/components/text/TextProps.cpp index a8b83aa0b1b..f88e75a029e 100644 --- a/ReactCommon/react/renderer/components/text/TextProps.cpp +++ b/ReactCommon/react/renderer/components/text/TextProps.cpp @@ -7,8 +7,7 @@ #include "TextProps.h" -namespace facebook { -namespace react { +namespace facebook::react { TextProps::TextProps( const PropsParserContext &context, @@ -34,5 +33,4 @@ SharedDebugStringConvertibleList TextProps::getDebugProps() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/text/TextShadowNode.cpp b/ReactCommon/react/renderer/components/text/TextShadowNode.cpp index 561ddcb9475..f70fcd55ffb 100644 --- a/ReactCommon/react/renderer/components/text/TextShadowNode.cpp +++ b/ReactCommon/react/renderer/components/text/TextShadowNode.cpp @@ -7,10 +7,8 @@ #include "TextShadowNode.h" -namespace facebook { -namespace react { +namespace facebook::react { extern const char TextComponentName[] = "Text"; -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp b/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp index c6be890f261..c8eaf160ba1 100644 --- a/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp +++ b/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp @@ -11,8 +11,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { static bool hasValue( const RawProps &rawProps, @@ -492,5 +491,4 @@ SharedDebugStringConvertibleList AndroidTextInputProps::getDebugProps() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.cpp b/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.cpp index 2c98a0e164e..2c9a4a58186 100644 --- a/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.cpp +++ b/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.cpp @@ -21,8 +21,7 @@ using namespace facebook::jni; -namespace facebook { -namespace react { +namespace facebook::react { extern const char AndroidTextInputComponentName[] = "AndroidTextInput"; @@ -207,5 +206,4 @@ void AndroidTextInputShadowNode::layout(LayoutContext layoutContext) { ConcreteViewShadowNode::layout(layoutContext); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.cpp b/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.cpp index c57e8b7970f..25363ae5c2e 100644 --- a/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.cpp +++ b/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.cpp @@ -17,8 +17,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { AndroidTextInputState::AndroidTextInputState( int64_t mostRecentEventCount, @@ -113,5 +112,4 @@ MapBuffer AndroidTextInputState::getMapBuffer() const { #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputEventEmitter.cpp b/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputEventEmitter.cpp index 66e3c6e41f9..494ab15d396 100644 --- a/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputEventEmitter.cpp +++ b/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputEventEmitter.cpp @@ -7,8 +7,7 @@ #include "TextInputEventEmitter.h" -namespace facebook { -namespace react { +namespace facebook::react { static jsi::Value textInputMetricsPayload( jsi::Runtime &runtime, @@ -138,5 +137,4 @@ void TextInputEventEmitter::dispatchTextInputEvent( priority); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp b/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp index 96d4d0c1849..dad0ea7f8ad 100644 --- a/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp +++ b/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp @@ -12,8 +12,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { TextInputProps::TextInputProps( const PropsParserContext &context, @@ -142,5 +141,4 @@ ParagraphAttributes TextInputProps::getEffectiveParagraphAttributes() const { return result; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputShadowNode.cpp b/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputShadowNode.cpp index 8910d21fb43..b35b802f60f 100644 --- a/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputShadowNode.cpp +++ b/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputShadowNode.cpp @@ -14,8 +14,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { extern char const TextInputComponentName[] = "TextInput"; @@ -120,5 +119,4 @@ void TextInputShadowNode::layout(LayoutContext layoutContext) { ConcreteViewShadowNode::layout(layoutContext); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputState.cpp b/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputState.cpp index bd3e8c4f4bc..4c16ed793c6 100644 --- a/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputState.cpp +++ b/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputState.cpp @@ -7,8 +7,7 @@ #include "TextInputState.h" -namespace facebook { -namespace react { +namespace facebook::react { #ifdef ANDROID TextInputState::TextInputState( @@ -30,5 +29,4 @@ MapBuffer TextInputState::getMapBuffer() const { }; #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp b/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp index e58621a6c51..5fd1a4ba9cb 100644 --- a/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp +++ b/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp @@ -7,8 +7,7 @@ #include "UnimplementedViewComponentDescriptor.h" -namespace facebook { -namespace react { +namespace facebook::react { ComponentHandle UnimplementedViewComponentDescriptor::getComponentHandle() const { @@ -40,5 +39,4 @@ Props::Shared UnimplementedViewComponentDescriptor::cloneProps( return unimplementedViewProps; }; -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.cpp b/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.cpp index 73aff6fd4e9..10686f9c639 100644 --- a/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.cpp +++ b/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.cpp @@ -7,8 +7,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { void UnimplementedViewProps::setComponentName(ComponentName componentName) { componentName_ = componentName; @@ -18,5 +17,4 @@ ComponentName UnimplementedViewProps::getComponentName() const { return componentName_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewShadowNode.cpp b/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewShadowNode.cpp index 30cadf3a3f3..a30a006cd41 100644 --- a/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewShadowNode.cpp +++ b/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewShadowNode.cpp @@ -7,10 +7,8 @@ #include "UnimplementedViewShadowNode.h" -namespace facebook { -namespace react { +namespace facebook::react { const char UnimplementedViewComponentName[] = "UnimplementedView"; -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp b/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp index 64190d56400..8ee8640c189 100644 --- a/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +++ b/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp @@ -13,8 +13,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { AccessibilityProps::AccessibilityProps( const PropsParserContext &context, @@ -254,5 +253,4 @@ SharedDebugStringConvertibleList AccessibilityProps::getDebugProps() const { } #endif // RN_DEBUG_STRING_CONVERTIBLE -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/view/PointerEvent.cpp b/ReactCommon/react/renderer/components/view/PointerEvent.cpp index 0bf0a7302de..09fa5c9b0a6 100644 --- a/ReactCommon/react/renderer/components/view/PointerEvent.cpp +++ b/ReactCommon/react/renderer/components/view/PointerEvent.cpp @@ -7,8 +7,7 @@ #include "PointerEvent.h" -namespace facebook { -namespace react { +namespace facebook::react { #if RN_DEBUG_STRING_CONVERTIBLE @@ -46,5 +45,4 @@ std::vector getDebugProps( #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/view/Touch.cpp b/ReactCommon/react/renderer/components/view/Touch.cpp index 116b7deefec..ee3fc314e71 100644 --- a/ReactCommon/react/renderer/components/view/Touch.cpp +++ b/ReactCommon/react/renderer/components/view/Touch.cpp @@ -7,8 +7,7 @@ #include "Touch.h" -namespace facebook { -namespace react { +namespace facebook::react { #if RN_DEBUG_STRING_CONVERTIBLE @@ -32,5 +31,4 @@ std::vector getDebugProps( #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/view/TouchEvent.cpp b/ReactCommon/react/renderer/components/view/TouchEvent.cpp index 3939345653c..cc5efbf309f 100644 --- a/ReactCommon/react/renderer/components/view/TouchEvent.cpp +++ b/ReactCommon/react/renderer/components/view/TouchEvent.cpp @@ -7,8 +7,7 @@ #include "TouchEvent.h" -namespace facebook { -namespace react { +namespace facebook::react { #if RN_DEBUG_STRING_CONVERTIBLE @@ -29,5 +28,4 @@ std::vector getDebugProps( #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp b/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp index 5d78c633153..475a8a61241 100644 --- a/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +++ b/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp @@ -7,8 +7,7 @@ #include "TouchEventEmitter.h" -namespace facebook { -namespace react { +namespace facebook::react { #pragma mark - Touches @@ -216,5 +215,4 @@ void TouchEventEmitter::onPointerOut(const PointerEvent &event) const { RawEvent::Category::ContinuousStart); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/view/ViewEventEmitter.cpp b/ReactCommon/react/renderer/components/view/ViewEventEmitter.cpp index 4e98daa58fe..d80e5a0d070 100644 --- a/ReactCommon/react/renderer/components/view/ViewEventEmitter.cpp +++ b/ReactCommon/react/renderer/components/view/ViewEventEmitter.cpp @@ -7,8 +7,7 @@ #include "ViewEventEmitter.h" -namespace facebook { -namespace react { +namespace facebook::react { #pragma mark - Accessibility @@ -115,5 +114,4 @@ void ViewEventEmitter::onLayout(const LayoutMetrics &layoutMetrics) const { EventPriority::AsynchronousUnbatched); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/view/ViewProps.cpp b/ReactCommon/react/renderer/components/view/ViewProps.cpp index bda1b2580b8..d4f024bcc77 100644 --- a/ReactCommon/react/renderer/components/view/ViewProps.cpp +++ b/ReactCommon/react/renderer/components/view/ViewProps.cpp @@ -16,8 +16,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { ViewProps::ViewProps( const PropsParserContext &context, @@ -469,5 +468,4 @@ SharedDebugStringConvertibleList ViewProps::getDebugProps() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp b/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp index 2e2a0da1b2b..1edfb71a5e7 100644 --- a/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +++ b/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { char const ViewComponentName[] = "View"; @@ -92,5 +91,4 @@ void ViewShadowNode::initialize() noexcept { #endif } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp b/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp index 29ef3edf2e8..a034734a213 100644 --- a/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp @@ -20,12 +20,11 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { static int FabricDefaultYogaLog( - const YGConfigRef, - const YGNodeRef, + const YGConfigRef /*unused*/, + const YGNodeRef /*unused*/, YGLogLevel level, const char *format, va_list args) { @@ -250,7 +249,7 @@ void YogaLayoutableShadowNode::appendChild( // (e.g. RCTRawText). This used to throw an error, but we are ignoring it // because we want core library components to be fault-tolerant and degrade // gracefully. A soft error will be emitted from JavaScript. - if (traitCast(childNode.get())) { + if (traitCast(childNode.get()) != nullptr) { // Appending the Yoga node. appendYogaChild(*childNode); @@ -507,7 +506,7 @@ void YogaLayoutableShadowNode::layout(LayoutContext layoutContext) { // `newLayoutMetrics.frame` with `childNode.getLayoutMetrics().frame` to // detect if layout has not changed is not advised, please refer to // D22999891 for details. - if (layoutContext.affectedNodes) { + if (layoutContext.affectedNodes != nullptr) { layoutContext.affectedNodes->push_back(&childNode); } @@ -646,7 +645,8 @@ void YogaLayoutableShadowNode::swapLeftAndRightInTree( for (auto &child : shadowNode.getChildren()) { auto const yogaLayoutableChild = traitCast(child.get()); - if (yogaLayoutableChild && !yogaLayoutableChild->doesOwn(shadowNode)) { + if ((yogaLayoutableChild != nullptr) && + !yogaLayoutableChild->doesOwn(shadowNode)) { swapLeftAndRightInTree(*yogaLayoutableChild); } } @@ -822,5 +822,4 @@ void YogaLayoutableShadowNode::ensureYogaChildrenAlighment() const { #endif } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp b/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp index 5fa32c9edb9..85f6c5f405d 100644 --- a/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +++ b/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp @@ -17,8 +17,7 @@ #include "conversions.h" -namespace facebook { -namespace react { +namespace facebook::react { YogaStylableProps::YogaStylableProps( const PropsParserContext &context, @@ -194,5 +193,4 @@ SharedDebugStringConvertibleList YogaStylableProps::getDebugProps() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp b/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp index 691fb5b6bec..5891c276479 100644 --- a/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp +++ b/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp @@ -14,8 +14,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { // Note: the (x, y) origin is always relative to the parent node. You may use // P482342650 to re-create this test case in playground. @@ -359,5 +358,4 @@ TEST_F(LayoutTest, overflowInsetTransformScaleTest) { EXPECT_EQ(layoutMetricsABC.overflowInset.bottom, 0); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp b/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp index 67c7eda979a..f4f1c590c32 100644 --- a/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp +++ b/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp @@ -20,8 +20,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { class YogaDirtyFlagTest : public ::testing::Test { protected: @@ -227,5 +226,4 @@ TEST_F(YogaDirtyFlagTest, updatingStateForScrollViewMistNotDirtyYogaNode) { static_cast(*newRootShadowNode).layoutIfNeeded()); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/BatchedEventQueue.cpp b/ReactCommon/react/renderer/core/BatchedEventQueue.cpp index 87a59051a89..0a9467eb554 100644 --- a/ReactCommon/react/renderer/core/BatchedEventQueue.cpp +++ b/ReactCommon/react/renderer/core/BatchedEventQueue.cpp @@ -7,8 +7,7 @@ #include "BatchedEventQueue.h" -namespace facebook { -namespace react { +namespace facebook::react { BatchedEventQueue::BatchedEventQueue( EventQueueProcessor eventProcessor, @@ -18,5 +17,4 @@ BatchedEventQueue::BatchedEventQueue( void BatchedEventQueue::onEnqueue() const { eventBeat_->request(); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/ComponentDescriptor.cpp b/ReactCommon/react/renderer/core/ComponentDescriptor.cpp index 9afdf878860..77529f42fda 100644 --- a/ReactCommon/react/renderer/core/ComponentDescriptor.cpp +++ b/ReactCommon/react/renderer/core/ComponentDescriptor.cpp @@ -7,8 +7,7 @@ #include "ComponentDescriptor.h" -namespace facebook { -namespace react { +namespace facebook::react { ComponentDescriptor::ComponentDescriptor( ComponentDescriptorParameters const ¶meters) @@ -21,5 +20,4 @@ ContextContainer::Shared const &ComponentDescriptor::getContextContainer() return contextContainer_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/DynamicPropsUtilities.cpp b/ReactCommon/react/renderer/core/DynamicPropsUtilities.cpp index f4e03a822d5..116a0a418f0 100644 --- a/ReactCommon/react/renderer/core/DynamicPropsUtilities.cpp +++ b/ReactCommon/react/renderer/core/DynamicPropsUtilities.cpp @@ -7,8 +7,7 @@ #include "DynamicPropsUtilities.h" -namespace facebook { -namespace react { +namespace facebook::react { folly::dynamic mergeDynamicProps( folly::dynamic const &source, folly::dynamic const &patch) { @@ -31,5 +30,4 @@ folly::dynamic mergeDynamicProps( return result; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/EventBeat.cpp b/ReactCommon/react/renderer/core/EventBeat.cpp index 6675fb0e43a..f55120661b4 100644 --- a/ReactCommon/react/renderer/core/EventBeat.cpp +++ b/ReactCommon/react/renderer/core/EventBeat.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { EventBeat::EventBeat(SharedOwnerBox ownerBox) : ownerBox_(std::move(ownerBox)) {} @@ -39,5 +38,4 @@ void EventBeat::setBeatCallback(BeatCallback beatCallback) { beatCallback_ = std::move(beatCallback); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/EventDispatcher.cpp b/ReactCommon/react/renderer/core/EventDispatcher.cpp index 34f68f4bf3b..5152c263eb3 100644 --- a/ReactCommon/react/renderer/core/EventDispatcher.cpp +++ b/ReactCommon/react/renderer/core/EventDispatcher.cpp @@ -13,8 +13,7 @@ #include "RawEvent.h" #include "UnbatchedEventQueue.h" -namespace facebook { -namespace react { +namespace facebook::react { EventDispatcher::EventDispatcher( EventQueueProcessor const &eventProcessor, @@ -83,5 +82,4 @@ void EventDispatcher::removeListener( eventListeners_.removeListener(listener); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/EventEmitter.cpp b/ReactCommon/react/renderer/core/EventEmitter.cpp index cca4a0eca17..282b25f8d67 100644 --- a/ReactCommon/react/renderer/core/EventEmitter.cpp +++ b/ReactCommon/react/renderer/core/EventEmitter.cpp @@ -14,8 +14,7 @@ #include "RawEvent.h" -namespace facebook { -namespace react { +namespace facebook::react { // TODO(T29874519): Get rid of "top" prefix once and for all. /* @@ -132,5 +131,4 @@ void EventEmitter::setEnabled(bool enabled) const { } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/EventQueue.cpp b/ReactCommon/react/renderer/core/EventQueue.cpp index ef111d4b56d..41df3b330bf 100644 --- a/ReactCommon/react/renderer/core/EventQueue.cpp +++ b/ReactCommon/react/renderer/core/EventQueue.cpp @@ -10,8 +10,7 @@ #include "EventEmitter.h" #include "ShadowNodeFamily.h" -namespace facebook { -namespace react { +namespace facebook::react { EventQueue::EventQueue( EventQueueProcessor eventProcessor, @@ -87,7 +86,7 @@ void EventQueue::flushEvents(jsi::Runtime &runtime) const { { std::lock_guard lock(queueMutex_); - if (eventQueue_.size() == 0) { + if (eventQueue_.empty()) { return; } @@ -115,5 +114,4 @@ void EventQueue::flushStateUpdates() const { eventProcessor_.flushStateUpdates(std::move(stateUpdateQueue)); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/EventQueueProcessor.cpp b/ReactCommon/react/renderer/core/EventQueueProcessor.cpp index 59ea4506a8f..1b92d530b96 100644 --- a/ReactCommon/react/renderer/core/EventQueueProcessor.cpp +++ b/ReactCommon/react/renderer/core/EventQueueProcessor.cpp @@ -10,8 +10,7 @@ #include "EventEmitter.h" #include "ShadowNodeFamily.h" -namespace facebook { -namespace react { +namespace facebook::react { EventQueueProcessor::EventQueueProcessor( EventPipe eventPipe, @@ -78,5 +77,4 @@ void EventQueueProcessor::flushStateUpdates( } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/EventTarget.cpp b/ReactCommon/react/renderer/core/EventTarget.cpp index 02ceab2c133..38e78e500f8 100644 --- a/ReactCommon/react/renderer/core/EventTarget.cpp +++ b/ReactCommon/react/renderer/core/EventTarget.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { using Tag = EventTarget::Tag; @@ -66,5 +65,4 @@ Tag EventTarget::getTag() const { return tag_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/LayoutConstraints.cpp b/ReactCommon/react/renderer/core/LayoutConstraints.cpp index db92606051d..c64cac4d0ca 100644 --- a/ReactCommon/react/renderer/core/LayoutConstraints.cpp +++ b/ReactCommon/react/renderer/core/LayoutConstraints.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { Size LayoutConstraints::clamp(const Size &size) const { return { @@ -18,5 +17,4 @@ Size LayoutConstraints::clamp(const Size &size) const { std::max(minimumSize.height, std::min(maximumSize.height, size.height))}; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/LayoutMetrics.cpp b/ReactCommon/react/renderer/core/LayoutMetrics.cpp index 6c428988658..0e0e75e3b1f 100644 --- a/ReactCommon/react/renderer/core/LayoutMetrics.cpp +++ b/ReactCommon/react/renderer/core/LayoutMetrics.cpp @@ -10,8 +10,7 @@ #include "LayoutMetrics.h" -namespace facebook { -namespace react { +namespace facebook::react { #if RN_DEBUG_STRING_CONVERTIBLE @@ -61,5 +60,4 @@ std::vector getDebugProps( #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp b/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp index abb4dad6b5d..0f785759e9b 100644 --- a/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp +++ b/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp @@ -14,8 +14,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { template using LayoutableSmallVector = butter::small_vector; @@ -103,7 +102,7 @@ LayoutMetrics LayoutableShadowNode::computeRelativeLayoutMetrics( auto ancestors = descendantNodeFamily.getAncestors(ancestorNode); - if (ancestors.size() == 0) { + if (ancestors.empty()) { // Specified nodes do not form an ancestor-descender relationship // in the same tree. Aborting. return EmptyLayoutMetrics; @@ -146,7 +145,7 @@ LayoutMetrics LayoutableShadowNode::computeRelativeLayoutMetrics( auto descendantLayoutableNode = traitCast(descendantNode); - if (!descendantLayoutableNode) { + if (descendantLayoutableNode == nullptr) { return EmptyLayoutMetrics; } @@ -177,7 +176,7 @@ LayoutMetrics LayoutableShadowNode::computeRelativeLayoutMetrics( auto currentShadowNode = traitCast(shadowNodeList.at(i)); - if (!currentShadowNode) { + if (currentShadowNode == nullptr) { return EmptyLayoutMetrics; } @@ -245,7 +244,7 @@ LayoutableShadowNode::getLayoutableChildNodes() const { for (const auto &childShadowNode : getChildren()) { auto layoutableChildShadowNode = traitCast(childShadowNode.get()); - if (layoutableChildShadowNode) { + if (layoutableChildShadowNode != nullptr) { layoutableChildren.push_back( const_cast(layoutableChildShadowNode)); } @@ -254,8 +253,8 @@ LayoutableShadowNode::getLayoutableChildNodes() const { } Size LayoutableShadowNode::measureContent( - LayoutContext const &layoutContext, - LayoutConstraints const &layoutConstraints) const { + LayoutContext const & /*layoutContext*/, + LayoutConstraints const & /*layoutConstraints*/) const { return {}; } @@ -274,11 +273,11 @@ Size LayoutableShadowNode::measure( return layoutableShadowNode.getLayoutMetrics().frame.size; } -Float LayoutableShadowNode::firstBaseline(Size size) const { +Float LayoutableShadowNode::firstBaseline(Size /*size*/) const { return 0; } -Float LayoutableShadowNode::lastBaseline(Size size) const { +Float LayoutableShadowNode::lastBaseline(Size /*size*/) const { return 0; } @@ -288,7 +287,7 @@ ShadowNode::Shared LayoutableShadowNode::findNodeAtPoint( auto layoutableShadowNode = traitCast(node.get()); - if (!layoutableShadowNode) { + if (layoutableShadowNode == nullptr) { return nullptr; } auto frame = layoutableShadowNode->getLayoutMetrics().frame; @@ -356,5 +355,4 @@ SharedDebugStringConvertibleList LayoutableShadowNode::getDebugProps() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/Props.cpp b/ReactCommon/react/renderer/core/Props.cpp index 2ead741b735..ddf2a662bd6 100644 --- a/ReactCommon/react/renderer/core/Props.cpp +++ b/ReactCommon/react/renderer/core/Props.cpp @@ -12,8 +12,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { Props::Props( const PropsParserContext &context, @@ -50,5 +49,4 @@ void Props::setProp( } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/RawEvent.cpp b/ReactCommon/react/renderer/core/RawEvent.cpp index 1c7c5b8dc3e..646ce4aea3a 100644 --- a/ReactCommon/react/renderer/core/RawEvent.cpp +++ b/ReactCommon/react/renderer/core/RawEvent.cpp @@ -7,8 +7,7 @@ #include "RawEvent.h" -namespace facebook { -namespace react { +namespace facebook::react { RawEvent::RawEvent( std::string type, @@ -20,5 +19,4 @@ RawEvent::RawEvent( eventTarget(std::move(eventTarget)), category(category) {} -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/RawProps.cpp b/ReactCommon/react/renderer/core/RawProps.cpp index bd476f6ca03..428e22ab0e4 100644 --- a/ReactCommon/react/renderer/core/RawProps.cpp +++ b/ReactCommon/react/renderer/core/RawProps.cpp @@ -11,8 +11,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { RawProps::RawProps() { mode_ = Mode::Empty; @@ -101,5 +100,4 @@ void RawProps::iterateOverValues( return parser_->iterateOverValues(*this, fn); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/RawPropsKey.cpp b/ReactCommon/react/renderer/core/RawPropsKey.cpp index daaefbc5ae1..0f752b45845 100644 --- a/ReactCommon/react/renderer/core/RawPropsKey.cpp +++ b/ReactCommon/react/renderer/core/RawPropsKey.cpp @@ -14,8 +14,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { void RawPropsKey::render(char *buffer, RawPropsPropNameLength *length) const noexcept { @@ -70,5 +69,4 @@ bool operator!=(RawPropsKey const &lhs, RawPropsKey const &rhs) noexcept { return !(lhs == rhs); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp b/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp index d978bf4eed7..d4a8d78e228 100644 --- a/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +++ b/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp @@ -14,8 +14,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { bool RawPropsKeyMap::hasSameName(Item const &lhs, Item const &rhs) noexcept { return lhs.length == rhs.length && @@ -104,5 +103,4 @@ RawPropsValueIndex RawPropsKeyMap::at( return kRawPropsValueIndexEmpty; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/RawPropsParser.cpp b/ReactCommon/react/renderer/core/RawPropsParser.cpp index 770e42e222f..d78f83ce125 100644 --- a/ReactCommon/react/renderer/core/RawPropsParser.cpp +++ b/ReactCommon/react/renderer/core/RawPropsParser.cpp @@ -14,8 +14,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { // During parser initialization, Props structs are used to parse // "fake"/empty objects, and `at` is called repeatedly which tells us @@ -221,5 +220,4 @@ void RawPropsParser::iterateOverValues( } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/RawPropsParser.h b/ReactCommon/react/renderer/core/RawPropsParser.h index c112f6247cb..0ea961232b5 100644 --- a/ReactCommon/react/renderer/core/RawPropsParser.h +++ b/ReactCommon/react/renderer/core/RawPropsParser.h @@ -82,8 +82,8 @@ class RawPropsParser final { void iterateOverValues( RawProps const &rawProps, std::function< - void(RawPropsPropNameHash, const char *, RawValue const &)> const &fn) - const; + void(RawPropsPropNameHash, const char *, RawValue const &)> const + &visit) const; mutable butter::small_vector keys_{}; diff --git a/ReactCommon/react/renderer/core/Sealable.cpp b/ReactCommon/react/renderer/core/Sealable.cpp index 881ac7842d4..202c37988be 100644 --- a/ReactCommon/react/renderer/core/Sealable.cpp +++ b/ReactCommon/react/renderer/core/Sealable.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { /* * Note: @@ -62,5 +61,4 @@ void Sealable::ensureUnsealed() const { #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/ShadowNode.cpp b/ReactCommon/react/renderer/core/ShadowNode.cpp index eaab746ac5c..9317ff644e4 100644 --- a/ReactCommon/react/renderer/core/ShadowNode.cpp +++ b/ReactCommon/react/renderer/core/ShadowNode.cpp @@ -19,8 +19,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { ShadowNode::SharedListOfShared ShadowNode::emptySharedShadowNodeSharedList() { static const auto emptySharedShadowNodeSharedList = @@ -330,5 +329,4 @@ SharedDebugStringConvertibleList ShadowNode::getDebugProps() const { } #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp b/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp index b5e28cb988b..361a51b75ed 100644 --- a/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp +++ b/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp @@ -14,8 +14,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { using AncestorList = ShadowNode::AncestorList; @@ -142,5 +141,4 @@ void ShadowNodeFamily::dispatchRawState( eventDispatcher->dispatchStateUpdate(std::move(stateUpdate), priority); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.cpp b/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.cpp index c744700c3fd..3f27ab9bfef 100644 --- a/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.cpp +++ b/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { ShadowNodeFamilyFragment ShadowNodeFamilyFragment::build( ShadowNodeFamily const &family) { @@ -32,5 +31,4 @@ Value::operator ShadowNodeFamilyFragment() const { return ShadowNodeFamilyFragment{tag, surfaceId, eventEmitter}; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/ShadowNodeFragment.cpp b/ReactCommon/react/renderer/core/ShadowNodeFragment.cpp index 02793cc1245..bca4126c238 100644 --- a/ReactCommon/react/renderer/core/ShadowNodeFragment.cpp +++ b/ReactCommon/react/renderer/core/ShadowNodeFragment.cpp @@ -7,8 +7,7 @@ #include "ShadowNodeFragment.h" -namespace facebook { -namespace react { +namespace facebook::react { Props::Shared const &ShadowNodeFragment::propsPlaceholder() { static auto &instance = *new Props::Shared(); @@ -37,5 +36,4 @@ Value::operator ShadowNodeFragment() const { return ShadowNodeFragment{props, children, state}; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/ShadowNodeTraits.cpp b/ReactCommon/react/renderer/core/ShadowNodeTraits.cpp index 999581dd1d9..2ead01cb13e 100644 --- a/ReactCommon/react/renderer/core/ShadowNodeTraits.cpp +++ b/ReactCommon/react/renderer/core/ShadowNodeTraits.cpp @@ -7,6 +7,4 @@ #include "ShadowNodeTraits.h" -namespace facebook { -namespace react {} // namespace react -} // namespace facebook +namespace facebook::react {} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/State.cpp b/ReactCommon/react/renderer/core/State.cpp index 85c07a13fa1..e24b87f84c2 100644 --- a/ReactCommon/react/renderer/core/State.cpp +++ b/ReactCommon/react/renderer/core/State.cpp @@ -14,8 +14,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { State::State(StateData::Shared data, State const &state) : family_(state.family_), @@ -49,5 +48,4 @@ size_t State::getRevision() const { return revision_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/UnbatchedEventQueue.cpp b/ReactCommon/react/renderer/core/UnbatchedEventQueue.cpp index acdcfdcbf38..604122a6ce4 100644 --- a/ReactCommon/react/renderer/core/UnbatchedEventQueue.cpp +++ b/ReactCommon/react/renderer/core/UnbatchedEventQueue.cpp @@ -7,13 +7,11 @@ #include "UnbatchedEventQueue.h" -namespace facebook { -namespace react { +namespace facebook::react { void UnbatchedEventQueue::onEnqueue() const { eventBeat_->request(); eventBeat_->induce(); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/core/tests/benchmarks/RawPropsBenchmark.cpp b/ReactCommon/react/renderer/core/tests/benchmarks/RawPropsBenchmark.cpp index 30e186ed7c4..c0905a47184 100644 --- a/ReactCommon/react/renderer/core/tests/benchmarks/RawPropsBenchmark.cpp +++ b/ReactCommon/react/renderer/core/tests/benchmarks/RawPropsBenchmark.cpp @@ -15,8 +15,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { auto contextContainer = std::make_shared(); auto eventDispatcher = std::shared_ptr{nullptr}; @@ -83,7 +82,6 @@ static void propParsingRegularRawPropsWithNoSourceProps( } BENCHMARK(propParsingRegularRawPropsWithNoSourceProps); -} // namespace react -} // namespace facebook +} // namespace facebook::react BENCHMARK_MAIN(); diff --git a/ReactCommon/react/renderer/debug/DebugStringConvertible.cpp b/ReactCommon/react/renderer/debug/DebugStringConvertible.cpp index 8e6f62b4c1a..e94cb4c579e 100644 --- a/ReactCommon/react/renderer/debug/DebugStringConvertible.cpp +++ b/ReactCommon/react/renderer/debug/DebugStringConvertible.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { #if RN_DEBUG_STRING_CONVERTIBLE @@ -150,5 +149,4 @@ std::string toString(void const *value) { #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/debug/DebugStringConvertibleItem.cpp b/ReactCommon/react/renderer/debug/DebugStringConvertibleItem.cpp index 9f074600c74..1f183d51f14 100644 --- a/ReactCommon/react/renderer/debug/DebugStringConvertibleItem.cpp +++ b/ReactCommon/react/renderer/debug/DebugStringConvertibleItem.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { #if RN_DEBUG_STRING_CONVERTIBLE @@ -44,5 +43,4 @@ SharedDebugStringConvertibleList DebugStringConvertibleItem::getDebugChildren() #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/element/ComponentBuilder.cpp b/ReactCommon/react/renderer/element/ComponentBuilder.cpp index e6e1dd300be..d588b873773 100644 --- a/ReactCommon/react/renderer/element/ComponentBuilder.cpp +++ b/ReactCommon/react/renderer/element/ComponentBuilder.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { ComponentBuilder::ComponentBuilder( ComponentDescriptorRegistry::Shared componentDescriptorRegistry) @@ -66,5 +65,4 @@ ShadowNode::Unshared ComponentBuilder::build( return shadowNode; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/graphics/Transform.cpp b/ReactCommon/react/renderer/graphics/Transform.cpp index 5639203f0df..d9669ea3497 100644 --- a/ReactCommon/react/renderer/graphics/Transform.cpp +++ b/ReactCommon/react/renderer/graphics/Transform.cpp @@ -12,8 +12,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { #ifdef RN_DEBUG_STRING_CONVERTIBLE void Transform::print(Transform const &t, std::string prefix) { @@ -421,5 +420,4 @@ Size operator*(Size const &size, Transform const &transform) { return result; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/Color.cpp b/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/Color.cpp index 7fb59308a08..a56c5460d9e 100644 --- a/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/Color.cpp +++ b/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/Color.cpp @@ -7,8 +7,7 @@ #include "Color.h" -namespace facebook { -namespace react { +namespace facebook::react { bool isColorMeaningful(SharedColor const &color) noexcept { if (!color) { @@ -52,5 +51,4 @@ SharedColor whiteColor() { return color; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/imagemanager/ImageResponse.cpp b/ReactCommon/react/renderer/imagemanager/ImageResponse.cpp index cde6adeb67b..9abddca0fd7 100644 --- a/ReactCommon/react/renderer/imagemanager/ImageResponse.cpp +++ b/ReactCommon/react/renderer/imagemanager/ImageResponse.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { ImageResponse::ImageResponse( std::shared_ptr image, @@ -25,5 +24,4 @@ std::shared_ptr ImageResponse::getMetadata() const { return metadata_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.cpp b/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.cpp index 46dea634105..290487c0e89 100644 --- a/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.cpp +++ b/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.cpp @@ -11,8 +11,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { void ImageResponseObserverCoordinator::addObserver( ImageResponseObserver const &observer) const { @@ -88,5 +87,4 @@ void ImageResponseObserverCoordinator::nativeImageResponseFailed() const { } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/imagemanager/ImageTelemetry.cpp b/ReactCommon/react/renderer/imagemanager/ImageTelemetry.cpp index 3373ce8b793..3e7c68b40a8 100644 --- a/ReactCommon/react/renderer/imagemanager/ImageTelemetry.cpp +++ b/ReactCommon/react/renderer/imagemanager/ImageTelemetry.cpp @@ -7,8 +7,7 @@ #include "ImageTelemetry.h" -namespace facebook { -namespace react { +namespace facebook::react { SurfaceId ImageTelemetry::getSurfaceId() const { return surfaceId_; @@ -18,5 +17,4 @@ TelemetryTimePoint ImageTelemetry::getWillRequestUrlTime() const { return willRequestUrlTime_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageManager.cpp b/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageManager.cpp index 6baf9a795af..30bc153fc0d 100644 --- a/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageManager.cpp +++ b/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageManager.cpp @@ -7,8 +7,7 @@ #include "ImageManager.h" -namespace facebook { -namespace react { +namespace facebook::react { ImageManager::ImageManager( ContextContainer::Shared const & /*contextContainer*/) { @@ -28,5 +27,4 @@ ImageRequest ImageManager::requestImage( return {imageSource, nullptr}; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageRequest.cpp b/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageRequest.cpp index c270971dd27..ce53a1b65ca 100644 --- a/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageRequest.cpp +++ b/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageRequest.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { ImageRequest::ImageRequest( ImageSource imageSource, @@ -42,5 +41,4 @@ const std::shared_ptr abort(); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/leakchecker/LeakChecker.cpp b/ReactCommon/react/renderer/leakchecker/LeakChecker.cpp index b0ef65609a1..59c93a27747 100644 --- a/ReactCommon/react/renderer/leakchecker/LeakChecker.cpp +++ b/ReactCommon/react/renderer/leakchecker/LeakChecker.cpp @@ -12,8 +12,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { LeakChecker::LeakChecker(RuntimeExecutor runtimeExecutor) : runtimeExecutor_(std::move(runtimeExecutor)) {} @@ -58,5 +57,4 @@ void LeakChecker::checkSurfaceForLeaks(SurfaceId surfaceId) const { registry_.removeFamiliesWithSurfaceId(surfaceId); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/leakchecker/WeakFamilyRegistry.cpp b/ReactCommon/react/renderer/leakchecker/WeakFamilyRegistry.cpp index aaf99e18ccb..4f1d97561e0 100644 --- a/ReactCommon/react/renderer/leakchecker/WeakFamilyRegistry.cpp +++ b/ReactCommon/react/renderer/leakchecker/WeakFamilyRegistry.cpp @@ -7,8 +7,7 @@ #include "WeakFamilyRegistry.h" -namespace facebook { -namespace react { +namespace facebook::react { void WeakFamilyRegistry::add( ShadowNodeFamily::Shared const &shadowNodeFamily) const { @@ -32,5 +31,4 @@ WeakFamilyRegistry::WeakFamilies WeakFamilyRegistry::weakFamiliesForSurfaceId( return {}; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp b/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp index f5d5198f70f..9e1c5404a3b 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +++ b/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp @@ -9,8 +9,7 @@ using namespace facebook::react; -namespace facebook { -namespace react { +namespace facebook::react { static inline int32_t bucketOffset(int32_t index) { return sizeof(MapBuffer::Header) + sizeof(MapBuffer::Bucket) * index; @@ -149,5 +148,4 @@ uint16_t MapBuffer::count() const { return count_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp index 24f5d1cc2fc..92d5ff8bcf7 100644 --- a/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +++ b/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp @@ -10,8 +10,7 @@ using namespace facebook::react; -namespace facebook { -namespace react { +namespace facebook::react { constexpr uint32_t INT_SIZE = sizeof(uint32_t); constexpr uint32_t DOUBLE_SIZE = sizeof(double); @@ -178,5 +177,4 @@ MapBuffer MapBufferBuilder::build() { return MapBuffer(std::move(buffer)); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index ffaadd4266e..aae72534706 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -38,8 +38,7 @@ enum class NoBreadcrumb {}; {} #endif -namespace facebook { -namespace react { +namespace facebook::react { /* * Extremely simple and naive implementation of a map. @@ -1638,5 +1637,4 @@ ShadowViewMutation::List calculateShadowViewMutations( return mutations; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp b/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp index 02e9b58fffe..bbd02b4cdc9 100644 --- a/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +++ b/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp @@ -17,8 +17,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { MountingCoordinator::MountingCoordinator(const ShadowTreeRevision &baseRevision) : surfaceId_(baseRevision.rootShadowNode->getSurfaceId()), @@ -186,5 +185,4 @@ void MountingCoordinator::setMountingOverrideDelegate( mountingOverrideDelegate_ = std::move(delegate); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/MountingTransaction.cpp b/ReactCommon/react/renderer/mounting/MountingTransaction.cpp index 8c3e2c37472..ed25ea57464 100644 --- a/ReactCommon/react/renderer/mounting/MountingTransaction.cpp +++ b/ReactCommon/react/renderer/mounting/MountingTransaction.cpp @@ -7,8 +7,7 @@ #include "MountingTransaction.h" -namespace facebook { -namespace react { +namespace facebook::react { using Number = MountingTransaction::Number; @@ -42,5 +41,4 @@ Number MountingTransaction::getNumber() const { return number_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/ShadowTree.cpp b/ReactCommon/react/renderer/mounting/ShadowTree.cpp index ed69d42aa9f..908b9bcbf99 100644 --- a/ReactCommon/react/renderer/mounting/ShadowTree.cpp +++ b/ReactCommon/react/renderer/mounting/ShadowTree.cpp @@ -19,8 +19,7 @@ #include "ShadowTreeDelegate.h" -namespace facebook { -namespace react { +namespace facebook::react { using CommitStatus = ShadowTree::CommitStatus; using CommitMode = ShadowTree::CommitMode; @@ -461,5 +460,4 @@ void ShadowTree::notifyDelegatesOfUpdates() const { delegate_.shadowTreeDidFinishTransaction(*this, mountingCoordinator_); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/ShadowTreeRegistry.cpp b/ReactCommon/react/renderer/mounting/ShadowTreeRegistry.cpp index 2b0c6927edf..53bc6f9f2fd 100644 --- a/ReactCommon/react/renderer/mounting/ShadowTreeRegistry.cpp +++ b/ReactCommon/react/renderer/mounting/ShadowTreeRegistry.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { ShadowTreeRegistry::~ShadowTreeRegistry() { react_native_assert( @@ -60,5 +59,4 @@ void ShadowTreeRegistry::enumerate( } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/ShadowView.cpp b/ReactCommon/react/renderer/mounting/ShadowView.cpp index 7e509a7edaf..c7769bd5d90 100644 --- a/ReactCommon/react/renderer/mounting/ShadowView.cpp +++ b/ReactCommon/react/renderer/mounting/ShadowView.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { static LayoutMetrics layoutMetricsFromShadowNode(ShadowNode const &shadowNode) { auto layoutableShadowNode = @@ -96,5 +95,4 @@ bool ShadowViewNodePairLegacy::operator!=( return !(*this == rhs); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/ShadowViewMutation.cpp b/ReactCommon/react/renderer/mounting/ShadowViewMutation.cpp index 2960499258e..5321e5e1967 100644 --- a/ReactCommon/react/renderer/mounting/ShadowViewMutation.cpp +++ b/ReactCommon/react/renderer/mounting/ShadowViewMutation.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { /** * Initialize static feature flags for this module. @@ -176,5 +175,4 @@ std::vector getDebugProps( #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/StubView.cpp b/ReactCommon/react/renderer/mounting/StubView.cpp index 5d26b18d9b1..b446b5bf9ef 100644 --- a/ReactCommon/react/renderer/mounting/StubView.cpp +++ b/ReactCommon/react/renderer/mounting/StubView.cpp @@ -11,8 +11,7 @@ #include #endif -namespace facebook { -namespace react { +namespace facebook::react { StubView::operator ShadowView() const { auto shadowView = ShadowView{}; @@ -95,5 +94,4 @@ std::vector getDebugChildren( #endif -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/StubViewTree.cpp b/ReactCommon/react/renderer/mounting/StubViewTree.cpp index fb1fc8e1ac9..7a5afeaa008 100644 --- a/ReactCommon/react/renderer/mounting/StubViewTree.cpp +++ b/ReactCommon/react/renderer/mounting/StubViewTree.cpp @@ -16,8 +16,7 @@ #define STUB_VIEW_LOG(code) #endif -namespace facebook { -namespace react { +namespace facebook::react { StubViewTree::StubViewTree(ShadowView const &shadowView) { auto view = std::make_shared(); @@ -311,5 +310,4 @@ bool operator!=(StubViewTree const &lhs, StubViewTree const &rhs) { return !(lhs == rhs); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/TelemetryController.cpp b/ReactCommon/react/renderer/mounting/TelemetryController.cpp index 25ef9bee650..2ae6dd7782e 100644 --- a/ReactCommon/react/renderer/mounting/TelemetryController.cpp +++ b/ReactCommon/react/renderer/mounting/TelemetryController.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { TelemetryController::TelemetryController( MountingCoordinator const &mountingCoordinator) noexcept @@ -51,5 +50,4 @@ bool TelemetryController::pullTransaction( return true; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/stubs.cpp b/ReactCommon/react/renderer/mounting/stubs.cpp index 71ff672ecc7..11f9aad6530 100644 --- a/ReactCommon/react/renderer/mounting/stubs.cpp +++ b/ReactCommon/react/renderer/mounting/stubs.cpp @@ -11,8 +11,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { /* * Sorting comparator for `reorderInPlaceIfNeeded`. @@ -96,5 +95,4 @@ StubViewTree buildStubViewTreeUsingDifferentiator( return stubViewTree; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/tests/MountingTest.cpp b/ReactCommon/react/renderer/mounting/tests/MountingTest.cpp index 5c98724a79b..c3dae1de96e 100644 --- a/ReactCommon/react/renderer/mounting/tests/MountingTest.cpp +++ b/ReactCommon/react/renderer/mounting/tests/MountingTest.cpp @@ -18,8 +18,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { static SharedViewProps nonFlattenedDefaultProps( ComponentDescriptor const &componentDescriptor) { @@ -705,5 +704,4 @@ TEST(MountingTest, testViewReparentingInstructionGeneration) { EXPECT_EQ(mutations4[8].newChildShadowView.tag, 2000); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp b/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp index 1afd71e2b79..9d6c2ddbdfc 100644 --- a/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +++ b/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp @@ -24,8 +24,7 @@ // #include // #include -namespace facebook { -namespace react { +namespace facebook::react { static void testShadowNodeTreeLifeCycle( uint_fast32_t seed, @@ -328,8 +327,7 @@ static void testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening( SUCCEED(); } -} // namespace react -} // namespace facebook +} // namespace facebook::react using namespace facebook::react; diff --git a/ReactCommon/react/renderer/mounting/tests/StackingContextTest.cpp b/ReactCommon/react/renderer/mounting/tests/StackingContextTest.cpp index 6d2cc0a1900..45b59ffd092 100644 --- a/ReactCommon/react/renderer/mounting/tests/StackingContextTest.cpp +++ b/ReactCommon/react/renderer/mounting/tests/StackingContextTest.cpp @@ -21,8 +21,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { class StackingContextTest : public ::testing::Test { protected: @@ -783,5 +782,4 @@ TEST_F(StackingContextTest, zIndexAndFlattenedNodes) { }); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp b/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp index 9e21ea3a0c3..4927b22ef7d 100644 --- a/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp @@ -10,8 +10,7 @@ #include #include "ErrorUtils.h" -namespace facebook { -namespace react { +namespace facebook::react { #pragma mark - Public @@ -160,5 +159,4 @@ void RuntimeScheduler::startWorkLoop(jsi::Runtime &runtime) const { isPerformingWork_ = false; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp b/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp index f1f09261a6f..1226160f33b 100644 --- a/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp @@ -14,8 +14,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { std::shared_ptr RuntimeSchedulerBinding::createAndInstallIfNeeded( @@ -201,5 +200,4 @@ jsi::Value RuntimeSchedulerBinding::get( #endif } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp b/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp index 3f8b3be7ae4..50cea4deee5 100644 --- a/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { RuntimeSchedulerCallInvoker::RuntimeSchedulerCallInvoker( std::weak_ptr runtimeScheduler) @@ -30,5 +29,4 @@ void RuntimeSchedulerCallInvoker::invokeSync(std::function &&func) { } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/runtimescheduler/Task.cpp b/ReactCommon/react/renderer/runtimescheduler/Task.cpp index 475de07cba6..34cb857806b 100644 --- a/ReactCommon/react/renderer/runtimescheduler/Task.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/Task.cpp @@ -7,8 +7,7 @@ #include "RuntimeScheduler.h" -namespace facebook { -namespace react { +namespace facebook::react { Task::Task( SchedulerPriority priority, @@ -33,5 +32,4 @@ jsi::Value Task::execute(jsi::Runtime &runtime, bool didUserCallbackTimeout) { return result; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/scheduler/Scheduler.cpp b/ReactCommon/react/renderer/scheduler/Scheduler.cpp index d5c33780f35..620191a4f2c 100644 --- a/ReactCommon/react/renderer/scheduler/Scheduler.cpp +++ b/ReactCommon/react/renderer/scheduler/Scheduler.cpp @@ -27,8 +27,7 @@ #include #endif -namespace facebook { -namespace react { +namespace facebook::react { Scheduler::Scheduler( SchedulerToolbox const &schedulerToolbox, @@ -379,5 +378,4 @@ void Scheduler::removeEventListener( } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp b/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp index f8753a6ec37..1ee4505c59a 100644 --- a/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +++ b/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp @@ -12,8 +12,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { using Status = SurfaceHandler::Status; @@ -316,5 +315,4 @@ SurfaceHandler::~SurfaceHandler() noexcept { // deallocation."); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp b/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp index faa9c2c1282..e663b68f4c1 100644 --- a/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp +++ b/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { SurfaceManager::SurfaceManager(Scheduler const &scheduler) noexcept : scheduler_(scheduler) {} @@ -100,5 +99,4 @@ void SurfaceManager::visit( callback(iterator->second); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/scheduler/SynchronousEventBeat.cpp b/ReactCommon/react/renderer/scheduler/SynchronousEventBeat.cpp index f100463329d..73b18946ff4 100644 --- a/ReactCommon/react/renderer/scheduler/SynchronousEventBeat.cpp +++ b/ReactCommon/react/renderer/scheduler/SynchronousEventBeat.cpp @@ -11,8 +11,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { SynchronousEventBeat::SynchronousEventBeat( RunLoopObserver::Unique uiRunLoopObserver, @@ -57,5 +56,4 @@ void SynchronousEventBeat::lockExecutorAndBeat() const { } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/telemetry/SurfaceTelemetry.cpp b/ReactCommon/react/renderer/telemetry/SurfaceTelemetry.cpp index d982e26d6ee..2fc097e74a8 100644 --- a/ReactCommon/react/renderer/telemetry/SurfaceTelemetry.cpp +++ b/ReactCommon/react/renderer/telemetry/SurfaceTelemetry.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { void SurfaceTelemetry::incorporate( TransactionTelemetry const &telemetry, @@ -81,5 +80,4 @@ SurfaceTelemetry::getRecentTransactionTelemetries() const { return result; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/telemetry/TransactionTelemetry.cpp b/ReactCommon/react/renderer/telemetry/TransactionTelemetry.cpp index 79c2f71b55a..cd23b4d12d8 100644 --- a/ReactCommon/react/renderer/telemetry/TransactionTelemetry.cpp +++ b/ReactCommon/react/renderer/telemetry/TransactionTelemetry.cpp @@ -11,8 +11,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { thread_local TransactionTelemetry *threadLocalTransactionTelemetry = nullptr; @@ -161,5 +160,4 @@ int TransactionTelemetry::getRevisionNumber() const { return revisionNumber_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/templateprocessor/UITemplateProcessor.cpp b/ReactCommon/react/renderer/templateprocessor/UITemplateProcessor.cpp index a198134b350..d988d1e79a3 100644 --- a/ReactCommon/react/renderer/templateprocessor/UITemplateProcessor.cpp +++ b/ReactCommon/react/renderer/templateprocessor/UITemplateProcessor.cpp @@ -18,8 +18,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { bool constexpr DEBUG_FLY = false; @@ -151,5 +150,4 @@ ShadowNode::Shared UITemplateProcessor::buildShadowTree( return ShadowNode::Shared{}; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp b/ReactCommon/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp index 70fa3e85e01..66de70df621 100644 --- a/ReactCommon/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp +++ b/ReactCommon/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp @@ -23,8 +23,7 @@ using namespace facebook::react; #include #include -namespace facebook { -namespace react { +namespace facebook::react { static ComponentRegistryFactory getComponentRegistryFactory() { return [](const EventDispatcher::Weak &eventDispatcher, @@ -78,8 +77,7 @@ class MockReactNativeConfig : public ReactNativeConfig { std::shared_ptr mockReactNativeConfig_ = std::make_shared(); -} // namespace react -} // namespace facebook +} // namespace facebook::react TEST(UITemplateProcessorTest, testSimpleBytecode) { auto surfaceId = 11; diff --git a/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.cpp b/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.cpp index 6275bd8c442..03558aad542 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.cpp +++ b/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { static Rect rectFromDynamic(folly::dynamic const &data) { Point origin; @@ -66,5 +65,4 @@ bool LineMeasurement::operator==(LineMeasurement const &rhs) const { rhs.xHeight); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp b/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp index a8ca135e579..7e94bc54d96 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +++ b/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp @@ -19,8 +19,7 @@ using namespace facebook::jni; -namespace facebook { -namespace react { +namespace facebook::react { Size measureAndroidComponent( ContextContainer::Shared const &contextContainer, @@ -446,5 +445,4 @@ TextMeasurement TextLayoutManager::doMeasureMapBuffer( return TextMeasurement{size, attachments}; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/timeline/Timeline.cpp b/ReactCommon/react/renderer/timeline/Timeline.cpp index e8377f8efb3..5fb3bab3948 100644 --- a/ReactCommon/react/renderer/timeline/Timeline.cpp +++ b/ReactCommon/react/renderer/timeline/Timeline.cpp @@ -9,8 +9,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { Timeline::Timeline(ShadowTree const &shadowTree) : shadowTree_(&shadowTree) { record(shadowTree.getCurrentRevision().rootShadowNode); @@ -117,5 +116,4 @@ void Timeline::rewind(TimelineSnapshot const &snapshot) const noexcept { rewinding_ = false; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/timeline/TimelineController.cpp b/ReactCommon/react/renderer/timeline/TimelineController.cpp index accbcb7b15e..82f31db63db 100644 --- a/ReactCommon/react/renderer/timeline/TimelineController.cpp +++ b/ReactCommon/react/renderer/timeline/TimelineController.cpp @@ -10,8 +10,7 @@ #include #include -namespace facebook { -namespace react { +namespace facebook::react { TimelineHandler TimelineController::enable(SurfaceId surfaceId) const { assert(uiManager_); @@ -73,5 +72,4 @@ RootShadowNode::Unshared TimelineController::shadowTreeWillCommit( shadowTree, oldRootShadowNode, newRootShadowNode); } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/timeline/TimelineFrame.cpp b/ReactCommon/react/renderer/timeline/TimelineFrame.cpp index b23e160cce1..d1aa4ac2e11 100644 --- a/ReactCommon/react/renderer/timeline/TimelineFrame.cpp +++ b/ReactCommon/react/renderer/timeline/TimelineFrame.cpp @@ -7,8 +7,7 @@ #include "TimelineFrame.h" -namespace facebook { -namespace react { +namespace facebook::react { TimelineFrame::TimelineFrame(int index, TelemetryTimePoint timePoint) noexcept : index_(index), timePoint_(timePoint) {} @@ -21,5 +20,4 @@ TelemetryTimePoint TimelineFrame::getTimePoint() const noexcept { return timePoint_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/timeline/TimelineHandler.cpp b/ReactCommon/react/renderer/timeline/TimelineHandler.cpp index 7b8dcecb38c..dc42ec8f517 100644 --- a/ReactCommon/react/renderer/timeline/TimelineHandler.cpp +++ b/ReactCommon/react/renderer/timeline/TimelineHandler.cpp @@ -11,8 +11,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { TimelineHandler::TimelineHandler(Timeline const &timeline) noexcept : timeline_(&timeline) {} @@ -93,5 +92,4 @@ void TimelineHandler::ensureNotEmpty() const noexcept { } } -} // namespace react -} // namespace facebook +} // namespace facebook::react diff --git a/ReactCommon/react/renderer/timeline/TimelineSnapshot.cpp b/ReactCommon/react/renderer/timeline/TimelineSnapshot.cpp index 08d40bd1214..1500caebe92 100644 --- a/ReactCommon/react/renderer/timeline/TimelineSnapshot.cpp +++ b/ReactCommon/react/renderer/timeline/TimelineSnapshot.cpp @@ -11,8 +11,7 @@ #include -namespace facebook { -namespace react { +namespace facebook::react { TimelineSnapshot::TimelineSnapshot( RootShadowNode::Shared rootShadowNode, @@ -28,5 +27,4 @@ TimelineFrame TimelineSnapshot::getFrame() const noexcept { return frame_; } -} // namespace react -} // namespace facebook +} // namespace facebook::react