From a3a6c8e0525ffdeeb1b773f0d388bbb84eb2f0a2 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Thu, 11 Jul 2024 23:54:48 +0000 Subject: [PATCH] Remove usage of ATOMIC_VAR_INIT. The use of the macro ATOMIC_VAR_INIT is not necessary and is causing warnings about it being deprecated. So remove it. Test: Compiles without any warnings. Change-Id: I137ffd0a7cf9a24c2c7ddea5c30f310722f57b98 --- libcutils/trace-dev.inc | 6 +++--- libcutils/trace-host.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libcutils/trace-dev.inc b/libcutils/trace-dev.inc index 94945ec7d..3bc6dc343 100644 --- a/libcutils/trace-dev.inc +++ b/libcutils/trace-dev.inc @@ -49,17 +49,17 @@ constexpr uint32_t kSeqNoNotInit = static_cast(-1); -atomic_bool atrace_is_ready = ATOMIC_VAR_INIT(false); +atomic_bool atrace_is_ready = false; int atrace_marker_fd = -1; uint64_t atrace_enabled_tags = ATRACE_TAG_NOT_READY; -static atomic_bool atrace_is_enabled = ATOMIC_VAR_INIT(true); +static atomic_bool atrace_is_enabled = true; static pthread_mutex_t atrace_tags_mutex = PTHREAD_MUTEX_INITIALIZER; /** * Sequence number of debug.atrace.tags.enableflags the last time the enabled * tags were reloaded. **/ -static _Atomic(uint32_t) last_sequence_number = ATOMIC_VAR_INIT(kSeqNoNotInit); +static _Atomic(uint32_t) last_sequence_number = kSeqNoNotInit; #if defined(__BIONIC__) // All zero prop_info that has a sequence number of 0. This is easier than diff --git a/libcutils/trace-host.cpp b/libcutils/trace-host.cpp index 2bf57ebbe..c45d0675c 100644 --- a/libcutils/trace-host.cpp +++ b/libcutils/trace-host.cpp @@ -16,7 +16,7 @@ #include -atomic_bool atrace_is_ready = ATOMIC_VAR_INIT(true); +atomic_bool atrace_is_ready = true; int atrace_marker_fd = -1; uint64_t atrace_enabled_tags = 0;