From 4936a663aeb4e0b7da6e30d6431d64fe7a017aaf Mon Sep 17 00:00:00 2001 From: empyrical Date: Sun, 3 Mar 2019 22:35:16 -0800 Subject: [PATCH] Fabric: Remove designated initializers in Image (#23439) Summary: This pull request removes the designated initializers in `react/components/image/**` to improve portability. [General] [Changed] - Fabric: Remove designated initializers in Image Pull Request resolved: https://github.com/facebook/react-native/pull/23439 Differential Revision: D14298888 Pulled By: shergin fbshipit-source-id: 9b6ad5fdcec4d3b19b8d69afac80ce18d37f31e6 --- ReactCommon/fabric/components/image/ImageShadowNode.cpp | 4 +++- ReactCommon/fabric/components/image/conversions.h | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ReactCommon/fabric/components/image/ImageShadowNode.cpp b/ReactCommon/fabric/components/image/ImageShadowNode.cpp index 5421515f8..39660911e 100644 --- a/ReactCommon/fabric/components/image/ImageShadowNode.cpp +++ b/ReactCommon/fabric/components/image/ImageShadowNode.cpp @@ -48,7 +48,9 @@ ImageSource ImageShadowNode::getImageSource() const { auto sources = getProps()->sources; if (sources.size() == 0) { - return {.type = ImageSource::Type::Invalid}; + return { + /* .type = */ ImageSource::Type::Invalid, + }; } if (sources.size() == 1) { diff --git a/ReactCommon/fabric/components/image/conversions.h b/ReactCommon/fabric/components/image/conversions.h index 3c42d9eff..27b4960fa 100644 --- a/ReactCommon/fabric/components/image/conversions.h +++ b/ReactCommon/fabric/components/image/conversions.h @@ -17,7 +17,10 @@ namespace react { inline void fromRawValue(const RawValue &value, ImageSource &result) { if (value.hasType()) { - result = {.type = ImageSource::Type::Remote, .uri = (std::string)value}; + result = { + /* .type = */ ImageSource::Type::Remote, + /* .uri = */ (std::string)value, + }; return; }