BLE: Warning cleanup

- Missing default assignment operator
- Field order in construction list
- Typo
- Unused header
pull/13475/head
Vincent Coubard 2020-08-21 16:04:19 +01:00
parent c773870d56
commit 41c8c22a96
11 changed files with 18 additions and 37 deletions

View File

@ -507,7 +507,7 @@ public:
void (T::*memberPtr)(const GattReadCallbackParams *context)
)
{
onDataRead({objPtr, memberPtr});
return onDataRead({objPtr, memberPtr});
}
/**

View File

@ -235,6 +235,13 @@ public:
memcpy(baseUUID, source.baseUUID, LENGTH_OF_LONG_UUID);
}
/**
* UUID copy assignment.
*
* @param[in] source The UUID to copy.
*/
UUID& operator=(const UUID &source) = default;
/**
* Default constructor.
*

View File

@ -70,7 +70,7 @@ public:
*/
bool hasNext() const
{
if (position >= data.size()) {
if (position >= (size_t) data.size()) {
return false;
}
@ -79,7 +79,7 @@ public:
return false;
}
if (position + current_length() >= data.size()) {
if (position + current_length() >= (size_t) data.size()) {
return false;
}

View File

@ -344,7 +344,7 @@ public:
Span<SecurityEntryIdentity_t>& identity_list
) {
size_t count = 0;
for (size_t i = 0; i < get_entry_count() && count < identity_list.size(); ++i) {
for (size_t i = 0; i < get_entry_count() && count < (size_t) identity_list.size(); ++i) {
entry_handle_t db_handle = get_entry_handle_by_index(i);
SecurityDistributionFlags_t* flags = get_distribution_flags(db_handle);

View File

@ -17,8 +17,8 @@
#include <stddef.h>
#include <string.h>
#include "ble/internal/BLEInstanceBase.h"
#include "ble/BLE.h"
#include "ble/internal/BLEInstanceBase.h"
#include "ble/Gap.h"
#include "CordioHCIDriver.h"
#include "hci_api.h"

View File

@ -29,7 +29,7 @@ namespace ble {
*/
class PalGap : public interface::PalGap {
public:
PalGap() : use_active_scanning(false), _pal_event_handler(NULL) { };
PalGap() : _pal_event_handler(NULL), use_active_scanning(false) { };
~PalGap() { };
bool is_feature_supported(

View File

@ -454,7 +454,8 @@ private:
PalSecurityManager &palImpl,
PalConnectionMonitor &connMonitorImpl,
PalSigningMonitor &signingMonitorImpl
) : _pal(palImpl),
) : eventHandler(nullptr),
_pal(palImpl),
_connection_monitor(connMonitorImpl),
_signing_monitor(signingMonitorImpl),
_db(NULL),
@ -462,8 +463,7 @@ private:
_default_key_distribution(KeyDistribution::KEY_DISTRIBUTION_ALL),
_pairing_authorisation_required(false),
_legacy_pairing_allowed(true),
_master_sends_keys(false),
eventHandler(NULL)
_master_sends_keys(false)
{
eventHandler = &defaultEventHandler;
_pal.set_event_handler(this);

View File

@ -1688,15 +1688,6 @@ void GattClient::onShutdown(const GattClientShutdownCallback_t &callback)
shutdownCallChain.add(callback);
}
/**
* @see GattClient::onShutdown
*/
template<typename T>
void GattClient::onShutdown(T *objPtr, void (T::*memberPtr)(const GattClient *))
{
shutdownCallChain.add(objPtr, memberPtr);
}
/**
* @see GattClient::onShutdown
*/

View File

@ -1384,9 +1384,9 @@ bool GattServer::is_update_authorized(
}
GattServer::GattServer() :
eventHandler(nullptr),
serviceCount(0),
characteristicCount(0),
eventHandler(nullptr),
dataSentCallChain(),
dataWrittenCallChain(),
dataReadCallChain(),

View File

@ -16,6 +16,7 @@
* limitations under the License.
*/
#include "ble/BLE.h"
#include "ble/common/ble/DiscoveredCharacteristic.h"
#include "ble/GattClient.h"

View File

@ -15,24 +15,6 @@
* limitations under the License.
*/
/* mbed Microcontroller Library
* Copyright (c) 2006-2020 ARM Limited
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "ble/GattClient.h"
#include "ble/internal/GattClientImpl.h"