-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Simplify bitfields #1393
Simplify bitfields #1393
Conversation
This pull request was exported from Phabricator. Differential Revision: D49265967 |
Summary: Pull Request resolved: facebook#39485 X-link: facebook/yoga#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are efftively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). Differential Revision: D49265967 fbshipit-source-id: 7aeb613352943f57f8a2f8a7274514996b0a0917
This pull request was exported from Phabricator. Differential Revision: D49265967 |
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are efftively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). Differential Revision: D49265967 fbshipit-source-id: f72f9dec4caf0acaccf49902f2d3537187445fbe
dc59411
to
168ff64
Compare
This pull request was exported from Phabricator. Differential Revision: D49265967 |
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are efftively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). Differential Revision: D49265967 fbshipit-source-id: 0a5c7a24dc0eade1ca037f0c8660a9e442da198f
168ff64
to
663757b
Compare
Summary: Pull Request resolved: facebook#39485 X-link: facebook/yoga#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are efftively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). Differential Revision: D49265967 fbshipit-source-id: adaa2973d671f6fbd79ffc063f572fb9c725b1ba
This pull request was exported from Phabricator. Differential Revision: D49265967 |
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are efftively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). Differential Revision: D49265967 fbshipit-source-id: 2fa14d74f60cafcbbba9956cd6f9ce069a9b1c7c
663757b
to
08e2657
Compare
Summary: Pull Request resolved: facebook#39485 X-link: facebook/yoga#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are efftively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). Differential Revision: D49265967 fbshipit-source-id: c4c8a9392f68c9b398827e50880fed400554b738
Summary: Pull Request resolved: facebook#39485 X-link: facebook/yoga#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are efftively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). Differential Revision: D49265967 fbshipit-source-id: 787382a31cadf37aece0842c8788cfd51ba2f055
This pull request was exported from Phabricator. Differential Revision: D49265967 |
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are efftively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). Differential Revision: D49265967 fbshipit-source-id: f368d342d7c2a18b5b61469ded5dd6e1b2b939f5
08e2657
to
d46f8cf
Compare
This pull request was exported from Phabricator. Differential Revision: D49265967 |
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are effectively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). [General][Breaking] - Require C++ 20 when including renderer headers Reviewed By: sammy-SC Differential Revision: D49265967 fbshipit-source-id: 6eddef135c0105e6f3d535849091550ffc5c05e7
d46f8cf
to
b54e217
Compare
This pull request was exported from Phabricator. Differential Revision: D49265967 |
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are effectively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). [General][Breaking] - Require C++ 20 when including renderer headers Reviewed By: sammy-SC Differential Revision: D49265967 fbshipit-source-id: 21f3e852510d21b7c3db184eb5886a808474aade
b54e217
to
10a2d46
Compare
This pull request was exported from Phabricator. Differential Revision: D49265967 |
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are effectively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). [General][Breaking] - Require C++ 20 when including renderer headers Reviewed By: sammy-SC Differential Revision: D49265967 fbshipit-source-id: b4d23585831f9db16ad32e58189843ade6408427
10a2d46
to
a86acd2
Compare
This pull request was exported from Phabricator. Differential Revision: D49265967 |
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are effectively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). [General][Breaking] - Require C++ 20 when including renderer headers Reviewed By: sammy-SC Differential Revision: D49265967 fbshipit-source-id: 2a5b07f286cd7704594ba5ce92a3d29b734235b0
a86acd2
to
f7692d8
Compare
This pull request was exported from Phabricator. Differential Revision: D49265967 |
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are effectively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). [General][Breaking] - Require C++ 20 when including renderer headers Reviewed By: sammy-SC Differential Revision: D49265967 fbshipit-source-id: eda30a80d4948b950a11b52f63b9036479df05aa
f7692d8
to
32c47c9
Compare
This pull request was exported from Phabricator. Differential Revision: D49265967 |
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are effectively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). [General][Breaking] - Require C++ 20 when including renderer headers Reviewed By: sammy-SC Differential Revision: D49265967 fbshipit-source-id: 4e5a6de77f7b8bab07004b3c5886923fa9567290
32c47c9
to
7c4afe7
Compare
This pull request was exported from Phabricator. Differential Revision: D49265967 |
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are effectively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). [General][Breaking] - Require C++ 20 when including renderer headers Reviewed By: sammy-SC Differential Revision: D49265967 fbshipit-source-id: a2d7ff728ffddb5b4bf9beccd08078247414fbca
7c4afe7
to
9d1b78d
Compare
Summary: Pull Request resolved: facebook#1382 X-link: facebook/react-native#39437 Have been running into places where C++ 20 makes life easier for use like `std::bit_cast` (that one is easy to polyfill), in-class member initializer support for bitfields, designated initializers, defaulted comparison operator, concepts instead of SFINAE, and probably more. Our other infra is in the process of making this jump, or already has. This tests it out everywhere, across the various reference builds, to see if we have any issues. This is a bit more aggressive than I had previously communicated, but n - 1 is going to be a better long term place than n - 2. If we wanted to use `std::bit_cast` we would need one of: 1. GCC 11+ (~2.5 years old) 1. Clang 14 (~2.5 years old) 1. VS 16.11 (~2 years old) For mobile this means: 1. NDK 26 (still in Beta 😭) 1. XCode 14.3.0 (~6 months old) https://en.cppreference.com/w/cpp/compiler_support/20 That isn't quite doable yet, but we can start taking advantage of language features in the meantime. More of these will be supported in older toolchains. Anyone needing support for older C++ versions can lag behind on more recent changes. E.g. Yoga 2.0 supports C++ 14. bypass-github-export-checks Changelog: [Internal] Differential Revision: https://internalfb.com/D49261607 fbshipit-source-id: 660e510e884c89c0b12e5432dbb19bbb968928b4
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are effectively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). bypass-github-export-checks Changelog: [General][Breaking] - Require C++ 20 when including renderer headers Differential Revision: https://internalfb.com/D49265967 fbshipit-source-id: 8cd943ca329d28d6b4336bf74734bda53916c1ea
Summary: X-link: facebook/react-native#39485 Pull Request resolved: facebook#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are effectively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). bypass-github-export-checks Changelog: [General][Breaking] - Require C++ 20 when including renderer headers Reviewed By: sammy-SC Differential Revision: D49265967 fbshipit-source-id: 7aba8d5c0c296fec571f2e29279648b93eacfbab
This pull request was exported from Phabricator. Differential Revision: D49265967 |
9d1b78d
to
bc1a387
Compare
This pull request has been merged in ea3869f. |
Summary: Pull Request resolved: #39485 X-link: facebook/yoga#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are effectively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). bypass-github-export-checks Changelog: [General][Breaking] - Require C++ 20 when including renderer headers Reviewed By: sammy-SC Differential Revision: D49265967 fbshipit-source-id: 6ab935a866196df06e742c821f3af88eb4d18e1a
Summary: X-link: facebook/react-native#39485 X-link: facebook/yoga#1393 These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables. Setting enum values is a bit jank right now, due to relying on C enums which are effectively int32_t, along with GCC `-Wconversion` being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally). bypass-github-export-checks Changelog: [General][Breaking] - Require C++ 20 when including renderer headers Reviewed By: sammy-SC Differential Revision: D49265967 fbshipit-source-id: 6ab935a866196df06e742c821f3af88eb4d18e1a
Summary:
These were previously packed into structs to allow zero initializing all the flags at once without needing a ctor. C++ 20 has in-class member initializer support for bitfields, which makes these look more like normal member variables.
Setting enum values is a bit jank right now, due to relying on C enums which are efftively int32_t, along with GCC
-Wconversion
being a bit aggressive in needing to explicitly mask. I have some ideas to fix this later (e.g. using scoped enums internally).Differential Revision: D49265967