Skip to content

Commit 41c8c22

Browse files
committed
BLE: Warning cleanup
- Missing default assignment operator - Field order in construction list - Typo - Unused header
1 parent c773870 commit 41c8c22

File tree

11 files changed

+18
-37
lines changed

11 files changed

+18
-37
lines changed

connectivity/FEATURE_BLE/include/ble/GattServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ class GattServer {
507507
void (T::*memberPtr)(const GattReadCallbackParams *context)
508508
)
509509
{
510-
onDataRead({objPtr, memberPtr});
510+
return onDataRead({objPtr, memberPtr});
511511
}
512512

513513
/**

connectivity/FEATURE_BLE/include/ble/common/ble/UUID.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@ class UUID {
235235
memcpy(baseUUID, source.baseUUID, LENGTH_OF_LONG_UUID);
236236
}
237237

238+
/**
239+
* UUID copy assignment.
240+
*
241+
* @param[in] source The UUID to copy.
242+
*/
243+
UUID& operator=(const UUID &source) = default;
244+
238245
/**
239246
* Default constructor.
240247
*

connectivity/FEATURE_BLE/include/ble/common/ble/gap/AdvertisingDataParser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class AdvertisingDataParser {
7070
*/
7171
bool hasNext() const
7272
{
73-
if (position >= data.size()) {
73+
if (position >= (size_t) data.size()) {
7474
return false;
7575
}
7676

@@ -79,7 +79,7 @@ class AdvertisingDataParser {
7979
return false;
8080
}
8181

82-
if (position + current_length() >= data.size()) {
82+
if (position + current_length() >= (size_t) data.size()) {
8383
return false;
8484
}
8585

connectivity/FEATURE_BLE/include/ble/internal/SecurityDb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class SecurityDb {
344344
Span<SecurityEntryIdentity_t>& identity_list
345345
) {
346346
size_t count = 0;
347-
for (size_t i = 0; i < get_entry_count() && count < identity_list.size(); ++i) {
347+
for (size_t i = 0; i < get_entry_count() && count < (size_t) identity_list.size(); ++i) {
348348

349349
entry_handle_t db_handle = get_entry_handle_by_index(i);
350350
SecurityDistributionFlags_t* flags = get_distribution_flags(db_handle);

connectivity/FEATURE_BLE/libraries/TARGET_CORDIO/driver/CordioHCIDriver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#include <stddef.h>
1818
#include <string.h>
1919

20-
#include "ble/internal/BLEInstanceBase.h"
2120
#include "ble/BLE.h"
21+
#include "ble/internal/BLEInstanceBase.h"
2222
#include "ble/Gap.h"
2323
#include "CordioHCIDriver.h"
2424
#include "hci_api.h"

connectivity/FEATURE_BLE/libraries/TARGET_CORDIO/include/ble/internal/PalGapImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace ble {
2929
*/
3030
class PalGap : public interface::PalGap {
3131
public:
32-
PalGap() : use_active_scanning(false), _pal_event_handler(NULL) { };
32+
PalGap() : _pal_event_handler(NULL), use_active_scanning(false) { };
3333
~PalGap() { };
3434

3535
bool is_feature_supported(

connectivity/FEATURE_BLE/libraries/ble-api-implementation/include/ble/internal/SecurityManagerImpl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,16 +454,16 @@ class SecurityManager :
454454
PalSecurityManager &palImpl,
455455
PalConnectionMonitor &connMonitorImpl,
456456
PalSigningMonitor &signingMonitorImpl
457-
) : _pal(palImpl),
457+
) : eventHandler(nullptr),
458+
_pal(palImpl),
458459
_connection_monitor(connMonitorImpl),
459460
_signing_monitor(signingMonitorImpl),
460461
_db(NULL),
461462
_default_authentication(0),
462463
_default_key_distribution(KeyDistribution::KEY_DISTRIBUTION_ALL),
463464
_pairing_authorisation_required(false),
464465
_legacy_pairing_allowed(true),
465-
_master_sends_keys(false),
466-
eventHandler(NULL)
466+
_master_sends_keys(false)
467467
{
468468
eventHandler = &defaultEventHandler;
469469
_pal.set_event_handler(this);

connectivity/FEATURE_BLE/libraries/ble-api-implementation/source/GattClientImpl.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,15 +1688,6 @@ void GattClient::onShutdown(const GattClientShutdownCallback_t &callback)
16881688
shutdownCallChain.add(callback);
16891689
}
16901690

1691-
/**
1692-
* @see GattClient::onShutdown
1693-
*/
1694-
template<typename T>
1695-
void GattClient::onShutdown(T *objPtr, void (T::*memberPtr)(const GattClient *))
1696-
{
1697-
shutdownCallChain.add(objPtr, memberPtr);
1698-
}
1699-
17001691
/**
17011692
* @see GattClient::onShutdown
17021693
*/

connectivity/FEATURE_BLE/libraries/ble-api-implementation/source/GattServerImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,9 +1384,9 @@ bool GattServer::is_update_authorized(
13841384
}
13851385

13861386
GattServer::GattServer() :
1387+
eventHandler(nullptr),
13871388
serviceCount(0),
13881389
characteristicCount(0),
1389-
eventHandler(nullptr),
13901390
dataSentCallChain(),
13911391
dataWrittenCallChain(),
13921392
dataReadCallChain(),

connectivity/FEATURE_BLE/source/DiscoveredCharacteristic.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19+
#include "ble/BLE.h"
1920
#include "ble/common/ble/DiscoveredCharacteristic.h"
2021
#include "ble/GattClient.h"
2122

0 commit comments

Comments
 (0)