Browse Source

merged trac #409 (use a C++ feature for omitting unused parameters instead of compiler dependent "UNUSED_PARAM")

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@3498 e5f2f494-b856-4b98-b285-d166d9295462
JINMEI Tatuya 14 years ago
parent
commit
0c6ed3db6d

+ 0 - 2
configure.ac

@@ -206,7 +206,6 @@ fi
 # gcc specific settings:
 if test "X$GXX" = "Xyes"; then
 B10_CXXFLAGS="-Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
-UNUSED_PARAM_ATTRIBUTE='__attribute__((unused))'
 
 # Certain versions of gcc (g++) have a bug that incorrectly warns about
 # the use of anonymous name spaces even if they're closed in a single
@@ -225,7 +224,6 @@ CXXFLAGS="$CXXFLAGS_SAVED"
 fi				dnl GXX = yes
 
 AM_CONDITIONAL(GCC_WERROR_OK, test $werror_ok = 1)
-AC_DEFINE_UNQUOTED(UNUSED_PARAM, $UNUSED_PARAM_ATTRIBUTE, Define to compiler keyword indicating a function argument is intentionally unused)
 
 # produce PIC unless we disable shared libraries. need this for python bindings.
 if test $enable_shared != "no" -a "X$GXX" = "Xyes"; then

+ 1 - 3
src/bin/auth/asio_link.cc

@@ -505,9 +505,7 @@ public:
         }
     }
 
