]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3451] Address Wshadow warnings from g++
authorAndrei Pavel <andrei@isc.org>
Mon, 20 Oct 2025 13:30:40 +0000 (16:30 +0300)
committerAndrei Pavel <andrei@isc.org>
Sun, 26 Oct 2025 16:58:23 +0000 (18:58 +0200)
39 files changed:
src/bin/d2/tests/d2_command_unittest.cc
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/tests/config_backend_unittest.cc
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/http_control_socket_unittest.cc
src/bin/dhcp4/tests/shared_network_unittest.cc
src/bin/dhcp6/tests/config_backend_unittest.cc
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/http_control_socket_unittest.cc
src/hooks/d2/gss_tsig/tests/gss_tsig_impl_unittests.cc
src/hooks/dhcp/high_availability/ha_service.cc
src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc
src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc
src/hooks/dhcp/mysql/mysql_cb_impl.cc
src/hooks/dhcp/perfmon/perfmon_mgr.cc
src/hooks/dhcp/pgsql/pgsql_cb_impl.cc
src/hooks/dhcp/radius/tests/access_unittests.cc
src/hooks/dhcp/radius/tests/accounting_unittests.cc
src/hooks/dhcp/radius/tests/attribute_test.cc
src/hooks/dhcp/subnet_cmds/subnet_cmds.cc
src/lib/asiolink/asio_wrapper.h
src/lib/asiolink/testutils/botan_sample_client.cc
src/lib/asiolink/testutils/openssl_sample_client.cc
src/lib/config/unix_command_mgr.cc
src/lib/dhcp/tests/packet_queue_mgr4_unittest.cc
src/lib/dhcp/tests/packet_queue_mgr6_unittest.cc
src/lib/dhcp_ddns/ncr_io.cc
src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.cc
src/lib/dhcpsrv/testutils/generic_cb_dhcp6_unittest.cc
src/lib/dns/tests/labelsequence_unittest.cc
src/lib/dns/tests/master_lexer_state_unittest.cc
src/lib/dns/tests/rdata_tkey_unittest.cc
src/lib/dns/tests/tsig_unittest.cc
src/lib/eval/tests/evaluate_unittest.cc
src/lib/http/connection.cc
src/lib/http/tests/client_mt_unittests.cc
src/lib/http/tests/http_client_test.h
src/lib/http/testutils/test_http_client.h
src/lib/tcp/tests/tcp_test_client.h

index 53a997d27e93d1e040650b463c42213f09a814ea..68786c44a918461d5d3eed1c855d7580c91807b9 100644 (file)
@@ -1418,8 +1418,8 @@ TEST_F(CtrlChannelD2Test, connectionTimeoutPartialCommand) {
         // Let's wait up to 15s for the server's response. The response
         // should arrive sooner assuming that the timeout mechanism for
         // the server is working properly.
-        const unsigned int timeout = 15;
-        ASSERT_TRUE(client->getResponse(response, timeout));
+        const unsigned int timeout_15 = 15;
+        ASSERT_TRUE(client->getResponse(response, timeout_15));
 
         // Explicitly close the client's connection.
         client->disconnectFromServer();
@@ -1466,8 +1466,8 @@ TEST_F(CtrlChannelD2Test, connectionTimeoutNoData) {
         // Let's wait up to 15s for the server's response. The response
         // should arrive sooner assuming that the timeout mechanism for
         // the server is working properly.
-        const unsigned int timeout = 15;
-        ASSERT_TRUE(client->getResponse(response, timeout));
+        const unsigned int timeout_15 = 15;
+        ASSERT_TRUE(client->getResponse(response, timeout_15));
 
         // Explicitly close the client's connection.
         client->disconnectFromServer();
index b1de5c68a82a497f294e8246151dfe2261cf7888..ca8ce1164a61aa7dce77bb653a1286c3ea5ef75e 100644 (file)
@@ -3341,10 +3341,10 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
             try {
                 createNameChangeRequests(lease, ctx->old_lease_,
                                          *ex.getContext()->getDdnsParams());
-            } catch (const Exception& ex) {
+            } catch (const Exception& exception) {
                 LOG_ERROR(ddns4_logger, DHCP4_NCR_CREATION_FAILED)
                     .arg(query->getLabel())
-                    .arg(ex.what());
+                    .arg(exception.what());
             }
         }
 
@@ -5000,11 +5000,11 @@ void Dhcpv4Srv::evaluateAdditionalClasses(Dhcpv4Exchange& ex) {
                 // Matching: add the class
                 query->addClass(cclass);
             }
-        } catch (const Exception& ex) {
+        } catch (const Exception& exception) {
             LOG_ERROR(dhcp4_logger, DHCP4_ADDITIONAL_CLASS_EVAL_ERROR)
                 .arg(query->getLabel())
                 .arg(cclass)
-                .arg(ex.what());
+                .arg(exception.what());
         }
     }
 }
