From: Marcin Siodelski Date: Fri, 6 Mar 2015 19:32:38 +0000 (+0100) Subject: [3736] Suppress the cppcheck passedByValue in the perfdhcp. X-Git-Tag: trac3764_base~14^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=355c38737f8bf24208b3af0dbf1fc5f1e15072f6;p=thirdparty%2Fkea.git [3736] Suppress the cppcheck passedByValue in the perfdhcp. --- diff --git a/src/bin/perfdhcp/test_control.cc b/src/bin/perfdhcp/test_control.cc index 8bd5196b42..331ffdcb2c 100644 --- a/src/bin/perfdhcp/test_control.cc +++ b/src/bin/perfdhcp/test_control.cc @@ -589,7 +589,7 @@ TestControl::getRequestedIpOffset() const { } uint64_t -TestControl::getRcvdPacketsNum(const ExchangeType xchg_type) const { +TestControl::getRcvdPacketsNum(ExchangeType xchg_type) const { uint8_t ip_version = CommandOptions::instance().getIpVersion(); if (ip_version == 4) { return (stats_mgr4_->getRcvdPacketsNum(xchg_type)); @@ -599,7 +599,7 @@ TestControl::getRcvdPacketsNum(const ExchangeType xchg_type) const { } uint64_t -TestControl::getSentPacketsNum(const ExchangeType xchg_type) const { +TestControl::getSentPacketsNum(ExchangeType xchg_type) const { uint8_t ip_version = CommandOptions::instance().getIpVersion(); if (ip_version == 4) { return (stats_mgr4_->getSentPacketsNum(xchg_type)); diff --git a/src/bin/perfdhcp/test_control.h b/src/bin/perfdhcp/test_control.h index a0746a0ee0..9f28b7e13d 100644 --- a/src/bin/perfdhcp/test_control.h +++ b/src/bin/perfdhcp/test_control.h @@ -989,18 +989,30 @@ protected: /// Get the number of received packets from the Statistics Manager. /// Function may throw if Statistics Manager object is not /// initialized. + /// + /// \note The method parameter is non-const to suppress the cppcheck + /// warning about the object being passed by value. However, passing + /// an enum by reference doesn't make much sense. At the same time, + /// removing the constness should be pretty safe for this function. + /// /// \param xchg_type packet exchange type. /// \return number of received packets. - uint64_t getRcvdPacketsNum(const ExchangeType xchg_type) const; + uint64_t getRcvdPacketsNum(ExchangeType xchg_type) const; /// \brief Get number of sent packets. /// /// Get the number of sent packets from the Statistics Manager. /// Function may throw if Statistics Manager object is not /// initialized. + /// + /// \note The method parameter is non-const to suppress the cppcheck + /// warning about the object being passed by value. However, passing + /// an enum by reference doesn't make much sense. At the same time, + /// removing the constness should be pretty safe for this function. + /// /// \param xchg_type packet exchange type. /// \return number of sent packets. - uint64_t getSentPacketsNum(const ExchangeType xchg_type) const; + uint64_t getSentPacketsNum(ExchangeType xchg_type) const; /// \brief Handle child signal. ///