Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 204ef4ca authored by Hui Peng's avatar Hui Peng Committed by Gerrit Code Review
Browse files

Merge "Remove duplicate CASE_RETURN_TEXT" into main

parents 4f02634a 4b5f1bce
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include "bta/include/bta_sec_api.h"
#include "bta/sys/bta_sys.h"
#include "include/hardware/bt_av.h"
#include "macros.h"
#include "osi/include/list.h"
#include "stack/include/a2dp_error_codes.h"
#include "stack/include/avdt_api.h"
@@ -40,10 +41,6 @@
#include "types/hci_role.h"
#include "types/raw_address.h"

#define CASE_RETURN_TEXT(code) \
  case code:                   \
    return #code

/*****************************************************************************
 *  Constants
 ****************************************************************************/
+1 −7
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@

#include "bta/include/bta_api.h"
#include "bta/sys/bta_sys.h"
#include "macros.h"
#include "stack/btm/neighbor_inquiry.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/sdp_status.h"
@@ -29,12 +30,6 @@
#include "types/bluetooth/uuid.h"
#include "types/raw_address.h"

#ifndef CASE_RETURN_TEXT
#define CASE_RETURN_TEXT(code) \
  case code:                   \
    return #code
#endif

#define BTA_SERVICE_ID_TO_SERVICE_MASK(id) (1 << (id))

/* DM search events */
@@ -155,7 +150,6 @@ inline std::string bta_dm_state_text(const tBTA_DM_STATE& state) {
      return base::StringPrintf("UNKNOWN[%d]", state);
  }
}
#undef CASE_RETURN_TEXT

/* DM search control block */
typedef struct {
+1 −8
Original line number Diff line number Diff line
@@ -32,17 +32,12 @@
#include "bta/include/bta_api.h"
#include "bta/include/bta_sec_api.h"
#include "bta/sys/bta_sys.h"
#include "macros.h"
#include "stack/btm/neighbor_inquiry.h"
#include "stack/include/sdp_status.h"
#include "stack/sdp/sdp_discovery_db.h"
#include "types/raw_address.h"

#ifndef CASE_RETURN_TEXT
#define CASE_RETURN_TEXT(code) \
  case code:                   \
    return #code
#endif

/*****************************************************************************
 *  Constants and data types
 ****************************************************************************/
@@ -237,8 +232,6 @@ typedef struct {
  alarm_t* switch_delay_timer;
} tBTA_DM_CB;

#undef CASE_RETURN_TEXT

/* DI control block */
typedef struct {
  uint8_t di_num;                     /* total local DI record number */
+3 −7
Original line number Diff line number Diff line
@@ -25,14 +25,14 @@
#ifndef BTA_AG_API_H
#define BTA_AG_API_H

#include "bta_api.h"
#include "bta_hfp_api.h"

#include <string>
#include <vector>

#include "bta/include/bta_ag_api.h"
#include "bta/include/bta_api.h"
#include "bta_api.h"
#include "bta_hfp_api.h"
#include "macros.h"
#include "types/raw_address.h"

/*****************************************************************************
@@ -108,10 +108,6 @@ typedef uint8_t tBTA_AG_STATUS;

#define BTA_AG_HANDLE_SCO_NO_CHANGE 0xFFFF

#define CASE_RETURN_TEXT(code) \
  case code:                   \
    return #code

typedef enum : uint8_t {
  /* AG result codes used with BTA_AgResult */
  BTA_AG_SPK_RES = 0,         /* Update speaker volume */
+1 −13
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@

#include "bt_target.h"  // Must be first to define build configuration
#include "bta_api_data_types.h"
#include "macros.h"
#include "os/log.h"
#include "stack/btm/power_mode.h"
#include "stack/include/bt_name.h"
@@ -123,10 +124,6 @@ inline tBTA_PREF_ROLES toBTA_PREF_ROLES(uint8_t role) {
  return static_cast<tBTA_PREF_ROLES>(role);
}

#define CASE_RETURN_TEXT(code) \
  case code:                   \
    return #code

inline std::string preferred_role_text(const tBTA_PREF_ROLES& role) {
  switch (role) {
    CASE_RETURN_TEXT(BTA_ANY_ROLE);
@@ -137,7 +134,6 @@ inline std::string preferred_role_text(const tBTA_PREF_ROLES& role) {
      return base::StringPrintf("UNKNOWN[%hhu]", role);
  }
}
#undef CASE_RETURN_TEXT

enum {

@@ -227,12 +223,6 @@ typedef enum : uint8_t {
  BTA_DM_NAME_READ_EVT = 8,          /* Name read complete. */
} tBTA_DM_SEARCH_EVT;

#ifndef CASE_RETURN_TEXT
#define CASE_RETURN_TEXT(code) \
  case code:                   \
    return #code
#endif

inline std::string bta_dm_search_evt_text(const tBTA_DM_SEARCH_EVT& event) {
  switch (event) {
    CASE_RETURN_TEXT(BTA_DM_INQ_RES_EVT);
@@ -249,8 +239,6 @@ inline std::string bta_dm_search_evt_text(const tBTA_DM_SEARCH_EVT& event) {
  }
}

#undef CASE_RETURN_TEXT

/* Structure associated with BTA_DM_INQ_RES_EVT */
typedef struct {
  RawAddress bd_addr;          /* BD address peer device. */
Loading