index c1703b04bbc9e06319feeeeaf286ecc4a192d145..f450b2670bc9adfc65bda77c09e0add38e49e20c 100644 (file)
@@ -62,10 +62,10 @@ protected:
         db2_.reset(new TestConfigBackendDHCPv4(params));
 
         ConfigBackendDHCPv4Mgr::instance().registerBackendFactory("memfile",
-            [this](const DatabaseConnection::ParameterMap& params)
+            [this](const DatabaseConnection::ParameterMap& parameters)
                 -> ConfigBackendDHCPv4Ptr {
-                    auto host = params.find("host");
-                    if (host != params.end()) {
+                    auto host = parameters.find("host");
+                    if (host != parameters.end()) {
                         if (host->second == "db1") {
                             return (db1_);
                         } else if (host->second == "db2") {
@@ -74,7 +74,7 @@ protected:
                     }
 
                     // Apparently we're looking for a new one.
-                    return (TestConfigBackendDHCPv4Ptr(new TestConfigBackendDHCPv4(params)));
+                    return (TestConfigBackendDHCPv4Ptr(new TestConfigBackendDHCPv4(parameters)));
                 });
     }
 
index 11a4adff305776e1716951dd91f02400f501d3ae..a5ba6e3f13a68002eb8ec427981f9d590819f5ad 100644 (file)
@@ -1027,7 +1027,9 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configSetLFCRunning) {
     PIDFile pid_file(Memfile_LeaseMgr::appendSuffix(pmap["name"], Memfile_LeaseMgr::FILE_PID));
     pid_file.write();
 
-    std::unique_ptr<void, void(*)(void*)> p(static_cast<void*>(&pid_file), [](void* p) { reinterpret_cast<PIDFile*>(p)->deleteFile(); });
+    std::unique_ptr<void, void (*)(void*)> p(static_cast<void*>(&pid_file), [](void* f) {
+        reinterpret_cast<PIDFile*>(f)->deleteFile();
+    });
 
     // Send the config-set command
     sendUnixCommand(os.str(), response);
@@ -1860,7 +1862,9 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configReloadLFCRunning) {
     PIDFile pid_file(Memfile_LeaseMgr::appendSuffix(pmap["name"], Memfile_LeaseMgr::FILE_PID));
     pid_file.write();
 
-    std::unique_ptr<void, void(*)(void*)> p(static_cast<void*>(&pid_file), [](void* p) { reinterpret_cast<PIDFile*>(p)->deleteFile(); });
+    std::unique_ptr<void, void (*)(void*)> p(static_cast<void*>(&pid_file), [](void* pf) {
+        reinterpret_cast<PIDFile*>(pf)->deleteFile();
+    });
 
     // Now tell Kea to reload its config.
     sendUnixCommand("{ \"command\": \"config-reload\" }", response);
index ee901f162b314005b07a0ce8024cd68aaef9befe..9e9f453eef0663417bf14d932a71b8906e8e3045 100644 (file)
@@ -1326,7 +1326,9 @@ TEST_F(HttpCtrlChannelDhcpv4Test, configSetLFCRunning) {
     PIDFile pid_file(Memfile_LeaseMgr::appendSuffix(pmap["name"], Memfile_LeaseMgr::FILE_PID));
     pid_file.write();
 
-    std::unique_ptr<void, void(*)(void*)> p(static_cast<void*>(&pid_file), [](void* p) { reinterpret_cast<PIDFile*>(p)->deleteFile(); });
+    std::unique_ptr<void, void (*)(void*)> p(static_cast<void*>(&pid_file), [](void* f) {
+        reinterpret_cast<PIDFile*>(f)->deleteFile();
+    });
 
     // Send the config-set command
     sendHttpCommand(os.str(), response);
@@ -1669,7 +1671,9 @@ TEST_F(HttpsCtrlChannelDhcpv4Test, configSetLFCRunning) {
     PIDFile pid_file(Memfile_LeaseMgr::appendSuffix(pmap["name"], Memfile_LeaseMgr::FILE_PID));
     pid_file.write();
 
-    std::unique_ptr<void, void(*)(void*)> p(static_cast<void*>(&pid_file), [](void* p) { reinterpret_cast<PIDFile*>(p)->deleteFile(); });
+    std::unique_ptr<void, void (*)(void*)> p(static_cast<void*>(&pid_file), [](void* f) {
+        reinterpret_cast<PIDFile*>(f)->deleteFile();
+    });
 
     // Send the config-set command
     sendHttpCommand(os.str(), response);
@@ -2879,8 +2883,9 @@ BaseCtrlChannelDhcpv4Test::testConfigReloadLFCRunning() {
     PIDFile pid_file(Memfile_LeaseMgr::appendSuffix(pmap["name"], Memfile_LeaseMgr::FILE_PID));
     pid_file.write();
 
-    std::unique_ptr<void, void(*)(void*)> p(static_cast<void*>(&pid_file), [](void* p) { reinterpret_cast<PIDFile*>(p)->deleteFile(); });
-
+    std::unique_ptr<void, void (*)(void*)> p(static_cast<void*>(&pid_file), [](void* pf) {
+        reinterpret_cast<PIDFile*>(pf)->deleteFile();
+    });
 
     // This command should reload test8.json config.
     sendHttpCommand("{ \"command\": \"config-reload\" }", response);
index 053102b1aca9322986d3a49fa1e4992328def222..c43d33b1d824716fb79ace19bd0003e8d05827c8 100644 (file)
@@ -2947,12 +2947,12 @@ TEST_F(Dhcpv4SharedNetworkTest, precedenceReservation) {
 TEST_F(Dhcpv4SharedNetworkTest, authoritative) {
 
     // Each scenario will be defined using those parameters.
-    typedef struct scenario {
+    struct scenario {
         bool exp_success;
         AuthoritativeFlag global;
         AuthoritativeFlag subnet1;
         AuthoritativeFlag subnet2;
-    } scenario;
+    };
 
     // We have the following scenarios. The default is no.
     // The only allowed combinations are those that end up with
index ebcc241cb4cb2f3649cd4906a7f6e251f1789dc1..61509ac229b985c4244f5213a6bc03fb9ddce07e 100644 (file)
@@ -64,10 +64,10 @@ protected:
         db2_.reset(new TestConfigBackendDHCPv6(params));
 
         ConfigBackendDHCPv6Mgr::instance().registerBackendFactory("memfile",
-            [this](const DatabaseConnection::ParameterMap& params)
+            [this](const DatabaseConnection::ParameterMap& parameters)
                 -> ConfigBackendDHCPv6Ptr {
-                    auto host = params.find("host");
-                    if (host != params.end()) {
+                    auto host = parameters.find("host");
+                    if (host != parameters.end()) {
                         if (host->second == "db1") {
                             return (db1_);
                         } else if (host->second == "db2") {
@@ -76,7 +76,7 @@ protected:
                     }
 
                     // Apparently we're looking for a new one.
-                    return (TestConfigBackendDHCPv6Ptr(new TestConfigBackendDHCPv6(params)));
+                    return (TestConfigBackendDHCPv6Ptr(new TestConfigBackendDHCPv6(parameters)));
                 });
     }
 
index 0134ff17ca64e22332ed36565d6c1a9b16d0e7fd..196c7eedaf6673a6cda20880285d2ac26393fbc1 100644 (file)
@@ -1039,7 +1039,9 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configSetLFCRunning) {
     PIDFile pid_file(Memfile_LeaseMgr::appendSuffix(pmap["name"], Memfile_LeaseMgr::FILE_PID));
     pid_file.write();
 
-    std::unique_ptr<void, void(*)(void*)> p(static_cast<void*>(&pid_file), [](void* p) { reinterpret_cast<PIDFile*>(p)->deleteFile(); });
+    std::unique_ptr<void, void (*)(void*)> p(static_cast<void*>(&pid_file), [](void* f) {
+        reinterpret_cast<PIDFile*>(f)->deleteFile();
+    });
 
     // Send the config-set command
     sendUnixCommand(os.str(), response);
@@ -1844,15 +1846,14 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configReloadLFCRunning) {
         "        { \"subnet\": \"2001:db8:2::/64\", \"id\": 2 }"
         "     ],"
         "    \"lease-database\": {"
-        "       \"type\": \"memfile\", \"persist\": false }"
         "} }";
     ofstream f("test8.json", ios::trunc);
     f << cfg_txt;
     f.close();
 
-    // Create the backend configuration.
+    // Creuate the backend configuration.
     DatabaseConnection::ParameterMap pmap;
-    pmap["type"] = "memfile";
+    pmap["teype"] = "memfile";
     pmap["universe"] = "6";
     pmap["name"] = getLeaseFilePath("kea-leases6.csv");
     pmap["lfc-interval"] = "1";
@@ -1863,7 +1864,9 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configReloadLFCRunning) {
     PIDFile pid_file(Memfile_LeaseMgr::appendSuffix(pmap["name"], Memfile_LeaseMgr::FILE_PID));
     pid_file.write();
 
-    std::unique_ptr<void, void(*)(void*)> p(static_cast<void*>(&pid_file), [](void* p) { reinterpret_cast<PIDFile*>(p)->deleteFile(); });
+    std::unique_ptr<void, void (*)(void*)> p(static_cast<void*>(&pid_file), [](void* pf) {
+        reinterpret_cast<PIDFile*>(pf)->deleteFile();
+    });
 
     // Now tell Kea to reload its config.
     sendUnixCommand("{ \"command\": \"config-reload\" }", response);
index a9dae620bcd84c581ae3cbd2450c90268f8bceb7..7124a04e13e8812153338f3d710bb4f6416fec29 100644 (file)
@@ -1345,7 +1345,9 @@ TEST_F(HttpCtrlChannelDhcpv6Test, configSetLFCRunning) {
     PIDFile pid_file(Memfile_LeaseMgr::appendSuffix(pmap["name"], Memfile_LeaseMgr::FILE_PID));
     pid_file.write();
 
-    std::unique_ptr<void, void(*)(void*)> p(static_cast<void*>(&pid_file), [](void* p) { reinterpret_cast<PIDFile*>(p)->deleteFile(); });
+    std::unique_ptr<void, void (*)(void*)> p(static_cast<void*>(&pid_file), [](void* f) {
+        reinterpret_cast<PIDFile*>(f)->deleteFile();
+    });
 
     // Send the config-set command
     sendHttpCommand(os.str(), response);
@@ -1690,7 +1692,9 @@ TEST_F(HttpsCtrlChannelDhcpv6Test, configSetLFCRunning) {
     PIDFile pid_file(Memfile_LeaseMgr::appendSuffix(pmap["name"], Memfile_LeaseMgr::FILE_PID));
     pid_file.write();
 
-    std::unique_ptr<void, void(*)(void*)> p(static_cast<void*>(&pid_file), [](void* p) { reinterpret_cast<PIDFile*>(p)->deleteFile(); });
+    std::unique_ptr<void, void (*)(void*)> p(static_cast<void*>(&pid_file), [](void* f) {
+        reinterpret_cast<PIDFile*>(f)->deleteFile();
+    });
 
     // Send the config-set command
     sendHttpCommand(os.str(), response);
@@ -2877,8 +2881,9 @@ BaseCtrlChannelDhcpv6Test::testConfigReloadLFCRunning() {
     PIDFile pid_file(Memfile_LeaseMgr::appendSuffix(pmap["name"], Memfile_LeaseMgr::FILE_PID));
     pid_file.write();
 
-    std::unique_ptr<void, void(*)(void*)> p(static_cast<void*>(&pid_file), [](void* p) { reinterpret_cast<PIDFile*>(p)->deleteFile(); });
-
+    std::unique_ptr<void, void (*)(void*)> p(static_cast<void*>(&pid_file), [](void* pf) {
+        reinterpret_cast<PIDFile*>(pf)->deleteFile();
+    });
 
     // This command should reload test8.json config.
     sendHttpCommand("{ \"command\": \"config-reload\" }", response);
index 958a7a0378f3ccd7d50684ecda2ddf781074e769..c0f56c54c1caf62bcbc536a0d86ec4b5cc2dc383 100644 (file)
@@ -220,9 +220,9 @@ TEST_F(GssTsigImplTest, envVars) {
     char* ktname = getenv("KRB5_CLIENT_KTNAME");
     ASSERT_TRUE(ktname);
     EXPECT_EQ("foo", string(ktname));
-    char* ccname = getenv("KRB5CCNAME");
-    ASSERT_TRUE(ccname);
-    EXPECT_EQ("bar", string(ccname));
+    char* krb5ccname = getenv("KRB5CCNAME");
+    ASSERT_TRUE(krb5ccname);
+    EXPECT_EQ("bar", string(krb5ccname));
 }
 
 /// @brief Tests status-get command processed handler.
index 6ee2156ee63ed17c7d1d3c6faa9087ffaa6fcfe5..9321637733872eb6972fedfe4323b2e87585dbe5 100644 (file)
@@ -1457,13 +1457,13 @@ HAService::asyncSendLeaseUpdate(const QueryPtrType& query,
                               request, response,
         [this, weak_query, parking_lot, config]
             (const boost::system::error_code& ec,
-             const HttpResponsePtr& response,
+             const HttpResponsePtr& http_response,
              const std::string& error_str) {
             // Get the shared pointer of the query. The server should keep the
             // pointer to the query and then park it. Therefore, we don't really
             // expect it to be null. If it is null, something is really wrong.
-            QueryPtrType query = weak_query.lock();
-            if (!query) {
+            QueryPtrType query_ptr = weak_query.lock();
+            if (!query_ptr) {
                 isc_throw(Unexpected, "query is null while receiving response from"
                           " HA peer. This is programmatic error");
             }
@@ -1483,7 +1483,7 @@ HAService::asyncSendLeaseUpdate(const QueryPtrType& query,
             if (ec || !error_str.empty()) {
                 LOG_WARN(ha_logger, HA_LEASE_UPDATE_COMMUNICATIONS_FAILED)
                     .arg(config_->getThisServerName())
-                    .arg(query->getLabel())
+                    .arg(query_ptr->getLabel())
                     .arg(config->getLogLabel())
                     .arg(ec ? ec.message() : error_str);
 
@@ -1495,20 +1495,20 @@ HAService::asyncSendLeaseUpdate(const QueryPtrType& query,
 
                 try {
                     int rcode = 0;
-                    auto args = verifyAsyncResponse(response, rcode);
+                    auto args = verifyAsyncResponse(http_response, rcode);
                     // In the v6 case the server may return a list of failed lease
                     // updates and we should log them.
-                    logFailedLeaseUpdates(query, args);
+                    logFailedLeaseUpdates(query_ptr, args);
 
                 } catch (const ConflictError& ex) {
                     // Handle forth group of errors.
                     lease_update_conflict = true;
                     lease_update_success = false;
-                    communication_state_->reportRejectedLeaseUpdate(query);
+                    communication_state_->reportRejectedLeaseUpdate(query_ptr);
 
                     LOG_WARN(ha_logger, HA_LEASE_UPDATE_CONFLICT)
                         .arg(config_->getThisServerName())
-                        .arg(query->getLabel())
+                        .arg(query_ptr->getLabel())
                         .arg(config->getLogLabel())
                         .arg(ex.what());
 
@@ -1516,7 +1516,7 @@ HAService::asyncSendLeaseUpdate(const QueryPtrType& query,
                     // Handle third group of errors.
                     LOG_WARN(ha_logger, HA_LEASE_UPDATE_FAILED)
                         .arg(config_->getThisServerName())
-                        .arg(query->getLabel())
+                        .arg(query_ptr->getLabel())
                         .arg(config->getLogLabel())
                         .arg(ex.what());
 
@@ -1541,7 +1541,7 @@ HAService::asyncSendLeaseUpdate(const QueryPtrType& query,
                 } else {
                     // Lease update successful and we may need to clear some previously
                     // rejected lease updates.
-                    communication_state_->reportSuccessfulLeaseUpdate(query);
+                    communication_state_->reportSuccessfulLeaseUpdate(query_ptr);
                 }
             }
 
@@ -1554,7 +1554,7 @@ HAService::asyncSendLeaseUpdate(const QueryPtrType& query,
                 // case the DHCP exchange fails.
                 if (!lease_update_success) {
                     if (parking_lot) {
-                        parking_lot->drop(query);
+                        parking_lot->drop(query_ptr);
                     }
                 }
             } else {
@@ -1563,7 +1563,7 @@ HAService::asyncSendLeaseUpdate(const QueryPtrType& query,
                 return;
             }
 
-            if (leaseUpdateComplete(query, parking_lot)) {
+            if (leaseUpdateComplete(query_ptr, parking_lot)) {
                 // If we have finished sending the lease updates we need to run the
                 // state machine until the state machine finds that additional events
                 // are required, such as next heartbeat or a lease update. The runModel()
@@ -1643,9 +1643,7 @@ HAService::logFailedLeaseUpdates(const PktPtr& query,
 
     // Instead of duplicating the code between the failed-deleted-leases and
     // failed-leases, let's just have one function that does it for both.
-    auto log_proc = [](const PktPtr query, const ConstElementPtr& args,
-                       const std::string& param_name, const log::MessageID& mesid) {
-
+    auto log_proc = [query, args](const std::string& param_name, const log::MessageID& mesid) {
         // Check if there are any failed leases.
         auto failed_leases = args->get(param_name);
 
@@ -1679,10 +1677,10 @@ HAService::logFailedLeaseUpdates(const PktPtr& query,
     };
 
     // Process "failed-deleted-leases"
-    log_proc(query, args, "failed-deleted-leases", HA_LEASE_UPDATE_DELETE_FAILED_ON_PEER);
+    log_proc("failed-deleted-leases", HA_LEASE_UPDATE_DELETE_FAILED_ON_PEER);
 
     // Process "failed-leases".
-    log_proc(query, args, "failed-leases", HA_LEASE_UPDATE_CREATE_UPDATE_FAILED_ON_PEER);
+    log_proc("failed-leases", HA_LEASE_UPDATE_CREATE_UPDATE_FAILED_ON_PEER);
 }
 
 ConstElementPtr
@@ -1808,7 +1806,7 @@ HAService::asyncSendHeartbeat() {
                               request, response,
         [this, partner_config, sync_complete_notified]
             (const boost::system::error_code& ec,
-             const HttpResponsePtr& response,
+             const HttpResponsePtr& http_response,
              const std::string& error_str) {
 
             // There are three possible groups of errors during the heartbeat.
@@ -1834,7 +1832,7 @@ HAService::asyncSendHeartbeat() {
                     // Response must contain arguments and the arguments must
                     // be a map.
                     int rcode = 0;
-                    ConstElementPtr args = verifyAsyncResponse(response, rcode);
+                    ConstElementPtr args = verifyAsyncResponse(http_response, rcode);
                     if (!args || args->getType() != Element::map) {
                         isc_throw(CtrlChannelError, "returned arguments in the response"
                                   " must be a map");
@@ -1974,7 +1972,7 @@ HAService::asyncDisableDHCPService(HttpClient& http_client,
                                  request, response,
         [this, remote_config, post_request_action]
             (const boost::system::error_code& ec,
-             const HttpResponsePtr& response,
+             const HttpResponsePtr& http_response,
              const std::string& error_str) {
 
              // There are three possible groups of errors during the heartbeat.
@@ -1998,7 +1996,7 @@ HAService::asyncDisableDHCPService(HttpClient& http_client,
 
                  // Handle third group of errors.
                  try {
-                     static_cast<void>(verifyAsyncResponse(response, rcode));
+                     static_cast<void>(verifyAsyncResponse(http_response, rcode));
 
                  } catch (const std::exception& ex) {
                      error_message = ex.what();
@@ -2052,7 +2050,7 @@ HAService::asyncEnableDHCPService(HttpClient& http_client,
                                  request, response,
         [this, remote_config, post_request_action]
             (const boost::system::error_code& ec,
-             const HttpResponsePtr& response,
+             const HttpResponsePtr& http_response,
              const std::string& error_str) {
 
              // There are three possible groups of errors during the heartbeat.
@@ -2076,7 +2074,7 @@ HAService::asyncEnableDHCPService(HttpClient& http_client,
 
                  // Handle third group of errors.
                  try {
-                     static_cast<void>(verifyAsyncResponse(response, rcode));
+                     static_cast<void>(verifyAsyncResponse(http_response, rcode));
 
                  } catch (const std::exception& ex) {
                      error_message = ex.what();
@@ -2197,12 +2195,12 @@ HAService::asyncSyncLeasesInternal(http::HttpClient& http_client,
                                  request, response,
         [this, remote_config, post_sync_action, &http_client, max_period, dhcp_disabled]
             (const boost::system::error_code& ec,
-             const HttpResponsePtr& response,
+             const HttpResponsePtr& http_response,
              const std::string& error_str) {
 
              // Holds last lease received on the page of leases. If the last
              // page was hit, this value remains null.
-             LeasePtr last_lease;
+             LeasePtr last_lease_in_callback;
 
             // There are three possible groups of errors during the heartbeat.
             // One is the IO error causing issues in communication with the peer.
@@ -2224,7 +2222,7 @@ HAService::asyncSyncLeasesInternal(http::HttpClient& http_client,
                 // Handle third group of errors.
                 try {
                     int rcode = 0;
-                    ConstElementPtr args = verifyAsyncResponse(response, rcode);
+                    ConstElementPtr args = verifyAsyncResponse(http_response, rcode);
 
                     // Arguments must be a map.
                     if (args && (args->getType() != Element::map)) {
@@ -2260,7 +2258,7 @@ HAService::asyncSyncLeasesInternal(http::HttpClient& http_client,
                                 // lease4-get-page command.
                                 if ((leases_element.size() >= config_->getSyncPageLimit()) &&
                                     (l + 1 == leases_element.end())) {
-                                    last_lease = boost::dynamic_pointer_cast<Lease>(lease);
+                                    last_lease_in_callback = boost::dynamic_pointer_cast<Lease>(lease);
                                 }
 
                                 if (!lease_sync_filter_.shouldSync(lease)) {
@@ -2299,7 +2297,7 @@ HAService::asyncSyncLeasesInternal(http::HttpClient& http_client,
                                 // lease6-get-page command.
                                 if ((leases_element.size() >= config_->getSyncPageLimit()) &&
                                     (l + 1 == leases_element.end())) {
-                                    last_lease = boost::dynamic_pointer_cast<Lease>(lease);
+                                    last_lease_in_callback = boost::dynamic_pointer_cast<Lease>(lease);
                                 }
 
                                 if (!lease_sync_filter_.shouldSync(lease)) {
@@ -2358,10 +2356,10 @@ HAService::asyncSyncLeasesInternal(http::HttpClient& http_client,
              if (!error_message.empty()) {
                  communication_state_->setPartnerUnavailable();
 
-             } else if (last_lease) {
+             } else if (last_lease_in_callback) {
                  // This indicates that there are more leases to be fetched.
                  // Therefore, we have to send another leaseX-get-page command.
-                 asyncSyncLeases(http_client, remote_config, max_period, last_lease,
+                 asyncSyncLeases(http_client, remote_config, max_period, last_lease_in_callback,
                                  post_sync_action, dhcp_disabled);
                  return;
              }
@@ -2428,22 +2426,22 @@ HAService::synchronize(std::string& status_message,
             // partner.
             if (success) {
                 asyncSyncCompleteNotify(client, remote_config,
-                                        [&](const bool success,
-                                            const std::string& error_message,
+                                        [&](const bool /* success */,
+                                            const std::string& error_message_1,
                                             const int rcode) {
                     // This command may not be supported by the partner when it
                     // runs an older Kea version. In that case, send the dhcp-enable
                     // command as in previous Kea version.
                     if (rcode == CONTROL_RESULT_COMMAND_UNSUPPORTED) {
                         asyncEnableDHCPService(client, remote_config,
-                                               [&](const bool success,
-                                                   const std::string& error_message,
+                                               [&](const bool is_success,
+                                                   const std::string& error_message_2,
                                                    const int) {
                             // It is possible that we have already recorded an error
                             // message while synchronizing the lease database. Don't
                             // override the existing error message.
-                            if (!success && status_message.empty()) {
-                                status_message = error_message;
+                            if (!is_success && status_message.empty()) {
+                                status_message = error_message_2;
                             }
 
                             // The synchronization process is completed, so let's break
@@ -2456,7 +2454,7 @@ HAService::synchronize(std::string& status_message,
                         // ha-sync-complete-notify command was delivered to the partner.
                         // The synchronization process ends here.
                         if (!success && status_message.empty()) {
-                            status_message = error_message;
+                            status_message = error_message_1;
                         }
 
                         io_service->stop();
@@ -2469,11 +2467,11 @@ HAService::synchronize(std::string& status_message,
                 // ha-sync-complete-notify command in this case. It is only sent in
                 // the case when synchronization ends successfully.
                 asyncEnableDHCPService(client, remote_config,
-                                       [&](const bool success,
-                                           const std::string& error_message,
+                                       [&](const bool is_success,
+                                           const std::string& error_message_1,
                                            const int) {
-                    if (!success && status_message.empty()) {
-                        status_message = error_message;
+                    if (!is_success && status_message.empty()) {
+                        status_message = error_message_1;
                     }
 
                     // The synchronization process is completed, so let's break
@@ -2574,7 +2572,7 @@ HAService::asyncSendLeaseUpdatesFromBacklog(HttpClient& http_client,
                                  request, response,
         [this, &http_client, config, post_request_action]
             (const boost::system::error_code& ec,
-             const HttpResponsePtr& response,
+             const HttpResponsePtr& http_response,
              const std::string& error_str) {
 
              int rcode = 0;
@@ -2590,7 +2588,7 @@ HAService::asyncSendLeaseUpdatesFromBacklog(HttpClient& http_client,
              } else {
                  // Handle third group of errors.
                  try {
-                    auto args = verifyAsyncResponse(response, rcode);
+                    auto args = verifyAsyncResponse(http_response, rcode);
                  } catch (const std::exception& ex) {
                      error_message = ex.what();
                      LOG_WARN(ha_logger, HA_LEASES_BACKLOG_FAILED)
@@ -2684,7 +2682,7 @@ HAService::asyncSendHAReset(HttpClient& http_client,
                                  request, response,
         [this, config, post_request_action]
             (const boost::system::error_code& ec,
-             const HttpResponsePtr& response,
+             const HttpResponsePtr& http_response,
              const std::string& error_str) {
 
              int rcode = 0;
@@ -2700,7 +2698,7 @@ HAService::asyncSendHAReset(HttpClient& http_client,
              } else {
                  // Handle third group of errors.
                  try {
-                    auto args = verifyAsyncResponse(response, rcode);
+                    auto args = verifyAsyncResponse(http_response, rcode);
                  } catch (const std::exception& ex) {
                      error_message = ex.what();
                      LOG_WARN(ha_logger, HA_RESET_FAILED)
@@ -2856,7 +2854,7 @@ HAService::processMaintenanceStart() {
         [this, remote_config, &io_service, &captured_ec, &captured_error_message,
          &captured_rcode]
             (const boost::system::error_code& ec,
-             const HttpResponsePtr& response,
+             const HttpResponsePtr& http_response,
              const std::string& error_str) {
 
              io_service->stop();
@@ -2881,7 +2879,7 @@ HAService::processMaintenanceStart() {
 
                  // Handle third group of errors.
                  try {
-                     static_cast<void>(verifyAsyncResponse(response, captured_rcode));
+                     static_cast<void>(verifyAsyncResponse(http_response, captured_rcode));
 
                  } catch (const std::exception& ex) {
                      error_message = ex.what();
@@ -2990,7 +2988,7 @@ HAService::processMaintenanceCancel() {
                             request, response,
         [this, remote_config, &io_service, &error_message]
             (const boost::system::error_code& ec,
-             const HttpResponsePtr& response,
+             const HttpResponsePtr& http_response,
              const std::string& error_str) {
 
              io_service->stop();
@@ -3008,7 +3006,7 @@ HAService::processMaintenanceCancel() {
                  // Handle third group of errors.
                  try {
                      int rcode = 0;
-                     ConstElementPtr args = verifyAsyncResponse(response, rcode);
+                     ConstElementPtr args = verifyAsyncResponse(http_response, rcode);
 
                      // Partner's state has changed after the notification. However, we don't know
                      // its new state. We'll check if the partner returned its state. If it didn't,
@@ -3102,7 +3100,7 @@ HAService::asyncSyncCompleteNotify(HttpClient& http_client,
                                  request, response,
         [this, remote_config, post_request_action]
             (const boost::system::error_code& ec,
-             const HttpResponsePtr& response,
+             const HttpResponsePtr& http_response,
              const std::string& error_str) {
 
              // There are three possible groups of errors. One is the IO error
@@ -3126,7 +3124,7 @@ HAService::asyncSyncCompleteNotify(HttpClient& http_client,
 
                  // Handle third group of errors.
                  try {
-                     static_cast<void>(verifyAsyncResponse(response, rcode));
+                     static_cast<void>(verifyAsyncResponse(http_response, rcode));
 
                  } catch (const CommandUnsupportedError& ex) {
                      rcode = CONTROL_RESULT_COMMAND_UNSUPPORTED;
index 0d39c888038a544ef1a32c7b0027c048033645f7..4e4e557c8adb02fed75df3e2a5b94b3f9cc6ac0b 100644 (file)
@@ -2682,13 +2682,13 @@ public:
             // reporting the parsing error. The dependency check is performed later
             // at the database level.
             parser.parse(expression, Element::create(client_class->getTest()), AF_INET,
-                         [&dependencies, &depend_on_known](const ClientClass& client_class) -> bool {
-                if (isClientClassBuiltIn(client_class)) {
-                    if ((client_class == "KNOWN") || (client_class == "UNKNOWN")) {
+                         [&dependencies, &depend_on_known](const ClientClass& cc) -> bool {
+                if (isClientClassBuiltIn(cc)) {
+                    if ((cc == "KNOWN") || (cc == "UNKNOWN")) {
                         depend_on_known = true;
                     }
                 } else {
-                    dependencies.push_back(client_class);
+                    dependencies.push_back(cc);
                 }
                 return (true);
             });
index 6b337da757ac74f397abb4b38005457ac08dd6a5..f30ea0eb0f1e7fa451bb06dbccdb74c480af3cfe 100644 (file)
@@ -3078,13 +3078,13 @@ public:
             // reporting the parsing error. The dependency check is performed later
             // at the database level.
             parser.parse(expression, Element::create(client_class->getTest()), AF_INET6,
-                         [&dependencies, &depend_on_known](const ClientClass& client_class) -> bool {
-                if (isClientClassBuiltIn(client_class)) {
-                    if ((client_class == "KNOWN") || (client_class == "UNKNOWN")) {
+                         [&dependencies, &depend_on_known](const ClientClass& cc) -> bool {
+                if (isClientClassBuiltIn(cc)) {
+                    if ((cc == "KNOWN") || (cc == "UNKNOWN")) {
                         depend_on_known = true;
                     }
                 } else {
-                    dependencies.push_back(client_class);
+                    dependencies.push_back(cc);
                 }
                 return (true);
             });
index aa5f63f17b4fe47bc175a1d6fe7fb4c95ab485c2..18224dd4090d42a13931260bd7388fc5da36d9ff 100644 (file)
@@ -315,9 +315,9 @@ MySqlConfigBackendImpl::getGlobalParameters(const int index,
                 // tag is provided), it takes precedence over the same parameter
                 // specified for all servers. Therefore, we check if the given
                 // parameter already exists and belongs to 'all'.
-                auto& index = local_parameters.get<StampedValueNameIndexTag>();
-                auto existing = index.find(name);
-                if (existing != index.end()) {
+                auto& name_index = local_parameters.get<StampedValueNameIndexTag>();
+                auto existing = name_index.find(name);
+                if (existing != name_index.end()) {
                     // This parameter was already fetched. Let's check if we should
                     // replace it or not.
                     if (!last_param_server_tag.amAll() && (*existing)->hasAllServerTag()) {
@@ -332,7 +332,7 @@ MySqlConfigBackendImpl::getGlobalParameters(const int index,
                 // If there is no such parameter yet or the existing parameter
                 // belongs to a different server and the inserted parameter is
                 // not for all servers.
-                if ((existing == index.end()) ||
+                if ((existing == name_index.end()) ||
                     (!(*existing)->hasServerTag(last_param_server_tag) &&
                      !last_param_server_tag.amAll())) {
                     local_parameters.insert(last_param);
@@ -448,8 +448,8 @@ MySqlConfigBackendImpl::getOptionDefs(const int index,
             // the same option definition specified for all servers.
             // Therefore, we check if the given option already exists and
             // belongs to 'all'.
-            auto& index = local_option_defs.get<1>();
-            auto existing_it_pair = index.equal_range(last_def->getCode());
+            auto& code_index = local_option_defs.get<1>();
+            auto existing_it_pair = code_index.equal_range(last_def->getCode());
             auto existing_it = existing_it_pair.first;
             bool found = false;
             for ( ; existing_it != existing_it_pair.second; ++existing_it) {
@@ -458,7 +458,7 @@ MySqlConfigBackendImpl::getOptionDefs(const int index,
                     // This option definition was already fetched. Let's check
                     // if we should replace it or not.
                     if (!last_def_server_tag.amAll() && (*existing_it)->hasAllServerTag()) {
-                        index.replace(existing_it, last_def);
+                        code_index.replace(existing_it, last_def);
                         return;
                     }
                     break;
@@ -793,8 +793,8 @@ MySqlConfigBackendImpl::getOptions(const int index,
                 // tag is provided), it takes precedence over the same option
                 // specified for all servers. Therefore, we check if the given
                 // option already exists and belongs to 'all'.
-                auto& index = local_options.get<1>();
-                auto existing_it_pair = index.equal_range(desc->option_->getType());
+                auto& type_index = local_options.get<1>();
+                auto existing_it_pair = type_index.equal_range(desc->option_->getType());
                 auto existing_it = existing_it_pair.first;
                 bool found = false;
                 for ( ; existing_it != existing_it_pair.second; ++existing_it) {
@@ -804,7 +804,7 @@ MySqlConfigBackendImpl::getOptions(const int index,
                         // This option was already fetched. Let's check if we should
                         // replace it or not.
                         if (!last_option_server_tag.amAll() && existing_it->hasAllServerTag()) {
-                            index.replace(existing_it, *desc);
+                            type_index.replace(existing_it, *desc);
                             return;
                         }
                         break;
index dcd044fcacac83368678f7cf46858b2bae2513b1..2841218d6f4e35e2a3ffb508c47f2296ee418632 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2024-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -28,8 +28,8 @@ using namespace isc::stats;
 using namespace isc::util;
 using namespace boost::posix_time;
 
-PerfMonMgr::PerfMonMgr(uint16_t family_)
-    : PerfMonConfig(family_), mutex_(new std::mutex) {
+PerfMonMgr::PerfMonMgr(uint16_t family)
+    : PerfMonConfig(family), mutex_(new std::mutex) {
     init();
 }
 
index 5e8a0e103d2ab494380d49eea54588157bc10af9..f1fecdc7fa93956bce299dad6360c9397d3d41a7 100644 (file)
@@ -295,9 +295,9 @@ PgSqlConfigBackendImpl::getGlobalParameters(const int index,
                 // specified for all servers. Therefore, we check if the given
                 // parameter already exists and belongs to 'all'.
                 ServerTag last_param_server_tag(server_tag_str);
-                auto& index = local_parameters.get<StampedValueNameIndexTag>();
-                auto existing = index.find(name);
-                if (existing != index.end()) {
+                auto& name_index = local_parameters.get<StampedValueNameIndexTag>();
+                auto existing = name_index.find(name);
+                if (existing != name_index.end()) {
                     // This parameter was already fetched. Let's check if we should
                     // replace it or not.
                     if (!last_param_server_tag.amAll() && (*existing)->hasAllServerTag()) {
@@ -312,7 +312,7 @@ PgSqlConfigBackendImpl::getGlobalParameters(const int index,
                 // If there is no such parameter yet or the existing parameter
                 // belongs to a different server and the inserted parameter is
                 // not for all servers.
-                if ((existing == index.end()) ||
+                if ((existing == name_index.end()) ||
                     (!(*existing)->hasServerTag(last_param_server_tag) &&
                      !last_param_server_tag.amAll())) {
                     local_parameters.insert(last_param);
@@ -413,8 +413,8 @@ PgSqlConfigBackendImpl::getOptionDefs(const int index,
             // the same option definition specified for all servers.
             // Therefore, we check if the given option already exists and
             // belongs to 'all'.
-            auto& index = local_option_defs.get<1>();
-            auto existing_it_pair = index.equal_range(last_def->getCode());
+            auto& code_index = local_option_defs.get<1>();
+            auto existing_it_pair = code_index.equal_range(last_def->getCode());
             auto existing_it = existing_it_pair.first;
             bool found = false;
             for ( ; existing_it != existing_it_pair.second; ++existing_it) {
@@ -423,7 +423,7 @@ PgSqlConfigBackendImpl::getOptionDefs(const int index,
                     // This option definition was already fetched. Let's check
                     // if we should replace it or not.
                     if (!last_def_server_tag.amAll() && (*existing_it)->hasAllServerTag()) {
-                        index.replace(existing_it, last_def);
+                        code_index.replace(existing_it, last_def);
                         return;
                     }
                     break;
@@ -723,8 +723,8 @@ PgSqlConfigBackendImpl::getOptions(const int index,
                 // tag is provided), it takes precedence over the same option
                 // specified for all servers. Therefore, we check if the given
                 // option already exists and belongs to 'all'.
-                auto& index = local_options.get<1>();
-                auto existing_it_pair = index.equal_range(desc->option_->getType());
+                auto& type_index = local_options.get<1>();
+                auto existing_it_pair = type_index.equal_range(desc->option_->getType());
                 auto existing_it = existing_it_pair.first;
                 bool found = false;
                 for ( ; existing_it != existing_it_pair.second; ++existing_it) {
@@ -734,7 +734,7 @@ PgSqlConfigBackendImpl::getOptions(const int index,
                         // This option was already fetched. Let's check if we should
                         // replace it or not.
                         if (!last_option_server_tag.amAll() && existing_it->hasAllServerTag()) {
-                            index.replace(existing_it, *desc);
+                            type_index.replace(existing_it, *desc);
                             return;
                         }
                         break;
index d97fe16f14ded7fc0af44837276545819df53b4e..17980fbf3eb249b6483ae49c46ff45a655a5f3cb 100644 (file)
@@ -517,9 +517,9 @@ AccessTest::server() {
                 IntervalTimer::ONE_SHOT);
 
     // Get the requests.
-    auto receive_handler = [this](boost::system::error_code ec, size_t size) {
+    auto receive_handler = [this](boost::system::error_code erc, size_t size) {
         lock_guard<mutex> lock(mutex_);
-        error_codes_.push_back(ec);
+        error_codes_.push_back(erc);
         sizes_.push_back(size);
     };
     vector<boost::asio::ip::udp::endpoint> clients(expected_received_);
index 9af3040647782684e24b52c99382593f73e35a30..3cb8357ee7ac1355c531f3b916e9685cf8107ce5 100644 (file)
@@ -577,9 +577,9 @@ AccountingTest::server() {
                 IntervalTimer::ONE_SHOT);
 
     // Get the requests.
-    auto receive_handler = [this](boost::system::error_code ec, size_t size) {
+    auto receive_handler = [this](boost::system::error_code erc, size_t size) {
         lock_guard<mutex> lock(mutex_);
-        error_codes_.push_back(ec);
+        error_codes_.push_back(erc);
         sizes_.push_back(size);
     };
     vector<boost::asio::ip::udp::endpoint> clients(expected_received_);
index dc3e0c45f4118a992bbd6d2da5afefa278821cfc..fdca70de4cfe92a2db54ad1ee5bd6481e8216c1e 100644 (file)
@@ -45,8 +45,8 @@ AttributeTest::compare(ConstAttributePtr first, ConstAttributePtr second) {
 
 bool
 AttributeTest::compare(const Attributes& first, const Attributes& second) {
-    auto f = [&](ConstAttributePtr first, ConstAttributePtr second) {
-        return (AttributeTest::compare(first, second));
+    auto f = [&](ConstAttributePtr first_attr, ConstAttributePtr second_attr) {
+        return (AttributeTest::compare(first_attr, second_attr));
     };
     return (std::equal(first.cbegin(), first.cend(), second.cbegin(), second.cend(), f));
 }
index 5cc4dc6ef0d9585a10ee2aef618afa7654e1a303..1b7bec8680fbd959251f4fc15624e679f7989dfb 100644 (file)
@@ -161,7 +161,6 @@ public:
         /// @brief function which returns true if the pair of option elements
         /// refer to the same option in the configuration.
         auto const& option_match = [&](ElementPtr& left, ElementPtr& right) -> bool {
-            std::string space = space_;
             std::string left_space = space;
             std::string right_space = space;
             if (left->get("space")) {
index e037678bc394c952e7ee265e1e13faf63c15f91b..b00967524ced6ecd7b4a95bc7ab6e1d6de33ff7c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016-2022 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
index 7c05db616b08a882f02c01efa979c5861bd96cac..56163bedb29d83cb50fcbe833ae84d8201e36784 100644 (file)
@@ -178,12 +178,12 @@ private:
   {
     boost::asio::async_read(socket_,
         boost::asio::buffer(reply_, length),
-        [this](const boost::system::error_code& error, std::size_t length)
+        [this](const boost::system::error_code& error, std::size_t len)
         {
           if (!error)
           {
             std::cout << "Reply: ";
-            std::cout.write(reply_, length);
+            std::cout.write(reply_, len);
             std::cout << "\n";
           }
           else
index 36f1dcddb043870367a7b92c83b0b84f4c0aae71..8da8ff5a0ce4e0d19b1b296443a4b32e7c208612 100644 (file)
@@ -121,12 +121,12 @@ private:
   {
     boost::asio::async_read(socket_,
         boost::asio::buffer(reply_, length),
-        [this](const boost::system::error_code& error, std::size_t length)
+        [this](const boost::system::error_code& error, std::size_t len)
         {
           if (!error)
           {
             std::cout << "Reply: ";
-            std::cout.write(reply_, length);
+            std::cout.write(reply_, len);
             std::cout << "\n";
           }
           else
index 102047656de0163599c06e4fc4760a464bfd3ff0..02053c004440f81844097af3b8d8dc431ef25cdc 100644 (file)
@@ -365,7 +365,9 @@ Connection::receiveHandler(const boost::system::error_code& ec,
 
             defer_shutdown_ = true;
 
-            std::unique_ptr<Connection, void(*)(Connection*)> p(this, [](Connection* p) { p->defer_shutdown_ = false; });
+            std::unique_ptr<Connection, void (*)(Connection*)> p(this, [](Connection* c) {
+                c->defer_shutdown_ = false;
+            });
 
             // Cancel the timer to make sure that long lasting command
             // processing doesn't cause the timeout.
index 90aa61eebe3e5ed9396c038388ff49e538156285..088ca7be2fd43fc51bb69054186d0d45f37be0ac 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -58,9 +58,9 @@ public:
             mgr().registerPacketQueueFactory(queue_type,
                                             [](data::ConstElementPtr parameters)
                                             -> PacketQueue4Ptr {
-                std::string queue_type ;
+                std::string queue_type_from_parameters;
                 try {
-                    queue_type = data::SimpleParser::getString(parameters, "queue-type");
+                    queue_type_from_parameters = data::SimpleParser::getString(parameters, "queue-type");
                 } catch (const std::exception& ex) {
                     isc_throw(InvalidQueueParameter,
                               "queue-type missing or invalid: " << ex.what());
@@ -74,7 +74,7 @@ public:
                               "'capacity' missing or invalid: " << ex.what());
                 }
 
-                return (PacketQueue4Ptr(new PacketQueueRing4(queue_type, capacity)));
+                return (PacketQueue4Ptr(new PacketQueueRing4(queue_type_from_parameters, capacity)));
             });
 
         return did_it;
index b97f7e9fdeb70c63f50b57f2da332ae39a587aef..178445bb9bc1785a571646a5cecee0b985bec647 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -47,9 +47,9 @@ public:
             mgr().registerPacketQueueFactory(queue_type,
                                             [](data::ConstElementPtr parameters)
                                             -> PacketQueue6Ptr {
-                std::string queue_type ;
+                std::string queue_type_from_parameters;
                 try {
-                    queue_type = data::SimpleParser::getString(parameters, "queue-type");
+                    queue_type_from_parameters = data::SimpleParser::getString(parameters, "queue-type");
                 } catch (const std::exception& ex) {
                     isc_throw(InvalidQueueParameter,
                               "queue-type missing or invalid: " << ex.what());
@@ -63,7 +63,7 @@ public:
                               "'capacity' missing or invalid: " << ex.what());
                 }
 
-                return (PacketQueue6Ptr(new PacketQueueRing6(queue_type, capacity)));
+                return (PacketQueue6Ptr(new PacketQueueRing6(queue_type_from_parameters, capacity)));
             });
 
         return did_it;
index a629d1d0865a870b2bb126c6ed54e232ef5bae32..0823325a983223d5be0c68dbd1bccec357941a46 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -125,7 +125,7 @@ NameChangeListener::invokeRecvHandler(const Result result,
     if (amListening()) {
         try {
             receiveNext();
-        } catch (const isc::Exception& ex) {
+        } catch (const isc::Exception& isc_ex) {
             // It is possible though unlikely, for doReceive to fail without
             // scheduling the read. While, unlikely, it does mean the callback
             // will not get called with a failure. A throw here would surface
@@ -133,7 +133,7 @@ NameChangeListener::invokeRecvHandler(const Result result,
             // close the window by invoking the application handler with
             // a failed result, and let the application layer sort it out.
             LOG_ERROR(dhcp_ddns_logger, DHCP_DDNS_NCR_RECV_NEXT_ERROR)
-                      .arg(ex.what());
+                      .arg(isc_ex.what());
 
             // Call the registered application layer handler.
             // Surround the invocation with a try-catch. The invoked handler is
@@ -143,10 +143,10 @@ NameChangeListener::invokeRecvHandler(const Result result,
             try {
                 io_pending_ = false;
                 (*recv_handler_)(ERROR, empty);
-            } catch (const std::exception& ex) {
+            } catch (const std::exception& std_ex) {
                 LOG_ERROR(dhcp_ddns_logger,
                           DHCP_DDNS_UNCAUGHT_NCR_RECV_HANDLER_ERROR)
-                          .arg(ex.what());
+                          .arg(std_ex.what());
             }
         }
     }
@@ -337,7 +337,7 @@ NameChangeSender::invokeSendHandlerInternal(const NameChangeSender::Result resul
         if (amSending()) {
             sendNext();
         }
-    } catch (const isc::Exception& ex) {
+    } catch (const isc::Exception& isc_ex) {
         // It is possible though unlikely, for sendNext to fail without
         // scheduling the send. While, unlikely, it does mean the callback
         // will not get called with a failure. A throw here would surface
@@ -345,7 +345,7 @@ NameChangeSender::invokeSendHandlerInternal(const NameChangeSender::Result resul
         // close the window by invoking the application handler with
         // a failed result, and let the application layer sort it out.
         LOG_ERROR(dhcp_ddns_logger, DHCP_DDNS_NCR_SEND_NEXT_ERROR)
-                  .arg(ex.what());
+                  .arg(isc_ex.what());
 
         // Invoke the completion handler passing in failed result.
         // Surround the invocation with a try-catch. The invoked handler is
@@ -353,9 +353,9 @@ NameChangeSender::invokeSendHandlerInternal(const NameChangeSender::Result resul
         // report it.
         try {
             (*send_handler_)(ERROR, ncr_to_send_);
-        } catch (const std::exception& ex) {
+        } catch (const std::exception& std_ex) {
             LOG_ERROR(dhcp_ddns_logger,
-                      DHCP_DDNS_UNCAUGHT_NCR_SEND_HANDLER_ERROR).arg(ex.what());
+                      DHCP_DDNS_UNCAUGHT_NCR_SEND_HANDLER_ERROR).arg(std_ex.what());
         }
     }
 }
index 2a78e83b443120901919a907d172fd50bb2d3378..5740e190a36bf715acba387d60c98e39197a63ff 100644 (file)
@@ -1044,24 +1044,25 @@ GenericConfigBackendDHCPv4Test::getSubnet4Test() {
         SCOPED_TRACE(test_case_name);
 
         // Test fetching subnet by id.
-        Subnet4Ptr returned_subnet;
-        ASSERT_NO_THROW_LOG(returned_subnet = cbptr_->getSubnet4(server_selector, subnet->getID()));
-        ASSERT_TRUE(returned_subnet);
+        Subnet4Ptr returned_subnet_2;
+        ASSERT_NO_THROW_LOG(
+            returned_subnet_2 = cbptr_->getSubnet4(server_selector, subnet->getID()));
+        ASSERT_TRUE(returned_subnet_2);
 
-        ASSERT_EQ(1, returned_subnet->getServerTags().size());
-        EXPECT_TRUE(returned_subnet->hasServerTag(ServerTag(expected_tag)));
+        ASSERT_EQ(1, returned_subnet_2->getServerTags().size());
+        EXPECT_TRUE(returned_subnet_2->hasServerTag(ServerTag(expected_tag)));
 
-        ASSERT_EQ(subnet->toElement()->str(), returned_subnet->toElement()->str());
+        ASSERT_EQ(subnet->toElement()->str(), returned_subnet_2->toElement()->str());
 
         // Test fetching subnet by prefix.
-        ASSERT_NO_THROW_LOG(returned_subnet = cbptr_->getSubnet4(server_selector,
-                                                                 subnet->toText()));
-        ASSERT_TRUE(returned_subnet);
+        ASSERT_NO_THROW_LOG(
+            returned_subnet_2 = cbptr_->getSubnet4(server_selector, subnet->toText()));
+        ASSERT_TRUE(returned_subnet_2);
 
-        ASSERT_EQ(1, returned_subnet->getServerTags().size());
-        EXPECT_TRUE(returned_subnet->hasServerTag(ServerTag(expected_tag)));
+        ASSERT_EQ(1, returned_subnet_2->getServerTags().size());
+        EXPECT_TRUE(returned_subnet_2->hasServerTag(ServerTag(expected_tag)));
 
-        EXPECT_EQ(subnet->toElement()->str(), returned_subnet->toElement()->str());
+        EXPECT_EQ(subnet->toElement()->str(), returned_subnet_2->toElement()->str());
     };
 
     {
index ce561bf7ba918f64ac255f66054dae09140076f0..cc3bcbd24727df841aaed441091e435082b29b4c 100644 (file)
@@ -1064,30 +1064,31 @@ GenericConfigBackendDHCPv6Test::getSubnet6Test() {
                  isc::InvalidOperation);
 
     // Test that this subnet will be fetched for various server selectors.
-    auto test_get_subnet = [this, &subnet] (const std::string& test_case_name,
-                                            const ServerSelector& server_selector,
-                                            const std::string& expected_tag = ServerTag::ALL) {
+    auto test_get_subnet = [this, &subnet](const std::string& test_case_name,
+                                           const ServerSelector& server_selector,
+                                           const std::string& expected_tag = ServerTag::ALL) {
         SCOPED_TRACE(test_case_name);
 
         // Test fetching subnet by id.
-        Subnet6Ptr returned_subnet;
-        ASSERT_NO_THROW_LOG(returned_subnet = cbptr_->getSubnet6(server_selector, subnet->getID()));
-        ASSERT_TRUE(returned_subnet);
+        Subnet6Ptr returned_subnet_2;
+        ASSERT_NO_THROW_LOG(
+            returned_subnet_2 = cbptr_->getSubnet6(server_selector, subnet->getID()));
+        ASSERT_TRUE(returned_subnet_2);
 
-        ASSERT_EQ(1, returned_subnet->getServerTags().size());
-        EXPECT_TRUE(returned_subnet->hasServerTag(ServerTag(expected_tag)));
+        ASSERT_EQ(1, returned_subnet_2->getServerTags().size());
+        EXPECT_TRUE(returned_subnet_2->hasServerTag(ServerTag(expected_tag)));
 
-        ASSERT_EQ(subnet->toElement()->str(), returned_subnet->toElement()->str());
+        ASSERT_EQ(subnet->toElement()->str(), returned_subnet_2->toElement()->str());
 
         // Test fetching subnet by prefix.
-        ASSERT_NO_THROW_LOG(returned_subnet = cbptr_->getSubnet6(server_selector,
-                                                                 subnet->toText()));
-        ASSERT_TRUE(returned_subnet);
+        ASSERT_NO_THROW_LOG(
+            returned_subnet_2 = cbptr_->getSubnet6(server_selector, subnet->toText()));
+        ASSERT_TRUE(returned_subnet_2);
 
-        ASSERT_EQ(1, returned_subnet->getServerTags().size());
-        EXPECT_TRUE(returned_subnet->hasServerTag(ServerTag(expected_tag)));
+        ASSERT_EQ(1, returned_subnet_2->getServerTags().size());
+        EXPECT_TRUE(returned_subnet_2->hasServerTag(ServerTag(expected_tag)));
 
-        EXPECT_EQ(subnet->toElement()->str(), returned_subnet->toElement()->str());
+        EXPECT_EQ(subnet->toElement()->str(), returned_subnet_2->toElement()->str());
     };
 
     {
index 1e8f232681ac4b1a5cc4e9090abf95c36b0ec229..66e38e4e8249b9d5c2d86dd64c27e847e18e26ae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -653,8 +653,8 @@ TEST_F(LabelSequenceTest, toRawText) {
 
     // toRawText is not supposed to do any sanity checks.
     // Let's try with a very weird name.
-    Name n2("xtra\tchars\n.in.name");
-    LabelSequence l2(n2);
+    Name name2("xtra\tchars\n.in.name");
+    LabelSequence l2(name2);
     EXPECT_EQ("xtra\tchars\n.in.name.", l2.toRawText(false));
 }
 
index 4413ba5629635ddca317dc1622322c4ef7bafc3c..1c8c5bbfd788de66a3783432d11d983edff89d46 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -390,42 +390,42 @@ TEST_F(MasterLexerStateTest, quotedString) {
 
     // If QSTRING is specified in option, '"' is regarded as a beginning of
     // a quoted string.
-    const MasterLexer::Options options = common_options | MasterLexer::QSTRING;
-    EXPECT_EQ(&s_qstring, State::start(lexer, options));
+    const MasterLexer::Options my_options = common_options | MasterLexer::QSTRING;
+    EXPECT_EQ(&s_qstring, State::start(lexer, my_options));
     EXPECT_FALSE(s_string.wasLastEOL(lexer)); // EOL is canceled due to '"'
     s_qstring.handle(lexer);
     stringTokenCheck("quoted string", s_string.getToken(lexer), true);
 
     // Empty string is okay as qstring
-    EXPECT_EQ(&s_qstring, State::start(lexer, options));
+    EXPECT_EQ(&s_qstring, State::start(lexer, my_options));
     s_qstring.handle(lexer);
     stringTokenCheck("", s_string.getToken(lexer), true);
 
     // Also checks other separator characters within a qstring
-    EXPECT_EQ(&s_qstring, State::start(lexer, options));
+    EXPECT_EQ(&s_qstring, State::start(lexer, my_options));
     s_qstring.handle(lexer);
     stringTokenCheck("quoted()\t\rstring", s_string.getToken(lexer), true);
 
     // escape character mostly doesn't have any effect in the qstring
     // processing
-    EXPECT_EQ(&s_qstring, State::start(lexer, options));
+    EXPECT_EQ(&s_qstring, State::start(lexer, my_options));
     s_qstring.handle(lexer);
     stringTokenCheck("escape\\ in quote", s_string.getToken(lexer), true);
 
     // The only exception is the quotation mark itself.  Note that the escape
     // only works on the quotation mark immediately after it.
-    EXPECT_EQ(&s_qstring, State::start(lexer, options));
+    EXPECT_EQ(&s_qstring, State::start(lexer, my_options));
     s_qstring.handle(lexer);
     stringTokenCheck("escaped\"", s_string.getToken(lexer), true);
 
     // quoted '\' then '"'.  Unlike the previous case '"' shouldn't be
     // escaped.
-    EXPECT_EQ(&s_qstring, State::start(lexer, options));
+    EXPECT_EQ(&s_qstring, State::start(lexer, my_options));
     s_qstring.handle(lexer);
     stringTokenCheck("escaped backslash\\\\", s_string.getToken(lexer), true);
 
     // ';' has no meaning in a quoted string (not indicating a comment)
-    EXPECT_EQ(&s_qstring, State::start(lexer, options));
+    EXPECT_EQ(&s_qstring, State::start(lexer, my_options));
     s_qstring.handle(lexer);
     stringTokenCheck("no;comment", s_string.getToken(lexer), true);
 }
@@ -437,28 +437,28 @@ TEST_F(MasterLexerStateTest, brokenQuotedString) {
     lexer.pushSource(ss);
 
     // EOL is encountered without closing the quote
-    const MasterLexer::Options options = common_options | MasterLexer::QSTRING;
-    EXPECT_EQ(&s_qstring, State::start(lexer, options));
+    const MasterLexer::Options my_options = common_options | MasterLexer::QSTRING;
+    EXPECT_EQ(&s_qstring, State::start(lexer, my_options));
     s_qstring.handle(lexer);
     ASSERT_EQ(Token::ERROR, s_qstring.getToken(lexer).getType());
     EXPECT_EQ(Token::UNBALANCED_QUOTES,
               s_qstring.getToken(lexer).getErrorCode());
     // We can resume after the error from the '\n'
-    EXPECT_EQ(s_null, State::start(lexer, options));
+    EXPECT_EQ(s_null, State::start(lexer, my_options));
     EXPECT_EQ(Token::END_OF_LINE, s_crlf.getToken(lexer).getType());
 
     // \n is okay in a quoted string if escaped
-    EXPECT_EQ(&s_qstring, State::start(lexer, options));
+    EXPECT_EQ(&s_qstring, State::start(lexer, my_options));
     s_qstring.handle(lexer);
     stringTokenCheck("quoted\\\n", s_string.getToken(lexer), true);
 
     // EOF is encountered without closing the quote
-    EXPECT_EQ(&s_qstring, State::start(lexer, options));
+    EXPECT_EQ(&s_qstring, State::start(lexer, my_options));
     s_qstring.handle(lexer);
     ASSERT_EQ(Token::ERROR, s_qstring.getToken(lexer).getType());
     EXPECT_EQ(Token::UNEXPECTED_END, s_qstring.getToken(lexer).getErrorCode());
     // If we continue we'll simply see the EOF
-    EXPECT_EQ(s_null, State::start(lexer, options));
+    EXPECT_EQ(s_null, State::start(lexer, my_options));
     EXPECT_EQ(Token::END_OF_FILE, s_crlf.getToken(lexer).getType());
 }
 
@@ -478,52 +478,52 @@ TEST_F(MasterLexerStateTest, basicNumbers) {
     lexer.pushSource(ss);
 
     // Ask the lexer to recognize numbers as well
-    const MasterLexer::Options options = common_options | MasterLexer::NUMBER;
+    const MasterLexer::Options my_options = common_options | MasterLexer::NUMBER;
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer);
     EXPECT_EQ(0, s_number.getToken(lexer).getNumber());
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer);
     EXPECT_EQ(1, s_number.getToken(lexer).getNumber());
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer);
     EXPECT_EQ(12345, s_number.getToken(lexer).getNumber());
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer);
     EXPECT_EQ(4294967295u, s_number.getToken(lexer).getNumber());
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer);
     EXPECT_EQ(Token::NUMBER_OUT_OF_RANGE,
               s_number.getToken(lexer).getErrorCode());
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer);
     EXPECT_EQ(Token::NUMBER_OUT_OF_RANGE,
               s_number.getToken(lexer).getErrorCode());
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer);
     EXPECT_EQ(5, s_number.getToken(lexer).getNumber());
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer);
     EXPECT_EQ(42, s_number.getToken(lexer).getNumber());
 
-    EXPECT_EQ(s_null, State::start(lexer, options));
+    EXPECT_EQ(s_null, State::start(lexer, my_options));
     EXPECT_TRUE(s_crlf.wasLastEOL(lexer));
     EXPECT_EQ(Token::END_OF_LINE, s_crlf.getToken(lexer).getType());
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer);
     EXPECT_EQ(37, s_number.getToken(lexer).getNumber());
 
     // If we continue we'll simply see the EOF
-    EXPECT_EQ(s_null, State::start(lexer, options));
+    EXPECT_EQ(s_null, State::start(lexer, my_options));
     EXPECT_EQ(Token::END_OF_FILE, s_crlf.getToken(lexer).getType());
 }
 
@@ -554,52 +554,52 @@ TEST_F(MasterLexerStateTest, stringNumbers) {
     stringTokenCheck("123", s_string.getToken(lexer), false);
 
     // Ask the lexer to recognize numbers as well
-    const MasterLexer::Options options = common_options | MasterLexer::NUMBER;
+    const MasterLexer::Options my_options = common_options | MasterLexer::NUMBER;
 
-    EXPECT_EQ(&s_string, State::start(lexer, options));
+    EXPECT_EQ(&s_string, State::start(lexer, my_options));
     s_string.handle(lexer);
     stringTokenCheck("-1", s_string.getToken(lexer), false);
 
     // Starts out as a number, but ends up being a string
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer);
     stringTokenCheck("123abc456", s_number.getToken(lexer), false);
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer);
     stringTokenCheck("123\\456", s_number.getToken(lexer), false);
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer); // recognize str, see ' ' at end
     stringTokenCheck("3scaped\\ space", s_number.getToken(lexer));
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer); // recognize str, see ' ' at end
     stringTokenCheck("3scaped\\\ttab", s_number.getToken(lexer));
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer); // recognize str, see ' ' at end
     stringTokenCheck("3scaped\\(paren", s_number.getToken(lexer));
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer); // recognize str, see ' ' at end
     stringTokenCheck("3scaped\\)close", s_number.getToken(lexer));
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer); // recognize str, see ' ' at end
     stringTokenCheck("3scaped\\;comment", s_number.getToken(lexer));
 
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer); // recognize str, see ' ' in mid
     stringTokenCheck("3scaped\\\\", s_number.getToken(lexer));
 
     // Confirm the word that follows the escaped '\' is correctly recognized.
-    EXPECT_EQ(&s_number, State::start(lexer, options));
+    EXPECT_EQ(&s_number, State::start(lexer, my_options));
     s_number.handle(lexer); // recognize str, see ' ' at end
     stringTokenCheck("8ackslash", s_number.getToken(lexer));
 
     // If we continue we'll simply see the EOF
-    EXPECT_EQ(s_null, State::start(lexer, options));
+    EXPECT_EQ(s_null, State::start(lexer, my_options));
     EXPECT_EQ(Token::END_OF_FILE, s_crlf.getToken(lexer).getType());
 }
 
index 40ca68b789170e3180b62497879834642c21f908..d9c6ec4a3223df79337954c8e3da6c21ff291d66 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2021-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2021-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -238,7 +238,7 @@ TEST_F(Rdata_TKEY_Test, createFromWireWithOtherData) {
     matchWireData(&expect_key[0], expect_key.size(),
                   tkey.getKey(), tkey.getKeyLen());
 
-    vector<uint8_t> expect_data = { 'a', 'b', 'c', 'd', '0', '1', '2', '3' };
+    expect_data = { 'a', 'b', 'c', 'd', '0', '1', '2', '3' };
     matchWireData(&expect_data[0], expect_data.size(),
                   tkey.getOtherData(), tkey.getOtherLen());
 }
@@ -250,7 +250,7 @@ TEST_F(Rdata_TKEY_Test, createFromWireWithoutKey) {
     EXPECT_EQ(0, tkey.getKeyLen());
     EXPECT_FALSE(tkey.getKey());
 
-    vector<uint8_t> expect_data = { 'a', 'b', 'c', 'd', '0', '1', '2', '3' };
+    expect_data = { 'a', 'b', 'c', 'd', '0', '1', '2', '3' };
     matchWireData(&expect_data[0], expect_data.size(),
                   tkey.getOtherData(), tkey.getOtherLen());
 }
index 2eb418b6f67967eb9d318047c1423402c374dda1..b59d0da42fd5b0673acc75d7f57e556dc5e4f0e9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -361,9 +361,9 @@ TEST_F(TSIGTest, signAtActualTime) {
 
 TEST_F(TSIGTest, signBadData) {
     // some specific bad data should be rejected proactively.
-    const unsigned char dummy_data = 0;
+    const unsigned char dummy = 0;
     EXPECT_THROW(tsig_ctx->sign(0, 0, 10), InvalidParameter);
-    EXPECT_THROW(tsig_ctx->sign(0, &dummy_data, 0), InvalidParameter);
+    EXPECT_THROW(tsig_ctx->sign(0, &dummy, 0), InvalidParameter);
 }
 
 TEST_F(TSIGTest, verifyBadData) {
index da73bb25936c5c6e1d517e8d176246912ddc6914..71fb61a00d3f300da999039dea835a8440d50bc4 100644 (file)
@@ -589,7 +589,7 @@ TEST_F(ExpressionsTest, popOrBranchTrue) {
     ASSERT_NO_THROW(label.reset(new TokenLabel(123)));
     TokenPtr left;
     TokenPtr right;
-    bool result_(false);
+    bool result(false);
 
     // False or false == false.
     ASSERT_NO_THROW(left.reset(new TokenString("false")));
@@ -598,8 +598,8 @@ TEST_F(ExpressionsTest, popOrBranchTrue) {
     e_.push_back(branch);
     e_.push_back(right);
     e_.push_back(label);
-    ASSERT_NO_THROW(result_ = evaluateBool(e_, *pkt4_));
-    EXPECT_FALSE(result_);
+    ASSERT_NO_THROW(result = evaluateBool(e_, *pkt4_));
+    EXPECT_FALSE(result);
     e_.clear();
 
     // False or true == true.
@@ -634,7 +634,7 @@ TEST_F(ExpressionsTest, popOrBranchFalse) {
     ASSERT_NO_THROW(label.reset(new TokenLabel(123)));
     TokenPtr left;
     TokenPtr right;
-    bool result_(false);
+    bool result(false);
 
     // True and true == true.
     ASSERT_NO_THROW(left.reset(new TokenString("true")));
@@ -643,8 +643,8 @@ TEST_F(ExpressionsTest, popOrBranchFalse) {
     e_.push_back(branch);
     e_.push_back(right);
     e_.push_back(label);
-    ASSERT_NO_THROW(result_ = evaluateBool(e_, *pkt4_));
-    EXPECT_TRUE(result_);
+    ASSERT_NO_THROW(result = evaluateBool(e_, *pkt4_));
+    EXPECT_TRUE(result);
     e_.clear();
 
     // True and false == false.
@@ -654,8 +654,8 @@ TEST_F(ExpressionsTest, popOrBranchFalse) {
     e_.push_back(branch);
     e_.push_back(right);
     e_.push_back(label);
-    ASSERT_NO_THROW(result_ = evaluateBool(e_, *pkt4_));
-    EXPECT_FALSE(result_);
+    ASSERT_NO_THROW(result = evaluateBool(e_, *pkt4_));
+    EXPECT_FALSE(result);
     e_.clear();
 
     // False and any thing == false.
@@ -665,8 +665,8 @@ TEST_F(ExpressionsTest, popOrBranchFalse) {
     e_.push_back(branch);
     e_.push_back(right);
     e_.push_back(label);
-    EXPECT_NO_THROW(result_ = evaluateBool(e_, *pkt6_));
-    EXPECT_FALSE(result_);
+    EXPECT_NO_THROW(result = evaluateBool(e_, *pkt6_));
+    EXPECT_FALSE(result);
 }
 
 // Tests the pop and branch when false / lazy if.
@@ -689,7 +689,7 @@ TEST_F(ExpressionsTest, popAndBranchFalse) {
     ASSERT_NO_THROW(bar.reset(new TokenString("bar")));
     TokenPtr extra;
     ASSERT_NO_THROW(extra.reset(new TokenString("extra token")));
-    string result_("");
+    string result("");
 
     // if true then foo else bar == foo
     ASSERT_NO_THROW(test.reset(new TokenString("true")));
@@ -701,8 +701,8 @@ TEST_F(ExpressionsTest, popAndBranchFalse) {
     e_.push_back(bar);
     e_.push_back(extra);
     e_.push_back(label2);
-    ASSERT_NO_THROW(result_ = evaluateString(e_, *pkt4_));
-    EXPECT_EQ("foo", result_);
+    ASSERT_NO_THROW(result = evaluateString(e_, *pkt4_));
+    EXPECT_EQ("foo", result);
     e_.clear();
 
     // if false then foo else bar == bar
@@ -715,8 +715,8 @@ TEST_F(ExpressionsTest, popAndBranchFalse) {
     e_.push_back(label1);
     e_.push_back(bar);
     e_.push_back(label2);
-    ASSERT_NO_THROW(result_ = evaluateString(e_, *pkt6_));
-    EXPECT_EQ("bar", result_);
+    ASSERT_NO_THROW(result = evaluateString(e_, *pkt6_));
+    EXPECT_EQ("bar", result);
 }
 
 }
index bff0f4fb8a890a52fd8139bd4a3bbac37229d23f..f6fef33b1ba2cb9b891b74617e8233bb876251ba 100644 (file)
@@ -548,7 +548,9 @@ HttpConnection::socketReadCallback(HttpConnection::TransactionPtr transaction,
 
         defer_shutdown_ = true;
 
-        std::unique_ptr<HttpConnection, void(*)(HttpConnection*)> p(this, [](HttpConnection* p) { p->defer_shutdown_ = false; });
+        std::unique_ptr<HttpConnection, void (*)(HttpConnection*)> p(this, [](HttpConnection* c) {
+            c->defer_shutdown_ = false;
+        });
 
         // Create the response from the received request using the custom
         // response creator.
index 5a265cc04f768d380440c46d841ef18356f07b4c..7898bdeafa29a4934902e2a6eac9b7df2c6206f4 100644 (file)
@@ -338,12 +338,12 @@ public:
             }
 
             // Get stringified thread-id.
-            std::stringstream ss;
-            ss << std::this_thread::get_id();
+            std::stringstream tid_ss;
+            tid_ss << std::this_thread::get_id();
 
             // Create the ClientRR.
             ClientRRPtr clientRR(new ClientRR());
-            clientRR->thread_id_ = ss.str();
+            clientRR->thread_id_ = tid_ss.str();
             clientRR->request_ = request_json;
             clientRR->response_ = response_json;
 
@@ -400,12 +400,12 @@ public:
             ASSERT_FALSE(ec) << "asyncSendRequest failed, ec: " << ec;
 
             // Get stringified thread-id.
-            std::stringstream ss;
-            ss << std::this_thread::get_id();
+            std::stringstream tid_ss;
+            tid_ss << std::this_thread::get_id();
 
             // Create the ClientRR.
             ClientRRPtr clientRR(new ClientRR());
-            clientRR->thread_id_ = ss.str();
+            clientRR->thread_id_ = tid_ss.str();
             clientRR->request_ = request_json;
             clientRR->response_ = response_json;
 
index 90d058ef078458258d5137d665544741627895f3..74a61aa11dfde19662ccf252e7f9cda0a55102e0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -423,7 +423,7 @@ public:
         ASSERT_NO_THROW(client.asyncSendRequest(url, client_context_,
                                                 request, response,
             [this](const boost::system::error_code& ec,
-                   const HttpResponsePtr& response,
+                   const HttpResponsePtr& http_response,
                    const std::string& parsing_error) {
                 io_service_->stop();
                 // There should be no IO error (answer from the server is received).
@@ -431,7 +431,7 @@ public:
                     ADD_FAILURE() << "asyncSendRequest failed: " << ec.message();
                 }
                 // The response object is NULL because it couldn't be finalized.
-                EXPECT_FALSE(response);
+                EXPECT_FALSE(http_response);
                 // The message parsing error should be returned.
                 EXPECT_FALSE(parsing_error.empty());
             }));
@@ -524,7 +524,7 @@ public:
         ASSERT_NO_THROW(client.asyncSendRequest(url, client_context_,
                                                 request, response,
             [this, &cb_num](const boost::system::error_code& ec,
-                            const HttpResponsePtr& response,
+                            const HttpResponsePtr& http_response,
                             const std::string&) {
                 if (++cb_num > 1) {
                     io_service_->stop();
@@ -534,7 +534,7 @@ public:
                 // error code.
                 EXPECT_TRUE(ec.value() == boost::asio::error::timed_out);
                 // There should be no response returned.
-                EXPECT_FALSE(response);
+                EXPECT_FALSE(http_response);
 
             },
             HttpClient::RequestTimeout(100),
index ed8af55fc32ebe7537dd0f32b9f994e54891e05b..84397c3ab469cc300a83be3a60c3dab1ac484a4f 100644 (file)
@@ -413,10 +413,10 @@ public:
                 }
             }
             stream_.async_handshake(roleToImpl(TlsRole::CLIENT),
-            [this, request](const boost::system::error_code& ec) {
-                if (ec) {
+            [this, request](const boost::system::error_code& erc) {
+                if (erc) {
                     ADD_FAILURE() << "error occurred during handshake: "
-                                  << ec.message();
+                                  << erc.message();
                     io_service_->stop();
                     return;
                 }
index ba1538ce9f643d1d7a9204cc79fc4f34c5d9b1ab..60da352cbd59772d38f0d0e37a6df5838313c746 100644 (file)
@@ -136,9 +136,9 @@ public:
                 }
 
             if (useTls()) {
-                SocketCallback socket_cb(
-                    [this](boost::system::error_code ec, size_t /*length */) {
-                        if (ec) {
+                SocketCallback tls_socket_cb(
+                    [this](boost::system::error_code erc, size_t /*length */) {
+                        if (erc) {
                             handshake_failed_ = true;
                             done_callback_();
                         } else {
@@ -146,7 +146,7 @@ public:
                         }
                 });
 
-                tls_socket_->handshake(socket_cb);
+                tls_socket_->handshake(tls_socket_cb);
             } else {
                 sendNextRequest();
             }