Skip to content

Commit fa465c6

Browse files
generatedunixname89002005287564facebook-github-bot
authored andcommitted
Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [B] [A] [B] (facebook#53972)
Summary: Pull Request resolved: facebook#53972 Reviewed By: rshest Differential Revision: D83405113 fbshipit-source-id: 5e7b3c37e08d49991fd112180625953a0edca047
1 parent 0b14a19 commit fa465c6

File tree

3 files changed

+34
-22
lines changed

3 files changed

+34
-22
lines changed

packages/react-native/ReactCommon/react/renderer/imagemanager/primitives.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ImageSource {
2727
std::string uri{};
2828
std::string bundle{};
2929
Float scale{3};
30-
Size size{0};
30+
Size size{.width = 0};
3131
std::string body{};
3232
std::string method{};
3333
CacheStategy cache = CacheStategy::Default;

packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ static std::shared_ptr<ShadowNode> progressState(const ShadowNode& shadowNode) {
6969
}
7070

7171
return shadowNode.clone({
72-
ShadowNodeFragment::propsPlaceholder(),
73-
areChildrenChanged
72+
.props = ShadowNodeFragment::propsPlaceholder(),
73+
.children = areChildrenChanged
7474
? std::make_shared<
7575
const std::vector<std::shared_ptr<const ShadowNode>>>(
7676
std::move(newChildren))
7777
: ShadowNodeFragment::childrenPlaceholder(),
78-
isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(),
78+
.state =
79+
isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(),
7980
});
8081
}
8182

@@ -158,13 +159,14 @@ static std::shared_ptr<ShadowNode> progressState(
158159
}
159160

160161
return shadowNode.clone({
161-
ShadowNodeFragment::propsPlaceholder(),
162-
areChildrenChanged
162+
.props = ShadowNodeFragment::propsPlaceholder(),
163+
.children = areChildrenChanged
163164
? std::make_shared<
164165
const std::vector<std::shared_ptr<const ShadowNode>>>(
165166
std::move(newChildren))
166167
: ShadowNodeFragment::childrenPlaceholder(),
167-
isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(),
168+
.state =
169+
isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(),
168170
});
169171
}
170172

@@ -177,7 +179,9 @@ ShadowTree::ShadowTree(
177179
: surfaceId_(surfaceId), delegate_(delegate) {
178180
static RootComponentDescriptor globalRootComponentDescriptor(
179181
ComponentDescriptorParameters{
180-
EventDispatcher::Shared{}, nullptr, nullptr});
182+
.eventDispatcher = EventDispatcher::Shared{},
183+
.contextContainer = nullptr,
184+
.flavor = nullptr});
181185

182186
const auto props = std::make_shared<const RootProps>(
183187
PropsParserContext{surfaceId, contextContainer},
@@ -186,17 +190,19 @@ ShadowTree::ShadowTree(
186190
layoutContext);
187191

188192
auto family = globalRootComponentDescriptor.createFamily(
189-
{surfaceId, surfaceId, nullptr});
193+
{.tag = surfaceId, .surfaceId = surfaceId, .instanceHandle = nullptr});
190194

191195
auto rootShadowNode = std::static_pointer_cast<const RootShadowNode>(
192196
globalRootComponentDescriptor.createShadowNode(
193197
ShadowNodeFragment{
194-
/* .props = */ props,
198+
/* .props = */ .props = props,
195199
},
196200
family));
197201

198202
currentRevision_ = ShadowTreeRevision{
199-
rootShadowNode, INITIAL_REVISION, TransactionTelemetry{}};
203+
.rootShadowNode = rootShadowNode,
204+
.number = INITIAL_REVISION,
205+
.telemetry = TransactionTelemetry{}};
200206

201207
mountingCoordinator_ =
202208
std::make_shared<const MountingCoordinator>(currentRevision_);
@@ -354,7 +360,9 @@ CommitStatus ShadowTree::tryCommit(
354360
newRootShadowNode->sealRecursive();
355361

356362
newRevision = ShadowTreeRevision{
357-
std::move(newRootShadowNode), newRevisionNumber, telemetry};
363+
.rootShadowNode = std::move(newRootShadowNode),
364+
.number = newRevisionNumber,
365+
.telemetry = telemetry};
358366

359367
currentRevision_ = newRevision;
360368
}
@@ -387,8 +395,9 @@ void ShadowTree::commitEmptyTree() const {
387395
return std::make_shared<RootShadowNode>(
388396
oldRootShadowNode,
389397
ShadowNodeFragment{
390-
/* .props = */ ShadowNodeFragment::propsPlaceholder(),
391-
/* .children = */ ShadowNode::emptySharedShadowNodeSharedList(),
398+
/* .props = */ .props = ShadowNodeFragment::propsPlaceholder(),
399+
/* .children = */ .children =
400+
ShadowNode::emptySharedShadowNodeSharedList(),
392401
});
393402
},
394403
{/* default commit options */});

packages/react-native/ReactCommon/react/renderer/mounting/ShadowView.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,17 @@ std::vector<DebugStringConvertibleObject> getDebugProps(
6464
const ShadowView& object,
6565
DebugStringConvertibleOptions options) {
6666
return {
67-
{"surfaceId", getDebugDescription(object.surfaceId, options)},
68-
{"tag", getDebugDescription(object.tag, options)},
69-
{"traits", getDebugDescription(object.traits, options)},
70-
{"componentName", object.componentName},
71-
{"props", getDebugDescription(object.props, options)},
72-
{"eventEmitter", getDebugDescription(object.eventEmitter, options)},
73-
{"layoutMetrics", getDebugDescription(object.layoutMetrics, options)},
74-
{"state", getDebugDescription(object.state, options)},
67+
{.name = "surfaceId",
68+
.value = getDebugDescription(object.surfaceId, options)},
69+
{.name = "tag", .value = getDebugDescription(object.tag, options)},
70+
{.name = "traits", .value = getDebugDescription(object.traits, options)},
71+
{.name = "componentName", .value = object.componentName},
72+
{.name = "props", .value = getDebugDescription(object.props, options)},
73+
{.name = "eventEmitter",
74+
.value = getDebugDescription(object.eventEmitter, options)},
75+
{.name = "layoutMetrics",
76+
.value = getDebugDescription(object.layoutMetrics, options)},
77+
{.name = "state", .value = getDebugDescription(object.state, options)},
7578
};
7679
}
7780

0 commit comments

Comments
 (0)