Loading system/btif/src/btif_storage.cc +1 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ (p).type = (t); \ (p).val = (v); \ (p).len = (l); \ s = btif_storage_get_adapter_property(&(p)); \ (s) = btif_storage_get_adapter_property(&(p)); \ } while (0) // TODO: This macro should be converted to a function Loading system/osi/test/leaky_bonded_queue_test.cc +4 −4 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ using system_bt_osi::LeakyBondedQueue; #define ITEM_EQ(a, b) \ do { \ EXPECT_EQ(a, b); \ EXPECT_EQ(a->index, b->index); \ EXPECT_EQ((a)->index, (b)->index); \ } while (0) class Item { Loading system/osi/test/metrics_test.cc +13 −13 Original line number Diff line number Diff line Loading @@ -172,17 +172,17 @@ void GenerateWakeEvents(size_t start, size_t end, #define COMPARE_A2DP_METRICS(a, b) \ do { \ EXPECT_EQ(a.audio_duration_ms, b.audio_duration_ms); \ EXPECT_EQ(a.media_timer_min_ms, b.media_timer_min_ms); \ EXPECT_EQ(a.media_timer_max_ms, b.media_timer_max_ms); \ EXPECT_EQ(a.media_timer_avg_ms, b.media_timer_avg_ms); \ EXPECT_EQ(a.total_scheduling_count, b.total_scheduling_count); \ EXPECT_EQ(a.buffer_overruns_max_count, b.buffer_overruns_max_count); \ EXPECT_EQ(a.buffer_overruns_total, b.buffer_overruns_total); \ EXPECT_THAT(a.buffer_underruns_average, \ FloatNear(b.buffer_underruns_average, 0.01)); \ a.buffer_underruns_average = b.buffer_underruns_average; \ EXPECT_EQ(a.buffer_underruns_count, b.buffer_underruns_count); \ EXPECT_EQ((a).audio_duration_ms, (b).audio_duration_ms); \ EXPECT_EQ((a).media_timer_min_ms, (b).media_timer_min_ms); \ EXPECT_EQ((a).media_timer_max_ms, (b).media_timer_max_ms); \ EXPECT_EQ((a).media_timer_avg_ms, (b).media_timer_avg_ms); \ EXPECT_EQ((a).total_scheduling_count, (b).total_scheduling_count); \ EXPECT_EQ((a).buffer_overruns_max_count, (b).buffer_overruns_max_count); \ EXPECT_EQ((a).buffer_overruns_total, (b).buffer_overruns_total); \ EXPECT_THAT((a).buffer_underruns_average, \ FloatNear((b).buffer_underruns_average, 0.01)); \ (a).buffer_underruns_average = (b).buffer_underruns_average; \ EXPECT_EQ((a).buffer_underruns_count, (b).buffer_underruns_count); \ } while (0) /* Loading system/stack/include/a2dp_codec_api.h +8 −7 Original line number Diff line number Diff line Loading @@ -650,29 +650,30 @@ bool A2DP_DumpCodecInfo(const uint8_t* p_codec_info); // Add enum-based flag operators to the btav_a2dp_codec_config_t fields #ifndef DEFINE_ENUM_FLAG_OPERATORS // Use NOLINT to suppress missing parentheses warnings around bitmask. #define DEFINE_ENUM_FLAG_OPERATORS(bitmask) \ extern "C++" { \ inline constexpr bitmask operator&(bitmask X, bitmask Y) { \ inline constexpr bitmask operator&(bitmask X, bitmask Y) { /* NOLINT */ \ return static_cast<bitmask>(static_cast<int>(X) & static_cast<int>(Y)); \ } \ inline constexpr bitmask operator|(bitmask X, bitmask Y) { \ inline constexpr bitmask operator|(bitmask X, bitmask Y) { /* NOLINT */ \ return static_cast<bitmask>(static_cast<int>(X) | static_cast<int>(Y)); \ } \ inline constexpr bitmask operator^(bitmask X, bitmask Y) { \ inline constexpr bitmask operator^(bitmask X, bitmask Y) { /* NOLINT */ \ return static_cast<bitmask>(static_cast<int>(X) ^ static_cast<int>(Y)); \ } \ inline constexpr bitmask operator~(bitmask X) { \ inline constexpr bitmask operator~(bitmask X) { /* NOLINT */ \ return static_cast<bitmask>(~static_cast<int>(X)); \ } \ inline bitmask& operator&=(bitmask& X, bitmask Y) { \ inline bitmask& operator&=(bitmask& X, bitmask Y) { /* NOLINT */ \ X = X & Y; \ return X; \ } \ inline bitmask& operator|=(bitmask& X, bitmask Y) { \ inline bitmask& operator|=(bitmask& X, bitmask Y) { /* NOLINT */ \ X = X | Y; \ return X; \ } \ inline bitmask& operator^=(bitmask& X, bitmask Y) { \ inline bitmask& operator^=(bitmask& X, bitmask Y) { /* NOLINT */ \ X = X ^ Y; \ return X; \ } \ Loading system/stack/include/bt_types.h +4 −4 Original line number Diff line number Diff line Loading @@ -326,7 +326,7 @@ typedef struct { #define STREAM_TO_INT8(u8, p) \ { \ (u8) = (*((int8_t*)p)); \ (u8) = (*((int8_t*)(p))); \ (p) += 1; \ } #define STREAM_TO_UINT8(u8, p) \ Loading Loading
system/btif/src/btif_storage.cc +1 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ (p).type = (t); \ (p).val = (v); \ (p).len = (l); \ s = btif_storage_get_adapter_property(&(p)); \ (s) = btif_storage_get_adapter_property(&(p)); \ } while (0) // TODO: This macro should be converted to a function Loading
system/osi/test/leaky_bonded_queue_test.cc +4 −4 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ using system_bt_osi::LeakyBondedQueue; #define ITEM_EQ(a, b) \ do { \ EXPECT_EQ(a, b); \ EXPECT_EQ(a->index, b->index); \ EXPECT_EQ((a)->index, (b)->index); \ } while (0) class Item { Loading
system/osi/test/metrics_test.cc +13 −13 Original line number Diff line number Diff line Loading @@ -172,17 +172,17 @@ void GenerateWakeEvents(size_t start, size_t end, #define COMPARE_A2DP_METRICS(a, b) \ do { \ EXPECT_EQ(a.audio_duration_ms, b.audio_duration_ms); \ EXPECT_EQ(a.media_timer_min_ms, b.media_timer_min_ms); \ EXPECT_EQ(a.media_timer_max_ms, b.media_timer_max_ms); \ EXPECT_EQ(a.media_timer_avg_ms, b.media_timer_avg_ms); \ EXPECT_EQ(a.total_scheduling_count, b.total_scheduling_count); \ EXPECT_EQ(a.buffer_overruns_max_count, b.buffer_overruns_max_count); \ EXPECT_EQ(a.buffer_overruns_total, b.buffer_overruns_total); \ EXPECT_THAT(a.buffer_underruns_average, \ FloatNear(b.buffer_underruns_average, 0.01)); \ a.buffer_underruns_average = b.buffer_underruns_average; \ EXPECT_EQ(a.buffer_underruns_count, b.buffer_underruns_count); \ EXPECT_EQ((a).audio_duration_ms, (b).audio_duration_ms); \ EXPECT_EQ((a).media_timer_min_ms, (b).media_timer_min_ms); \ EXPECT_EQ((a).media_timer_max_ms, (b).media_timer_max_ms); \ EXPECT_EQ((a).media_timer_avg_ms, (b).media_timer_avg_ms); \ EXPECT_EQ((a).total_scheduling_count, (b).total_scheduling_count); \ EXPECT_EQ((a).buffer_overruns_max_count, (b).buffer_overruns_max_count); \ EXPECT_EQ((a).buffer_overruns_total, (b).buffer_overruns_total); \ EXPECT_THAT((a).buffer_underruns_average, \ FloatNear((b).buffer_underruns_average, 0.01)); \ (a).buffer_underruns_average = (b).buffer_underruns_average; \ EXPECT_EQ((a).buffer_underruns_count, (b).buffer_underruns_count); \ } while (0) /* Loading
system/stack/include/a2dp_codec_api.h +8 −7 Original line number Diff line number Diff line Loading @@ -650,29 +650,30 @@ bool A2DP_DumpCodecInfo(const uint8_t* p_codec_info); // Add enum-based flag operators to the btav_a2dp_codec_config_t fields #ifndef DEFINE_ENUM_FLAG_OPERATORS // Use NOLINT to suppress missing parentheses warnings around bitmask. #define DEFINE_ENUM_FLAG_OPERATORS(bitmask) \ extern "C++" { \ inline constexpr bitmask operator&(bitmask X, bitmask Y) { \ inline constexpr bitmask operator&(bitmask X, bitmask Y) { /* NOLINT */ \ return static_cast<bitmask>(static_cast<int>(X) & static_cast<int>(Y)); \ } \ inline constexpr bitmask operator|(bitmask X, bitmask Y) { \ inline constexpr bitmask operator|(bitmask X, bitmask Y) { /* NOLINT */ \ return static_cast<bitmask>(static_cast<int>(X) | static_cast<int>(Y)); \ } \ inline constexpr bitmask operator^(bitmask X, bitmask Y) { \ inline constexpr bitmask operator^(bitmask X, bitmask Y) { /* NOLINT */ \ return static_cast<bitmask>(static_cast<int>(X) ^ static_cast<int>(Y)); \ } \ inline constexpr bitmask operator~(bitmask X) { \ inline constexpr bitmask operator~(bitmask X) { /* NOLINT */ \ return static_cast<bitmask>(~static_cast<int>(X)); \ } \ inline bitmask& operator&=(bitmask& X, bitmask Y) { \ inline bitmask& operator&=(bitmask& X, bitmask Y) { /* NOLINT */ \ X = X & Y; \ return X; \ } \ inline bitmask& operator|=(bitmask& X, bitmask Y) { \ inline bitmask& operator|=(bitmask& X, bitmask Y) { /* NOLINT */ \ X = X | Y; \ return X; \ } \ inline bitmask& operator^=(bitmask& X, bitmask Y) { \ inline bitmask& operator^=(bitmask& X, bitmask Y) { /* NOLINT */ \ X = X ^ Y; \ return X; \ } \ Loading
system/stack/include/bt_types.h +4 −4 Original line number Diff line number Diff line Loading @@ -326,7 +326,7 @@ typedef struct { #define STREAM_TO_INT8(u8, p) \ { \ (u8) = (*((int8_t*)p)); \ (u8) = (*((int8_t*)(p))); \ (p) += 1; \ } #define STREAM_TO_UINT8(u8, p) \ Loading