From 5998a10ae6d20704569a4c4f4de35dd78d4ca163 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 27 Nov 2022 14:04:40 +0100 Subject: clang-tidy fixes part-1 Details - Use 'size_type' instead of 'int', propagate same 'size_type' into 'darray' etc. - Use 'std::make_shared', 'std::make_unique' - Use range-based for loops - Remove redundant 'virtual', use 'override' in derived classes - Use 'nullptr' - Use default impl for dtor, ctor (incomplete) - Use copy and std::move (incomplete) - Explcitly catch std::bad_alloc in 'new' in 'noexcept' -> 'abort' - 'abort' was issued implicitly in noexcept methods - L2CAPServer, L2CAPClient, NopGattServerHandler, DBGattServerHandler, FwdGattServerHandler - Use local close_impl(), usable in virtual destructor - L2CAPClient::read, HCIComm::read - preset 'poll' result 'n', avoid garbage comparison - BTAdapter::enableListening - loop through addMgmtEventCallback() result - JNI code - explicit size_type is cast to jsize or jint w/o check - unchanged semantics --- src/direct_bt/DBGattServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/direct_bt/DBGattServer.cpp') diff --git a/src/direct_bt/DBGattServer.cpp b/src/direct_bt/DBGattServer.cpp index fd37ad6d..80a136e1 100644 --- a/src/direct_bt/DBGattServer.cpp +++ b/src/direct_bt/DBGattServer.cpp @@ -96,7 +96,7 @@ bool DBGattServer::removeListener(ListenerRef l) { ERR_PRINT("Listener ref is null"); return false; } - const int count = listenerList.erase_matching(l, false /* all_matching */, _listenerRefEqComparator); + const auto count = listenerList.erase_matching(l, false /* all_matching */, _listenerRefEqComparator); return count > 0; } -- cgit v1.2.3