Skip to content

Commit

Permalink
pw_chre: Update atomic_init references
Browse files Browse the repository at this point in the history
atomic_init is deprecated in c++20 so replace these with
the normal operator.

Bug: b/364953984
Change-Id: I7e7182440bbfa568d89b5cd26c8b2d9c82b7f988
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234771
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Commit-Queue: David Gilhooley <dgilhooley@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
  • Loading branch information
gilhooleyd authored and CQ Bot Account committed Sep 9, 2024
1 parent a8cc6bf commit dbda5bd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pw_chre/include/chre/target_platform/atomic_base_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

namespace chre {

inline AtomicBool::AtomicBool(bool starting_value) {
std::atomic_init(&atomic_, starting_value);
}
inline AtomicBool::AtomicBool(bool starting_value) { atomic_ = starting_value; }

inline bool AtomicBool::operator=(bool desired) { return atomic_ = desired; }

Expand All @@ -33,7 +31,7 @@ inline bool AtomicBool::exchange(bool desired) {
}

inline AtomicUint32::AtomicUint32(uint32_t startingValue) {
std::atomic_init(&atomic_, startingValue);
atomic_ = startingValue;
}

inline uint32_t AtomicUint32::operator=(uint32_t desired) {
Expand Down

0 comments on commit dbda5bd

Please sign in to comment.