Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation warnings related to YogaShadowNode #38781

Closed
wants to merge 1 commit into from

Conversation

rshest
Copy link
Contributor

@rshest rshest commented Aug 4, 2023

Summary:

Changelog:

[Internal] -

These pop up when compiling with /Wall, fixes two legitimate warnings around using YogaShadowNode/Props in RN.

The suggestedIndex in ShadowNode::replaceChild (and the overriden one in YogaLayoutableShadowNode) is used in a way around the code that suggests that it is expected to be negative (checking for non-negativity, assigning -1 as default etc), so having it as a size_t type argument both makes things confusing and generates the warning.

I believe it's a good idea to be consistent and use the same type for the index throughout. In majority of the cases it's int32_t as of now.

Differential Revision: D48059620

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Aug 4, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D48059620

rshest added a commit to rshest/react-native that referenced this pull request Aug 4, 2023
Summary:
Pull Request resolved: facebook#38781

## Changelog:
[Internal] -

These pop up when compiling with `/Wall`, fixes two legitimate warnings around using YogaShadowNode/Props in RN.

The `suggestedIndex` in `ShadowNode::replaceChild` (and the overriden one in `YogaLayoutableShadowNode`) is used in a way around the code that suggests that it **is** expected to be negative (checking for non-negativity, assigning -1 as default etc), so having it as a `size_t` type argument both makes things confusing and generates the warning.

I believe it's a good idea to be consistent and use the same type for the index throughout. In majority of the cases it's `int32_t` as of now.

Differential Revision: D48059620

fbshipit-source-id: 2973a518acd7674ab25fad265d61eec5308bd1e2
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D48059620

@analysis-bot
Copy link

analysis-bot commented Aug 4, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,899,954 +239
android hermes armeabi-v7a 7,948,665 +394
android hermes x86 9,297,713 +115
android hermes x86_64 9,199,405 +282
android jsc arm64-v8a 9,485,275 +239
android jsc armeabi-v7a 8,426,974 +400
android jsc x86 9,469,168 +112
android jsc x86_64 9,783,567 +274

Base commit: 3901688
Branch: main

Summary:
Pull Request resolved: facebook#38781

## Changelog:
[Internal] -

These pop up when compiling with `/Wall`, fixes two legitimate warnings around using YogaShadowNode/Props in RN.

The `suggestedIndex` in `ShadowNode::replaceChild` (and the overriden one in `YogaLayoutableShadowNode`) is used in a way around the code that suggests that it **is** expected to be negative (checking for non-negativity, assigning -1 as default etc), so having it as a `size_t` type argument both makes things confusing and generates the warning.

I believe it's a good idea to be consistent and use the same type for the index throughout. In majority of the cases it's `int32_t` as of now.

Reviewed By: rozele

Differential Revision: D48059620

fbshipit-source-id: 8550cf78cf4f545081c61e3c88652f9f11cb356f
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D48059620

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Aug 4, 2023
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 70365f2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants