-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Expand use of type-safe BitFlags
and enum class
.
#5319
Merged
bzbarsky-apple
merged 1 commit into
project-chip:master
from
kpschoedel:bitflags-reland
Mar 11, 2021
Merged
Expand use of type-safe BitFlags
and enum class
.
#5319
bzbarsky-apple
merged 1 commit into
project-chip:master
from
kpschoedel:bitflags-reland
Mar 11, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- `BitFlags.h` has relatively unsafe deprecated functions. - Some bit flags use `enum` rather than type-safe `enum class`. #### Summary of Changes - Removed deprecated `SetFlags()`, `ClearFlags()`, and `GetFlags()`, replacing uses with `BitFlags`. - BitFlags.h changes: - Default to use `std::underlying_type` rather than requiring it as a template parameter. - Added `BitFlags` operations to reduce uses of type-unsafe `Raw()` and `SetRaw()`: - Multi-argument constructors. - `operator FlagsEnum()`. - `ClearAll()`. - `HasAny()` and `HasAll()`, following the pattern of the existing `HasOnly()`. - Binary `&`. - Converted various bit flag types from `enum` to `enum class`: - BLEEndPoint::ConnectionStateFlags - BLEEndPoint::TimerStateFlags - BLEManagerImpl::Flags - Command::CommandPathFlags - Encoding::HexFlags - GenericConfigurationManagerImpl::Flags - GenericConnectivityManagerImpl_Thread::Flags - GenericConnectivityManagerImpl_WiFi::ConnectivityFlags - bdx::RangeControlFlags - bdx::StatusCode - bdx::TransferControlFlags - bdx::TransferRole Reland of 4b8d558 (project-chip#5232) to a logic error in `*/BLEManagerImpl.cpp` and a large accidental deletion in `K32W/BLEManagerImpl.cpp`.
Thanks to @mspang for catching this. |
pullapprove
bot
requested review from
andy31415,
bzbarsky-apple,
chrisdecenzo,
Damian-Nordic,
hawk248,
jelderton,
jepenven-silabs,
jmartinez-silabs,
kedars,
LuDuda,
msandstedt,
mspang,
rwalker-apple,
saurabhst and
woody-apple
March 11, 2021 15:16
Size increase report for "gn_qpg6100-example-build" from e4ab6f4
Full report output
|
Size increase report for "esp32-example-build" from e4ab6f4
Full report output
|
Size increase report for "nrfconnect-example-build" from e4ab6f4
Full report output
|
mspang
approved these changes
Mar 11, 2021
msandstedt
approved these changes
Mar 11, 2021
bzbarsky-apple
approved these changes
Mar 11, 2021
Damian-Nordic
pushed a commit
to Damian-Nordic/connectedhomeip
that referenced
this pull request
Mar 18, 2021
- `BitFlags.h` has relatively unsafe deprecated functions. - Some bit flags use `enum` rather than type-safe `enum class`. #### Summary of Changes - Removed deprecated `SetFlags()`, `ClearFlags()`, and `GetFlags()`, replacing uses with `BitFlags`. - BitFlags.h changes: - Default to use `std::underlying_type` rather than requiring it as a template parameter. - Added `BitFlags` operations to reduce uses of type-unsafe `Raw()` and `SetRaw()`: - Multi-argument constructors. - `operator FlagsEnum()`. - `ClearAll()`. - `HasAny()` and `HasAll()`, following the pattern of the existing `HasOnly()`. - Binary `&`. - Converted various bit flag types from `enum` to `enum class`: - BLEEndPoint::ConnectionStateFlags - BLEEndPoint::TimerStateFlags - BLEManagerImpl::Flags - Command::CommandPathFlags - Encoding::HexFlags - GenericConfigurationManagerImpl::Flags - GenericConnectivityManagerImpl_Thread::Flags - GenericConnectivityManagerImpl_WiFi::ConnectivityFlags - bdx::RangeControlFlags - bdx::StatusCode - bdx::TransferControlFlags - bdx::TransferRole Reland of 4b8d558 (project-chip#5232) to a logic error in `*/BLEManagerImpl.cpp` and a large accidental deletion in `K32W/BLEManagerImpl.cpp`.
kpschoedel
added a commit
to kpschoedel/connectedhomeip
that referenced
this pull request
Apr 1, 2021
#### Problem TI cc13x2_26x2 does not build. Followup from 8ea423a (PR project-chip#5319) #### Summary of Changes Convert `BLEManagerImpl` `mFlags` to use `enum class` and `BitFlags`.
mspang
pushed a commit
that referenced
this pull request
Apr 1, 2021
jimlyall-q
pushed a commit
to jimlyall-q/connectedhomeip
that referenced
this pull request
Apr 13, 2021
#### Problem TI cc13x2_26x2 does not build. Followup from 8ea423a (PR project-chip#5319) #### Summary of Changes Convert `BLEManagerImpl` `mFlags` to use `enum class` and `BitFlags`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
BitFlags.h
has relatively unsafe deprecated functions.enum
rather than type-safeenum class
.Summary of Changes
Removed deprecated
SetFlags()
,ClearFlags()
, andGetFlags()
,replacing uses with
BitFlags
.BitFlags.h changes:
std::underlying_type
rather than requiring it as a template parameter.BitFlags
operations to reduce uses of type-unsafeRaw()
andSetRaw()
:operator FlagsEnum()
.ClearAll()
.HasAny()
andHasAll()
, following the pattern of the existingHasOnly()
.&
.Converted various bit flag types from
enum
toenum class
:Reland of 4b8d558 (#5232) due to a logic error in
*/BLEManagerImpl.cpp
and a largeaccidental deletion in
K32W/BLEManagerImpl.cpp
.