Skip to content

Commit

Permalink
Fix clang-tidy/clazy findings.
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Lorenz <[email protected]>
  • Loading branch information
tobylorenz committed Jun 7, 2023
1 parent 6d4c1e1 commit 27dadfc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/bluez-dbus-cpp/GattApplication1.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class GattApplication1 :
public:
void addService( std::shared_ptr<GattService1> service )
{
for( auto serv : services_ )
for( const auto & serv : services_ )
{
if( serv == service )
throw std::invalid_argument(std::string("GattApplication::addService '") + service->getPath() + std::string("' already registered!"));
Expand Down
14 changes: 7 additions & 7 deletions src/GattCharacteristic1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ void GattCharacteristic1::addFlag( std::string flag )

// ---- Default Handlers -------------------------------------------------------

std::vector<uint8_t> GattCharacteristic1::ReadValue(const std::map<std::string, sdbus::Variant>& options)
std::vector<uint8_t> GattCharacteristic1::ReadValue(const std::map<std::string, sdbus::Variant>& /*options*/)
{
return value_;
}

void GattCharacteristic1::WriteValue(const std::vector<uint8_t>& value, const std::map<std::string, sdbus::Variant>& options)
void GattCharacteristic1::WriteValue(const std::vector<uint8_t>& value, const std::map<std::string, sdbus::Variant>& /*options*/)
{
value_ = value;
}
Expand All @@ -122,22 +122,22 @@ std::map<sdbus::ObjectPath, std::vector<std::vector<uint8_t>>> GattCharacteristi
throw sdbus::Error("org.bluez.Error.NotSupported", "Property 'GattCharacteristic1::DirectedValue' not overloaded!");
}

std::tuple<sdbus::UnixFd, uint16_t> GattCharacteristic1::AcquireWrite(const std::map<std::string, sdbus::Variant>& options)
std::tuple<sdbus::UnixFd, uint16_t> GattCharacteristic1::AcquireWrite(const std::map<std::string, sdbus::Variant>& /*options*/)
{
throw sdbus::Error("org.bluez.Error.NotSupported", "Method 'GattCharacteristic1::AcquireWrite' not overloaded!");
}

std::tuple<sdbus::UnixFd, uint16_t> GattCharacteristic1::AcquireNotify(const std::map<std::string, sdbus::Variant>& options)
std::tuple<sdbus::UnixFd, uint16_t> GattCharacteristic1::AcquireNotify(const std::map<std::string, sdbus::Variant>& /*options*/)
{
throw sdbus::Error("org.bluez.Error.NotSupported", "Method 'GattCharacteristic1::AcquireNotify' not overloaded!");
}

void GattCharacteristic1::StartNotify(const std::map<std::string, sdbus::Variant>& options)
void GattCharacteristic1::StartNotify(const std::map<std::string, sdbus::Variant>& /*options*/)
{
notifyingSessions_ += 1;
}

void GattCharacteristic1::StopNotify(const std::map<std::string, sdbus::Variant>& options)
void GattCharacteristic1::StopNotify(const std::map<std::string, sdbus::Variant>& /*options*/)
{
notifyingSessions_ -= 1;
}
Expand All @@ -152,7 +152,7 @@ void GattCharacteristic1::addDescriptor( std::shared_ptr<GattDescriptor1> descri
{
const std::string& descPath = descriptor->getPath();

for( auto path : includes_ )
for( const auto & path : includes_ )
{
if( path == descPath )
throw std::invalid_argument(std::string("GattCharacteristic1::addDescriptor '") + descPath + std::string("' already registered!"));
Expand Down
4 changes: 2 additions & 2 deletions src/GattService1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ GattService1::~GattService1()

void GattService1::addCharacteristic( std::shared_ptr<GattCharacteristic1> characteristic )
{
for( auto chrc : characteristics_ )
for( const auto & chrc : characteristics_ )
{
if( chrc == characteristic )
throw std::invalid_argument(std::string("GattService1::addCharacteristic '") + characteristic->getPath() + std::string("' already registered!"));
Expand All @@ -78,7 +78,7 @@ void GattService1::addSubService( std::shared_ptr<GattService1> service )
{
const std::string& srvPath = service->getPath();

for( auto path : includes_ )
for( const auto & path : includes_ )
{
if( path == srvPath )
throw std::invalid_argument(std::string("GattService1::addSubService '") + srvPath + std::string("' already registered!"));
Expand Down

0 comments on commit 27dadfc

Please sign in to comment.