Skip to content

Commit cc2e15c

Browse files
authored
Merge pull request #9158 from davidsaada/david_lto_dup_types
Fix LTO build failures due to duplicate local types
2 parents aceeb26 + ec0ebc2 commit cc2e15c

File tree

6 files changed

+33
-9
lines changed

6 files changed

+33
-9
lines changed

components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
#define RFF_TX 0x04
5151
#define RFF_CCA 0x08
5252

53+
namespace {
54+
5355
typedef enum {
5456
RF_MODE_NORMAL = 0,
5557
RF_MODE_SNIFFER = 1,
@@ -82,6 +84,8 @@ typedef enum {
8284
STATE_TRANSITION_IN_PROGRESS = 0x1F
8385
} rf_trx_states_t;
8486

87+
} // anonymous namespace
88+
8589
static const uint8_t *rf_tx_data; // Points to Nanostack's buffer
8690
static uint8_t rf_tx_length;
8791
/*ACK wait duration changes depending on data rate*/

components/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ extern "C" {
6565
#define gXcvrLowPowerState_d gXcvrPwrAutodoze_c
6666
#endif
6767

68+
namespace {
69+
6870
/* MCR20A XCVR states */
6971
typedef enum xcvrState_tag {
7072
gIdle_c,
@@ -106,6 +108,8 @@ typedef enum {
106108
TX_ARET_ON = 0x19
107109
} rf_trx_states_t;
108110

111+
} // anonymous namespace
112+
109113
/*RF receive buffer*/
110114
static uint8_t rf_buffer[RF_BUFFER_SIZE];
111115

features/storage/kvstore/filesystemstore/FileSystemStore.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ static const uint32_t supported_flags = mbed::KVStore::WRITE_ONCE_FLAG;
3939

4040
using namespace mbed;
4141

42+
namespace {
43+
4244
// incremental set handle
4345
typedef struct {
4446
char *key;
@@ -53,6 +55,8 @@ typedef struct {
5355
char *prefix;
5456
} key_iterator_handle_t;
5557

58+
} // anonymous namespace
59+
5660
// Local Functions
5761
static char *string_ndup(const char *src, size_t size);
5862

features/storage/kvstore/securestore/SecureStore.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ static const char *const auth_prefix = "AUTH";
4848

4949
static const uint32_t security_flags = KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG;
5050

51+
namespace {
52+
5153
typedef struct {
5254
uint16_t metadata_size;
5355
uint16_t revision;
@@ -72,6 +74,8 @@ typedef struct {
7274
KVStore::iterator_t underlying_it;
7375
} key_iterator_handle_t;
7476

77+
} // anonymous namespace
78+
7579

7680
// -------------------------------------------------- Local Functions Declaration ----------------------------------------------------
7781

features/storage/kvstore/tdbstore/TDBStore.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ static const uint32_t delete_flag = (1UL << 31);
3333
static const uint32_t internal_flags = delete_flag;
3434
static const uint32_t supported_flags = KVStore::WRITE_ONCE_FLAG;
3535

36+
namespace {
37+
3638
typedef struct {
3739
uint32_t magic;
3840
uint16_t header_size;
@@ -93,6 +95,8 @@ typedef struct {
9395
char *prefix;
9496
} key_iterator_handle_t;
9597

98+
} // anonymous namespace
99+
96100

97101
// -------------------------------------------------- Local Functions Declaration ----------------------------------------------------
98102

features/storage/nvstore/source/nvstore.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
// --------------------------------------------------------- Definitions ----------------------------------------------------------
3232

33+
namespace {
34+
3335
static const uint16_t delete_item_flag = 0x8000;
3436
static const uint16_t set_once_flag = 0x4000;
3537
static const uint16_t header_flag_mask = 0xF000;
@@ -72,6 +74,17 @@ static const int num_write_retries = 16;
7274

7375
static const uint8_t blank_flash_val = 0xFF;
7476

77+
typedef enum {
78+
NVSTORE_AREA_STATE_NONE = 0,
79+
NVSTORE_AREA_STATE_EMPTY,
80+
NVSTORE_AREA_STATE_VALID,
81+
} area_state_e;
82+
83+
static const uint32_t initial_crc = 0xFFFFFFFF;
84+
85+
} // anonymous namespace
86+
87+
7588
// See whether any of these defines are given (by config files)
7689
// If so, this means that that area configuration is given by the user
7790
#if defined(NVSTORE_AREA_1_ADDRESS) || defined(NVSTORE_AREA_1_SIZE) ||\
@@ -95,15 +108,6 @@ NVStore::nvstore_area_data_t NVStore::initial_area_params[] = {{0, 0},
95108
};
96109
#endif
97110

98-
typedef enum {
99-
NVSTORE_AREA_STATE_NONE = 0,
100-
NVSTORE_AREA_STATE_EMPTY,
101-
NVSTORE_AREA_STATE_VALID,
102-
} area_state_e;
103-
104-
static const uint32_t initial_crc = 0xFFFFFFFF;
105-
106-
107111
// -------------------------------------------------- Local Functions Declaration ----------------------------------------------------
108112

109113
// -------------------------------------------------- Functions Implementation ----------------------------------------------------

0 commit comments

Comments
 (0)