-    void sendCompleted(const asio::error_code& error UNUSED_PARAM,
-                       size_t bytes_sent UNUSED_PARAM)
-    {
+    void sendCompleted(const asio::error_code&, size_t) {
         // Even if error occurred there's nothing to do.  Simply handle
         // the next request.
         startReceive();

+ 12 - 21
src/bin/auth/tests/auth_srv_unittest.cc

@@ -97,7 +97,7 @@ private:
         virtual void startRead(boost::function<void()> read_callback);
         virtual int reply(ConstElementPtr envelope, ConstElementPtr newmsg);
         virtual bool hasQueuedMsgs() const;
-        virtual void setTimeout(size_t timeout UNUSED_PARAM) {};
+        virtual void setTimeout(size_t) {}
         virtual size_t getTimeout() const { return 0; };
 
         void setMessage(ConstElementPtr msg) { msg_ = msg; }
@@ -156,30 +156,25 @@ protected:
 };
 
 void
-AuthSrvTest::MockSession::establish(const char* socket_file UNUSED_PARAM) {}
+AuthSrvTest::MockSession::establish(const char*) {}
 
 void
 AuthSrvTest::MockSession::disconnect() {}
 
 void
-AuthSrvTest::MockSession::subscribe(string group UNUSED_PARAM,
-                                    string instance UNUSED_PARAM)
+AuthSrvTest::MockSession::subscribe(string, string)
 {}
 
 void
-AuthSrvTest::MockSession::unsubscribe(string group UNUSED_PARAM,
-                                      string instance UNUSED_PARAM)
+AuthSrvTest::MockSession::unsubscribe(string, string)
 {}
 
 void
-AuthSrvTest::MockSession::startRead(
-    boost::function<void()> read_callback UNUSED_PARAM)
+AuthSrvTest::MockSession::startRead(boost::function<void()>)
 {}
 
 int
-AuthSrvTest::MockSession::reply(ConstElementPtr envelope UNUSED_PARAM,
-                                ConstElementPtr newmsg UNUSED_PARAM)
-{
+AuthSrvTest::MockSession::reply(ConstElementPtr, ConstElementPtr) {
     return (-1);
 }
 
@@ -190,8 +185,7 @@ AuthSrvTest::MockSession::hasQueuedMsgs() const {
 
 int
 AuthSrvTest::MockSession::group_sendmsg(ConstElementPtr msg, string group,
-                                        string instance UNUSED_PARAM,
-                                        string to UNUSED_PARAM)
+                                        string, string)
 {
     if (!send_ok_) {
         isc_throw(XfroutError, "mock session send is disabled for test");
@@ -203,10 +197,8 @@ AuthSrvTest::MockSession::group_sendmsg(ConstElementPtr msg, string group,
 }
 
 bool
-AuthSrvTest::MockSession::group_recvmsg(ConstElementPtr& envelope UNUSED_PARAM,
-                                        ConstElementPtr& msg,
-                                        bool nonblock UNUSED_PARAM,
-                                        int seq UNUSED_PARAM)
+AuthSrvTest::MockSession::group_recvmsg(ConstElementPtr&,
+                                        ConstElementPtr& msg, bool, int)
 {
     if (!receive_ok_) {
         isc_throw(XfroutError, "mock session receive is disabled for test");
@@ -234,10 +226,9 @@ AuthSrvTest::MockXfroutClient::disconnect() {
 }
 
 int
-AuthSrvTest::MockXfroutClient::sendXfroutRequestInfo(
-    const int tcp_sock UNUSED_PARAM,
-    const void* msg_data UNUSED_PARAM,
-    const uint16_t msg_len UNUSED_PARAM)
+AuthSrvTest::MockXfroutClient::sendXfroutRequestInfo(const int,
+                                                     const void*,
+                                                     const uint16_t)
 {
     if (!send_ok_) {
         isc_throw(XfroutError, "xfrout connection send is disabled for test");

+ 23 - 29
src/lib/cc/data.cc

@@ -62,84 +62,82 @@ Element::toWire(std::ostream& ss) const {
 // installed files we define the methods here.
 //
 bool
-Element::getValue(long int& t UNUSED_PARAM) {
+Element::getValue(long int&) {
     return (false);
 }
 
 bool
-Element::getValue(double& t UNUSED_PARAM) {
+Element::getValue(double&) {
     return (false);
 }
 
 bool
-Element::getValue(bool& t UNUSED_PARAM) {
+Element::getValue(bool&) {
     return (false);
 }
 
 bool
-Element::getValue(std::string& t UNUSED_PARAM) {
+Element::getValue(std::string&) {
     return (false);
 }
 
 bool
-Element::getValue(std::vector<ConstElementPtr>& t UNUSED_PARAM) {
+Element::getValue(std::vector<ConstElementPtr>&) {
     return (false);
 }
 
 bool
-Element::getValue(std::map<std::string, ConstElementPtr>& t UNUSED_PARAM) {
+Element::getValue(std::map<std::string, ConstElementPtr>&) {
     return (false);
 }
 
 bool
-Element::setValue(const long int v UNUSED_PARAM) {
+Element::setValue(const long int) {
     return (false);
 }
 
 bool
-Element::setValue(const double v UNUSED_PARAM) {
+Element::setValue(const double) {
     return (false);
 }
 
 bool
-Element::setValue(const bool t UNUSED_PARAM) {
+Element::setValue(const bool) {
     return (false);
 }
 
 bool
-Element::setValue(const std::string& v UNUSED_PARAM) {
+Element::setValue(const std::string&) {
     return (false);
 }
 
 bool
-Element::setValue(const std::vector<ConstElementPtr>& v UNUSED_PARAM) {
+Element::setValue(const std::vector<ConstElementPtr>&) {
     return (false);
 }
 
 bool
-Element::setValue(const std::map<std::string,
-                  ConstElementPtr>& v UNUSED_PARAM)
-{
+Element::setValue(const std::map<std::string, ConstElementPtr>&) {
     return (false);
 }
 
 ConstElementPtr
-Element::get(const int i UNUSED_PARAM) const {
+Element::get(const int) const {
     isc_throw(TypeError, "get(int) called on a non-list Element");
 }
 
 void
-Element::set(const size_t i UNUSED_PARAM, ConstElementPtr element UNUSED_PARAM) {
+Element::set(const size_t, ConstElementPtr) {
     isc_throw(TypeError, "set(int, element) called on a non-list Element");
 }
 
 void
-Element::add(ConstElementPtr element UNUSED_PARAM) {
+Element::add(ConstElementPtr) {
     isc_throw(TypeError, "add() called on a non-list Element");
 }
 
 void
-Element::remove(const int i UNUSED_PARAM) {
+Element::remove(const int) {
     isc_throw(TypeError, "remove(int) called on a non-list Element");
 }
 
@@ -149,36 +147,32 @@ Element::size() const {
 }
 
 ConstElementPtr
-Element::get(const std::string& name UNUSED_PARAM) const {
+Element::get(const std::string&) const {
     isc_throw(TypeError, "get(string) called on a non-map Element");
 }
 
 void
-Element::set(const std::string& name UNUSED_PARAM,
-             ConstElementPtr element UNUSED_PARAM)
-{
+Element::set(const std::string&, ConstElementPtr) {
     isc_throw(TypeError, "set(name, element) called on a non-map Element");
 }
 
 void
-Element::remove(const std::string& name UNUSED_PARAM) {
+Element::remove(const std::string&) {
     isc_throw(TypeError, "remove(string) called on a non-map Element");
 }
 
 bool
-Element::contains(const std::string& name UNUSED_PARAM) const {
+Element::contains(const std::string&) const {
     isc_throw(TypeError, "contains(string) called on a non-map Element");
 }
 
 ConstElementPtr
-Element::find(const std::string& identifier UNUSED_PARAM) const {
+Element::find(const std::string&) const {
     isc_throw(TypeError, "find(string) called on a non-map Element");
 }
 
 bool
-Element::find(const std::string& identifier UNUSED_PARAM,
-              ConstElementPtr t UNUSED_PARAM) const
-{
+Element::find(const std::string&, ConstElementPtr) const {
     return (false);
 }
 
@@ -725,7 +719,7 @@ Element::fromWire(const std::string& s) {
 }
 
 ElementPtr
-Element::fromWire(std::stringstream& in, int length) {
+Element::fromWire(std::stringstream& in, int) {
     //
     // Check protocol version
     //

+ 1 - 1
src/lib/cc/tests/session_unittests.cc

@@ -76,7 +76,7 @@ public:
     }
 
     void
-    acceptHandler(const asio::error_code& error UNUSED_PARAM) {
+    acceptHandler(const asio::error_code&) {
     }
 
     void

+ 0 - 4
src/lib/config/tests/Makefile.am

@@ -4,10 +4,6 @@ AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
 AM_CPPFLAGS += $(BOOST_INCLUDES)
 
 AM_CXXFLAGS = $(B10_CXXFLAGS)
-# see src/lib/cc/Makefile.am for -Wno-unused-parameter
-if USE_GXX
-AM_CXXFLAGS += -Wno-unused-parameter
-endif
 
 if USE_STATIC_LINK
 AM_LDFLAGS = -static

+ 1 - 1
src/lib/config/tests/ccsession_unittests.cc

@@ -188,7 +188,7 @@ ConstElementPtr my_config_handler(ConstElementPtr new_config) {
 }
 
 ConstElementPtr my_command_handler(const std::string& command,
-                                   ConstElementPtr arg UNUSED_PARAM)
+                                   ConstElementPtr arg)
 {
     if (command == "good_command") {
         return (createAnswer());

+ 5 - 10
src/lib/config/tests/fake_session.cc

@@ -87,17 +87,15 @@ FakeSession::disconnect() {
 }
 
 void
-FakeSession::startRead(boost::function<void()> read_callback UNUSED_PARAM) {
+FakeSession::startRead(boost::function<void()>) {
 }
 
 void
-FakeSession::establish(const char* socket_file) {
+FakeSession::establish(const char*) {
 }
 
 bool
-FakeSession::recvmsg(ConstElementPtr& msg, bool nonblock UNUSED_PARAM,
-                     int seq UNUSED_PARAM)
-{
+FakeSession::recvmsg(ConstElementPtr& msg, bool, int) {
     //cout << "[XX] client asks for message " << endl;
     if (messages_ &&
         messages_->getType() == Element::list &&
@@ -111,10 +109,7 @@ FakeSession::recvmsg(ConstElementPtr& msg, bool nonblock UNUSED_PARAM,
 }
 
 bool
-FakeSession::recvmsg(ConstElementPtr& env, ConstElementPtr& msg,
-                     bool nonblock UNUSED_PARAM,
-                     int seq UNUSED_PARAM)
-{
+FakeSession::recvmsg(ConstElementPtr& env, ConstElementPtr& msg, bool, int) {
     //cout << "[XX] client asks for message and env" << endl;
     env = ElementPtr();
     if (messages_ &&
@@ -172,7 +167,7 @@ FakeSession::unsubscribe(std::string group, std::string instance) {
 
 int
 FakeSession::group_sendmsg(ConstElementPtr msg, std::string group,
-                           std::string to, std::string instance UNUSED_PARAM)
+                           std::string to, std::string)
 {
     //cout << "[XX] client sends message: " << msg << endl;
     //cout << "[XX] to: " << group << " . " << instance << "." << to << endl;

+ 1 - 1
src/lib/config/tests/fake_session.h

@@ -63,7 +63,7 @@ public:
     virtual int reply(isc::data::ConstElementPtr envelope,
                       isc::data::ConstElementPtr newmsg);
     virtual bool hasQueuedMsgs() const;
-    virtual void setTimeout(size_t milliseconds) {}
+    virtual void setTimeout(size_t) {}
     virtual size_t getTimeout() const { return (0); }
     isc::data::ConstElementPtr getFirstMessage(std::string& group,
                                                std::string& to) const;

+ 29 - 36
src/lib/datasrc/data_source.cc

@@ -1247,72 +1247,65 @@ Nsec3Param::getHash(const Name& name) const {
     return (encodeBase32Hex(vector<uint8_t>(digest, digest + SHA1_HASHSIZE)));
 }
 
-//
-// The following methods are effectively empty, and their parameters are
-// unused.  To silence compilers that warn unused function parameters,
-// we specify a (compiler dependent) special keyword when available.
-// It's defined in config.h, and to avoid including this header file from
-// installed files we define the methods here.
-//
 DataSrc::Result
-DataSrc::init(isc::data::ConstElementPtr config UNUSED_PARAM) {
+DataSrc::init(isc::data::ConstElementPtr) {
     return (NOT_IMPLEMENTED);
 }
 
 DataSrc::Result
-MetaDataSrc::findRRset(const isc::dns::Name& qname UNUSED_PARAM,
-                       const isc::dns::RRClass& qclass UNUSED_PARAM,
-                       const isc::dns::RRType& qtype UNUSED_PARAM,
-                       isc::dns::RRsetList& target UNUSED_PARAM,
-                       uint32_t& flags UNUSED_PARAM,
-                       const isc::dns::Name* zonename UNUSED_PARAM) const
+MetaDataSrc::findRRset(const isc::dns::Name&,
+                       const isc::dns::RRClass&,
+                       const isc::dns::RRType&,
+                       isc::dns::RRsetList&,
+                       uint32_t&,
+                       const isc::dns::Name*) const
 {
     return (NOT_IMPLEMENTED);
 }
 
 DataSrc::Result
-MetaDataSrc::findExactRRset(const isc::dns::Name& qname UNUSED_PARAM,
-                            const isc::dns::RRClass& qclass UNUSED_PARAM,
-                            const isc::dns::RRType& qtype UNUSED_PARAM,
-                            isc::dns::RRsetList& target UNUSED_PARAM,
-                            uint32_t& flags UNUSED_PARAM,
-                            const isc::dns::Name* zonename UNUSED_PARAM) const
+MetaDataSrc::findExactRRset(const isc::dns::Name&,
+                            const isc::dns::RRClass&,
+                            const isc::dns::RRType&,
+                            isc::dns::RRsetList&,
+                            uint32_t&,
+                            const isc::dns::Name*) const
 {
     return (NOT_IMPLEMENTED);
 }
 
 DataSrc::Result
-MetaDataSrc::findAddrs(const isc::dns::Name& qname UNUSED_PARAM,
-                       const isc::dns::RRClass& qclass UNUSED_PARAM,
-                       isc::dns::RRsetList& target UNUSED_PARAM,
-                       uint32_t& flags UNUSED_PARAM,
-                       const isc::dns::Name* zonename UNUSED_PARAM) const
+MetaDataSrc::findAddrs(const isc::dns::Name&,
+                       const isc::dns::RRClass&,
+                       isc::dns::RRsetList&,
+                       uint32_t&,
+                       const isc::dns::Name*) const
 {
     return (NOT_IMPLEMENTED);
 }
 
 DataSrc::Result
-MetaDataSrc::findReferral(const isc::dns::Name& qname UNUSED_PARAM,
-                          const isc::dns::RRClass& qclass UNUSED_PARAM,
-                          isc::dns::RRsetList& target UNUSED_PARAM,
-                          uint32_t& flags UNUSED_PARAM,
-                          const isc::dns::Name* zonename UNUSED_PARAM) const
+MetaDataSrc::findReferral(const isc::dns::Name&,
+                          const isc::dns::RRClass&,
+                          isc::dns::RRsetList&,
+                          uint32_t&,
+                          const isc::dns::Name*) const
 {
     return (NOT_IMPLEMENTED);
 }
 
 DataSrc::Result
-MetaDataSrc::findPreviousName(const isc::dns::Name& qname UNUSED_PARAM,
-                              isc::dns::Name& target UNUSED_PARAM,
-                              const isc::dns::Name* zonename UNUSED_PARAM) const
+MetaDataSrc::findPreviousName(const isc::dns::Name&,
+                              isc::dns::Name&,
+                              const isc::dns::Name*) const
 {
     return (NOT_IMPLEMENTED);
 }
 
 DataSrc::Result
-MetaDataSrc::findCoveringNSEC3(const isc::dns::Name& zonename UNUSED_PARAM,
-                               std::string& hash UNUSED_PARAM,
-                               isc::dns::RRsetList& target UNUSED_PARAM) const
+MetaDataSrc::findCoveringNSEC3(const isc::dns::Name&,
+                               std::string&,
+                               isc::dns::RRsetList&) const
 {
     return (NOT_IMPLEMENTED);
 }

+ 3 - 9
src/lib/datasrc/static_datasrc.cc

@@ -235,18 +235,12 @@ StaticDataSrc::findExactRRset(const Name& qname,
 }
 
 DataSrc::Result
-StaticDataSrc::findPreviousName(const Name& qname UNUSED_PARAM,
-                                Name& target UNUSED_PARAM,
-                                const Name* zonename UNUSED_PARAM) const
-{
+StaticDataSrc::findPreviousName(const Name&, Name&, const Name*) const {
     return (NOT_IMPLEMENTED);
 }
 
 DataSrc::Result
-StaticDataSrc::findCoveringNSEC3(const Name& zonename UNUSED_PARAM,
-                                 string& hash UNUSED_PARAM,
-                                 RRsetList& target UNUSED_PARAM) const
-{
+StaticDataSrc::findCoveringNSEC3(const Name&, string&, RRsetList&) const {
    return (NOT_IMPLEMENTED);
 }
 
@@ -258,7 +252,7 @@ StaticDataSrc::init() {
 // Static data source is "configuration less", so the \c config parameter
 // is intentionally ignored.
 DataSrc::Result
-StaticDataSrc::init(isc::data::ConstElementPtr config UNUSED_PARAM) {
+StaticDataSrc::init(isc::data::ConstElementPtr) {
     return (init());
 }
 

+ 2 - 5
src/lib/datasrc/tests/test_datasrc.cc

@@ -307,7 +307,7 @@ vector<Zone> zones;
 }
 
 DataSrc::Result
-TestDataSrc::init(isc::data::ConstElementPtr config UNUSED_PARAM) {
+TestDataSrc::init(isc::data::ConstElementPtr) {
     return (init());
 }
 
@@ -623,10 +623,7 @@ TestDataSrc::findPreviousName(const Name& qname,
 }
 
 DataSrc::Result
-TestDataSrc::findCoveringNSEC3(const Name& zonename UNUSED_PARAM,
-                               string& hash UNUSED_PARAM,
-                               RRsetList& target UNUSED_PARAM) const
-{
+TestDataSrc::findCoveringNSEC3(const Name&, string&, RRsetList&) const {
     return (NOT_IMPLEMENTED);
 }
 

+ 2 - 2
src/lib/dns/edns.cc

@@ -74,7 +74,7 @@ EDNS::EDNS(const uint8_t version) :
 }
 
 EDNS::EDNS(const Name& name, const RRClass& rrclass, const RRType& rrtype,
-           const RRTTL& ttl, const Rdata& rdata UNUSED_PARAM) :
+           const RRTTL& ttl, const Rdata&) :
     version_((ttl.getValue() & VERSION_MASK) >> VERSION_SHIFT)
 {
     if (rrtype != RRType::OPT()) {
@@ -152,7 +152,7 @@ EDNS::toWire(OutputBuffer& buffer, const uint8_t extended_rcode) const {
 EDNS*
 createEDNSFromRR(const Name& name, const RRClass& rrclass,
                  const RRType& rrtype, const RRTTL& ttl,
-                 const Rdata& rdata UNUSED_PARAM,
+                 const Rdata& rdata,
                  uint8_t& extended_rcode)
 {
     // Create a new EDNS object first for exception guarantee.

+ 2 - 4
src/lib/dns/python/name_python.cc

@@ -50,7 +50,7 @@ public:
     isc::dns::NameComparisonResult* ncr;
 };
 
-static int NameComparisonResult_init(s_NameComparisonResult* self UNUSED_PARAM, PyObject* args UNUSED_PARAM);
+static int NameComparisonResult_init(s_NameComparisonResult*, PyObject*);
 static void NameComparisonResult_destroy(s_NameComparisonResult* self);
 static PyObject* NameComparisonResult_getOrder(s_NameComparisonResult* self);
 static PyObject* NameComparisonResult_getCommonLabels(s_NameComparisonResult* self);
@@ -123,9 +123,7 @@ static PyTypeObject name_comparison_result_type = {
 };
 
 static int
-NameComparisonResult_init(s_NameComparisonResult* self UNUSED_PARAM,
-                          PyObject* args UNUSED_PARAM)
-{
+NameComparisonResult_init(s_NameComparisonResult*, PyObject*) {
     PyErr_SetString(PyExc_NotImplementedError,
                     "NameComparisonResult can't be built directly");
     return (-1);

+ 16 - 16
src/lib/dns/python/opcode_python.cc

@@ -220,82 +220,82 @@ Opcode_createStatic(const Opcode& opcode) {
 }
 
 PyObject*
-Opcode_QUERY(const s_Opcode* self UNUSED_PARAM) {
+Opcode_QUERY(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::QUERY()));
 }
 
 PyObject*
-Opcode_IQUERY(const s_Opcode* self UNUSED_PARAM) {
+Opcode_IQUERY(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::IQUERY()));
 }
 
 PyObject*
-Opcode_STATUS(const s_Opcode* self UNUSED_PARAM) {
+Opcode_STATUS(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::STATUS()));
 }
 
 PyObject*
-Opcode_RESERVED3(const s_Opcode* self UNUSED_PARAM) {
+Opcode_RESERVED3(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::RESERVED3()));
 }
 
 PyObject*
-Opcode_NOTIFY(const s_Opcode* self UNUSED_PARAM) {
+Opcode_NOTIFY(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::NOTIFY()));
 }
 
 PyObject*
-Opcode_UPDATE(const s_Opcode* self UNUSED_PARAM) {
+Opcode_UPDATE(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::UPDATE()));
 }
 
 PyObject*
-Opcode_RESERVED6(const s_Opcode* self UNUSED_PARAM) {
+Opcode_RESERVED6(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::RESERVED6()));
 }
 
 PyObject*
-Opcode_RESERVED7(const s_Opcode* self UNUSED_PARAM) {
+Opcode_RESERVED7(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::RESERVED7()));
 }
 
 PyObject*
-Opcode_RESERVED8(const s_Opcode* self UNUSED_PARAM) {
+Opcode_RESERVED8(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::RESERVED8()));
 }
 
 PyObject*
-Opcode_RESERVED9(const s_Opcode* self UNUSED_PARAM) {
+Opcode_RESERVED9(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::RESERVED9()));
 }
 
 PyObject*
-Opcode_RESERVED10(const s_Opcode* self UNUSED_PARAM) {
+Opcode_RESERVED10(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::RESERVED10()));
 }
 
 PyObject*
-Opcode_RESERVED11(const s_Opcode* self UNUSED_PARAM) {
+Opcode_RESERVED11(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::RESERVED11()));
 }
 
 PyObject*
-Opcode_RESERVED12(const s_Opcode* self UNUSED_PARAM) {
+Opcode_RESERVED12(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::RESERVED12()));
 }
 
 PyObject*
-Opcode_RESERVED13(const s_Opcode* self UNUSED_PARAM) {
+Opcode_RESERVED13(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::RESERVED13()));
 }
 
 PyObject*
-Opcode_RESERVED14(const s_Opcode* self UNUSED_PARAM) {
+Opcode_RESERVED14(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::RESERVED14()));
 }
 
 PyObject*
-Opcode_RESERVED15(const s_Opcode* self UNUSED_PARAM) {
+Opcode_RESERVED15(const s_Opcode*) {
     return (Opcode_createStatic(Opcode::RESERVED15()));
 }
 

+ 17 - 17
src/lib/dns/python/rcode_python.cc

@@ -254,87 +254,87 @@ Rcode_createStatic(const Rcode& rcode) {
 }
 
 PyObject*
-Rcode_NOERROR(const s_Rcode* self UNUSED_PARAM) {
+Rcode_NOERROR(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::NOERROR()));
 }
 
 PyObject*
-Rcode_FORMERR(const s_Rcode* self UNUSED_PARAM) {
+Rcode_FORMERR(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::FORMERR()));
 }
 
 PyObject*
-Rcode_SERVFAIL(const s_Rcode* self UNUSED_PARAM) {
+Rcode_SERVFAIL(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::SERVFAIL()));
 }
 
 PyObject*
-Rcode_NXDOMAIN(const s_Rcode* self UNUSED_PARAM) {
+Rcode_NXDOMAIN(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::NXDOMAIN()));
 }
 
 PyObject*
-Rcode_NOTIMP(const s_Rcode* self UNUSED_PARAM) {
+Rcode_NOTIMP(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::NOTIMP()));
 }
 
 PyObject*
-Rcode_REFUSED(const s_Rcode* self UNUSED_PARAM) {
+Rcode_REFUSED(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::REFUSED()));
 }
 
 PyObject*
-Rcode_YXDOMAIN(const s_Rcode* self UNUSED_PARAM) {
+Rcode_YXDOMAIN(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::YXDOMAIN()));
 }
 
 PyObject*
-Rcode_YXRRSET(const s_Rcode* self UNUSED_PARAM) {
+Rcode_YXRRSET(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::YXRRSET()));
 }
 
 PyObject*
-Rcode_NXRRSET(const s_Rcode* self UNUSED_PARAM) {
+Rcode_NXRRSET(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::NXRRSET()));
 }
 
 PyObject*
-Rcode_NOTAUTH(const s_Rcode* self UNUSED_PARAM) {
+Rcode_NOTAUTH(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::NOTAUTH()));
 }
 
 PyObject*
-Rcode_NOTZONE(const s_Rcode* self UNUSED_PARAM) {
+Rcode_NOTZONE(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::NOTZONE()));
 }
 
 PyObject*
-Rcode_RESERVED11(const s_Rcode* self UNUSED_PARAM) {
+Rcode_RESERVED11(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::RESERVED11()));
 }
 
 PyObject*
-Rcode_RESERVED12(const s_Rcode* self UNUSED_PARAM) {
+Rcode_RESERVED12(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::RESERVED12()));
 }
 
 PyObject*
-Rcode_RESERVED13(const s_Rcode* self UNUSED_PARAM) {
+Rcode_RESERVED13(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::RESERVED13()));
 }
 
 PyObject*
-Rcode_RESERVED14(const s_Rcode* self UNUSED_PARAM) {
+Rcode_RESERVED14(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::RESERVED14()));
 }
 
 PyObject*
-Rcode_RESERVED15(const s_Rcode* self UNUSED_PARAM) {
+Rcode_RESERVED15(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::RESERVED15()));
 }
 
 PyObject*
-Rcode_BADVERS(const s_Rcode* self UNUSED_PARAM) {
+Rcode_BADVERS(const s_Rcode*) {
     return (Rcode_createStatic(Rcode::BADVERS()));
 }
 

+ 5 - 5
src/lib/dns/python/rrclass_python.cc

@@ -306,23 +306,23 @@ static PyObject* RRClass_createStatic(RRClass stc) {
     return (ret);
 }
 
-static PyObject* RRClass_IN(s_RRClass *self UNUSED_PARAM) {
+static PyObject* RRClass_IN(s_RRClass*) {
     return (RRClass_createStatic(RRClass::IN()));
 }
 
-static PyObject* RRClass_CH(s_RRClass *self UNUSED_PARAM) {
+static PyObject* RRClass_CH(s_RRClass*) {
     return (RRClass_createStatic(RRClass::CH()));
 }
 
-static PyObject* RRClass_HS(s_RRClass *self UNUSED_PARAM) {
+static PyObject* RRClass_HS(s_RRClass*) {
     return (RRClass_createStatic(RRClass::HS()));
 }
 
-static PyObject* RRClass_NONE(s_RRClass *self UNUSED_PARAM) {
+static PyObject* RRClass_NONE(s_RRClass*) {
     return (RRClass_createStatic(RRClass::NONE()));
 }
 
-static PyObject* RRClass_ANY(s_RRClass *self UNUSED_PARAM) {
+static PyObject* RRClass_ANY(s_RRClass*) {
     return (RRClass_createStatic(RRClass::ANY()));
 }
 // end of RRClass

+ 1 - 1
src/lib/dns/python/rrset_python.cc

@@ -158,7 +158,7 @@ static PyTypeObject rrset_type = {
 };
 
 static int
-RRset_init(s_RRset* self, PyObject* args UNUSED_PARAM) {
+RRset_init(s_RRset* self, PyObject* args) {
     s_Name* name;
     s_RRClass* rrclass;
     s_RRType* rrtype;

+ 19 - 19
src/lib/dns/python/rrtype_python.cc

@@ -344,97 +344,97 @@ static PyObject* RRType_createStatic(RRType stc) {
 }
 
 static PyObject*
-RRType_NSEC3PARAM(s_RRType *self UNUSED_PARAM) {
+RRType_NSEC3PARAM(s_RRType*) {
     return (RRType_createStatic(RRType::NSEC3PARAM()));
 }
 
 static PyObject*
-RRType_DNAME(s_RRType *self UNUSED_PARAM) {
+RRType_DNAME(s_RRType*) {
     return (RRType_createStatic(RRType::DNAME()));
 }
 
 static PyObject*
-RRType_PTR(s_RRType *self UNUSED_PARAM) {
+RRType_PTR(s_RRType*) {
     return (RRType_createStatic(RRType::PTR()));
 }
 
 static PyObject*
-RRType_MX(s_RRType *self UNUSED_PARAM) {
+RRType_MX(s_RRType*) {
     return (RRType_createStatic(RRType::MX()));
 }
 
 static PyObject*
-RRType_DNSKEY(s_RRType *self UNUSED_PARAM) {
+RRType_DNSKEY(s_RRType*) {
     return (RRType_createStatic(RRType::DNSKEY()));
 }
 
 static PyObject*
-RRType_TXT(s_RRType *self UNUSED_PARAM) {
+RRType_TXT(s_RRType*) {
     return (RRType_createStatic(RRType::TXT()));
 }
 
 static PyObject*
-RRType_RRSIG(s_RRType *self UNUSED_PARAM) {
+RRType_RRSIG(s_RRType*) {
     return (RRType_createStatic(RRType::RRSIG()));
 }
 
 static PyObject*
-RRType_NSEC(s_RRType *self UNUSED_PARAM) {
+RRType_NSEC(s_RRType*) {
     return (RRType_createStatic(RRType::NSEC()));
 }
 
 static PyObject*
-RRType_AAAA(s_RRType *self UNUSED_PARAM) {
+RRType_AAAA(s_RRType*) {
     return (RRType_createStatic(RRType::AAAA()));
 }
 
 static PyObject*
-RRType_DS(s_RRType *self UNUSED_PARAM) {
+RRType_DS(s_RRType*) {
     return (RRType_createStatic(RRType::DS()));
 }
 
 static PyObject*
-RRType_OPT(s_RRType *self UNUSED_PARAM) {
+RRType_OPT(s_RRType*) {
     return (RRType_createStatic(RRType::OPT()));
 }
 
 static PyObject*
-RRType_A(s_RRType *self UNUSED_PARAM) {
+RRType_A(s_RRType*) {
     return (RRType_createStatic(RRType::A()));
 }
 
 static PyObject*
-RRType_NS(s_RRType *self UNUSED_PARAM) {
+RRType_NS(s_RRType*) {
     return (RRType_createStatic(RRType::NS()));
 }
 
 static PyObject*
-RRType_CNAME(s_RRType *self UNUSED_PARAM) {
+RRType_CNAME(s_RRType*) {
     return (RRType_createStatic(RRType::CNAME()));
 }
 
 static PyObject*
-RRType_SOA(s_RRType *self UNUSED_PARAM) {
+RRType_SOA(s_RRType*) {
     return (RRType_createStatic(RRType::SOA()));
 }
 
 static PyObject*
-RRType_NSEC3(s_RRType *self UNUSED_PARAM) {
+RRType_NSEC3(s_RRType*) {
     return (RRType_createStatic(RRType::NSEC3()));
 }
 
 static PyObject*
-RRType_IXFR(s_RRType *self UNUSED_PARAM) {
+RRType_IXFR(s_RRType*) {
     return (RRType_createStatic(RRType::IXFR()));
 }
 
 static PyObject*
-RRType_AXFR(s_RRType *self UNUSED_PARAM) {
+RRType_AXFR(s_RRType*) {
     return (RRType_createStatic(RRType::AXFR()));
 }
 
 static PyObject*
-RRType_ANY(s_RRType *self UNUSED_PARAM) {
+RRType_ANY(s_RRType*) {
     return (RRType_createStatic(RRType::ANY()));
 }
 

+ 6 - 8
src/lib/dns/rdata/ch_3/a_1.cc

@@ -14,8 +14,6 @@
 
 // $Id$
 
-#include <config.h>             // for UNUSED_PARAM
-
 #include <string>
 
 #include <exceptions/exceptions.h>
@@ -30,25 +28,25 @@ using namespace std;
 // BEGIN_ISC_NAMESPACE
 // BEGIN_RDATA_NAMESPACE
 
-A::A(const string& addrstr UNUSED_PARAM) {
+A::A(const string&) {
     // TBD
 }
 
-A::A(InputBuffer& buffer UNUSED_PARAM, size_t rdata_len UNUSED_PARAM) {
+A::A(InputBuffer&, size_t) {
     // TBD
 }
 
-A::A(const A& source UNUSED_PARAM) : Rdata() {
+A::A(const A&) : Rdata() {
     // TBD
 }
 
 void
-A::toWire(OutputBuffer& buffer UNUSED_PARAM) const {
+A::toWire(OutputBuffer&) const {
     // TBD
 }
 
 void
-A::toWire(MessageRenderer& renderer UNUSED_PARAM) const {
+A::toWire(MessageRenderer&) const {
     // TBD
 }
 
@@ -59,7 +57,7 @@ A::toText() const {
 }
 
 int
-A::compare(const Rdata& other UNUSED_PARAM) const {
+A::compare(const Rdata&) const {
     return (0);                 // dummy.  TBD
 }
 

+ 1 - 1
src/lib/dns/rdata/generic/cname_5.cc

@@ -33,7 +33,7 @@ CNAME::CNAME(const std::string& namestr) :
     cname_(namestr)
 {}
 
-CNAME::CNAME(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM) :
+CNAME::CNAME(InputBuffer& buffer, size_t) :
     Rdata(), cname_(buffer)
 {
     // we don't need rdata_len for parsing.  if necessary, the caller will

+ 1 - 1
src/lib/dns/rdata/generic/dname_39.cc

@@ -33,7 +33,7 @@ DNAME::DNAME(const std::string& namestr) :
     dname_(namestr)
 {}
 
-DNAME::DNAME(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM) :
+DNAME::DNAME(InputBuffer& buffer, size_t) :
     dname_(buffer)
 {
     // we don't need rdata_len for parsing.  if necessary, the caller will

+ 1 - 1
src/lib/dns/rdata/generic/mx_15.cc

@@ -34,7 +34,7 @@ using namespace boost;
 // BEGIN_ISC_NAMESPACE
 // BEGIN_RDATA_NAMESPACE
 
-MX::MX(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM) :
+MX::MX(InputBuffer& buffer, size_t) :
     preference_(buffer.readUint16()), mxname_(buffer)
 {
     // we don't need rdata_len for parsing.  if necessary, the caller will

+ 1 - 1
src/lib/dns/rdata/generic/ns_2.cc

@@ -33,7 +33,7 @@ NS::NS(const std::string& namestr) :
     nsname_(namestr)
 {}
 
-NS::NS(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM) :
+NS::NS(InputBuffer& buffer, size_t) :
     nsname_(buffer)
 {
     // we don't need rdata_len for parsing.  if necessary, the caller will

+ 4 - 4
src/lib/dns/rdata/generic/opt_41.cc

@@ -28,7 +28,7 @@ using namespace std;
 // BEGIN_ISC_NAMESPACE
 // BEGIN_RDATA_NAMESPACE
 
-OPT::OPT(const string& type_str UNUSED_PARAM) {
+OPT::OPT(const string&) {
     isc_throw(InvalidRdataText, "OPT RR cannot be constructed from text");
 }
 
@@ -43,7 +43,7 @@ OPT::OPT(InputBuffer& buffer, size_t rdata_len) {
     buffer.setPosition(buffer.getPosition() + rdata_len);
 }
 
-OPT::OPT(const OPT& source UNUSED_PARAM) : Rdata() {
+OPT::OPT(const OPT&) : Rdata() {
     // there's nothing to copy in this simple implementation.
 }
 
@@ -53,12 +53,12 @@ OPT::toText() const {
 }
 
 void
-OPT::toWire(OutputBuffer& buffer UNUSED_PARAM) const {
+OPT::toWire(OutputBuffer&) const {
     // nothing to do, as this simple version doesn't support any options.
 }
 
 void
-OPT::toWire(MessageRenderer& renderer UNUSED_PARAM) const {
+OPT::toWire(MessageRenderer&) const {
     // nothing to do, as this simple version doesn't support any options.
 }
 

+ 1 - 1
src/lib/dns/rdata/generic/ptr_12.cc

@@ -33,7 +33,7 @@ PTR::PTR(const string& type_str) :
     ptr_name_(type_str)
 {}
 
-PTR::PTR(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM) :
+PTR::PTR(InputBuffer& buffer, size_t) :
     ptr_name_(buffer)
 {
     // we don't need rdata_len for parsing.  if necessary, the caller will

+ 1 - 1
src/lib/dns/rdata/generic/soa_6.cc

@@ -34,7 +34,7 @@ using namespace boost;
 // BEGIN_ISC_NAMESPACE
 // BEGIN_RDATA_NAMESPACE
 
-SOA::SOA(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM) :
+SOA::SOA(InputBuffer& buffer, size_t) :
     mname_(buffer), rname_(buffer)
 {
     // we don't need rdata_len for parsing.  if necessary, the caller will

+ 6 - 8
src/lib/dns/rdata/hs_4/a_1.cc

@@ -14,8 +14,6 @@
 
 // $Id$
 
-#include <config.h>             // for UNUSED_PARAM
-
 #include <string>
 
 #include <exceptions/exceptions.h>
@@ -30,25 +28,25 @@ using namespace std;
 // BEGIN_ISC_NAMESPACE
 // BEGIN_RDATA_NAMESPACE
 
-A::A(const string& addrstr UNUSED_PARAM) {
+A::A(const string&) {
     // TBD
 }
 
-A::A(InputBuffer& buffer UNUSED_PARAM, size_t rdata_len UNUSED_PARAM) {
+A::A(InputBuffer&, size_t) {
     // TBD
 }
 
-A::A(const A& source UNUSED_PARAM) : Rdata() {
+A::A(const A&) : Rdata() {
     // TBD
 }
 
 void
-A::toWire(OutputBuffer& buffer UNUSED_PARAM) const {
+A::toWire(OutputBuffer&) const {
     // TBD
 }
 
 void
-A::toWire(MessageRenderer& renderer UNUSED_PARAM) const {
+A::toWire(MessageRenderer&) const {
     // TBD
 }
 
@@ -59,7 +57,7 @@ A::toText() const {
 }
 
 int
-A::compare(const Rdata& other UNUSED_PARAM) const {
+A::compare(const Rdata&) const {
     return (0);                 // dummy.  TBD
 }
 

+ 2 - 6
src/lib/dns/tests/unittest_util.cc

@@ -132,10 +132,7 @@ UnitTestUtil::readWireData(const string& datastr,
 }
 
 ::testing::AssertionResult
-UnitTestUtil::matchWireData(const char* dataexp1 UNUSED_PARAM,
-                            const char* lenexp1 UNUSED_PARAM,
-                            const char* dataexp2 UNUSED_PARAM,
-                            const char* lenexp2 UNUSED_PARAM,
+UnitTestUtil::matchWireData(const char*, const char*, const char*, const char*,
                             const void* data1, size_t len1,
                             const void* data2, size_t len2)
 {
@@ -162,8 +159,7 @@ UnitTestUtil::matchWireData(const char* dataexp1 UNUSED_PARAM,
 }
 
 ::testing::AssertionResult
-UnitTestUtil::matchName(const char* nameexp1 UNUSED_PARAM,
-                        const char* nameexp2 UNUSED_PARAM,
+UnitTestUtil::matchName(const char*, const char*,
                         const isc::dns::Name& name1,
                         const isc::dns::Name& name2)
 {

+ 2 - 2
src/lib/xfr/fdshare_python.cc

@@ -24,7 +24,7 @@
 
 
 static PyObject*
-fdshare_recv_fd(PyObject* self UNUSED_PARAM, PyObject* args) {
+fdshare_recv_fd(PyObject*, PyObject* args) {
     int sock, fd;
     if (!PyArg_ParseTuple(args, "i", &sock)) {
         return (NULL);
@@ -34,7 +34,7 @@ fdshare_recv_fd(PyObject* self UNUSED_PARAM, PyObject* args) {
 }
 
 static PyObject*
-fdshare_send_fd(PyObject* self UNUSED_PARAM, PyObject* args) {
+fdshare_send_fd(PyObject*, PyObject* args) {
     int sock, fd, result;
     if (!PyArg_ParseTuple(args, "ii", &sock, &fd)) {
         return (NULL);