From: Francis Dupont Date: Mon, 15 Dec 2025 21:06:20 +0000 (+0100) Subject: [#4266] Replaced BOOST_STATIC_ASSERT X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c54dfd47714fea7e79c16d99c09b896d9c8d44df;p=thirdparty%2Fkea.git [#4266] Replaced BOOST_STATIC_ASSERT --- diff --git a/src/hooks/d2/gss_tsig/gss_tsig_cfg.cc b/src/hooks/d2/gss_tsig/gss_tsig_cfg.cc index 2edabfe207..78c5a8c05b 100644 --- a/src/hooks/d2/gss_tsig/gss_tsig_cfg.cc +++ b/src/hooks/d2/gss_tsig/gss_tsig_cfg.cc @@ -59,8 +59,10 @@ DnsServer::DnsServer(const string& id, const set& domains, rekey_interval_(DEFAULT_REKEY_INTERVAL), retry_interval_(DEFAULT_RETRY_INTERVAL), tkey_proto_(IOFetch::TCP), fallback_(false), exchange_timeout_(DEFAULT_EXCHANGE_TIMEOUT), timer_() { - BOOST_STATIC_ASSERT(DEFAULT_REKEY_INTERVAL < DEFAULT_KEY_LIFETIME); - BOOST_STATIC_ASSERT(DEFAULT_RETRY_INTERVAL < DEFAULT_REKEY_INTERVAL); + static_assert(DEFAULT_REKEY_INTERVAL < DEFAULT_KEY_LIFETIME, + "DEFAULT_REKEY_INTERVAL < DEFAULT_KEY_LIFETIME"); + static_assert(DEFAULT_RETRY_INTERVAL < DEFAULT_REKEY_INTERVAL, + "DEFAULT_RETRY_INTERVAL < DEFAULT_REKEY_INTERVAL"); initStats(); } diff --git a/src/hooks/dhcp/mysql/mysql_host_data_source.cc b/src/hooks/dhcp/mysql/mysql_host_data_source.cc index ae0fa1db9a..6d5aca4fdf 100644 --- a/src/hooks/dhcp/mysql/mysql_host_data_source.cc +++ b/src/hooks/dhcp/mysql/mysql_host_data_source.cc @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -170,7 +169,7 @@ public: columns_[DHCP4_BOOT_FILE_NAME_COL] = "dhcp4_boot_file_name"; columns_[AUTH_KEY_COL] = "auth_key"; - BOOST_STATIC_ASSERT(13 < HOST_COLUMNS); + static_assert(13 < HOST_COLUMNS, "13 < HOST_COLUMNS"); } /// @brief Virtual destructor. @@ -1761,7 +1760,7 @@ public: columns_[5] = "excluded_prefix"; columns_[6] = "excluded_prefix_len"; - BOOST_STATIC_ASSERT(6 < RESRV_COLUMNS); + static_assert(6 < RESRV_COLUMNS, "6 < RESRV_COLUMNS"); } /// @brief Create MYSQL_BIND objects for IPv6 Reservation. @@ -1945,7 +1944,7 @@ public: subnet_id_(SUBNET_ID_UNUSED), host_id_(0), option_() { - BOOST_STATIC_ASSERT(11 <= OPTION_COLUMNS); + static_assert(11 <= OPTION_COLUMNS, "11 <= OPTION_COLUMNS"); } /// @brief Creates binding array to insert option data into database. diff --git a/src/hooks/dhcp/mysql/mysql_lease_mgr.cc b/src/hooks/dhcp/mysql/mysql_lease_mgr.cc index e7d4d81725..7021efe728 100644 --- a/src/hooks/dhcp/mysql/mysql_lease_mgr.cc +++ b/src/hooks/dhcp/mysql/mysql_lease_mgr.cc @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -700,7 +699,7 @@ public: columns_[RELAY_ID_COL] = "relay_id"; columns_[REMOTE_ID_COL] = "remote_id"; columns_[POOL_ID_COL] = "pool_id"; - BOOST_STATIC_ASSERT(13 < LEASE_COLUMNS); + static_assert(13 < LEASE_COLUMNS, "13 < LEASE_COLUMNS"); } /// @brief Create MYSQL_BIND objects for Lease4 Pointer @@ -923,7 +922,7 @@ public: setErrorIndicators(bind_, error_, LEASE_COLUMNS); // .. and check that we have the numbers correct at compile time. - BOOST_STATIC_ASSERT(13 < LEASE_COLUMNS); + static_assert(13 < LEASE_COLUMNS, "13 < LEASE_COLUMNS"); } catch (const std::exception& ex) { isc_throw(DbOperationError, @@ -1066,7 +1065,7 @@ public: setErrorIndicators(bind_, error_, LEASE_COLUMNS); // .. and check that we have the numbers correct at compile time. - BOOST_STATIC_ASSERT(13 < LEASE_COLUMNS); + static_assert(13 < LEASE_COLUMNS, "13 < LEASE_COLUMNS"); // Add the data to the vector. Note the end element is one after the // end of the array. @@ -1292,7 +1291,7 @@ public: columns_[STATE_COL] = "state"; columns_[USER_CONTEXT_COL] = "user_context"; columns_[POOL_ID_COL] = "pool_id"; - BOOST_STATIC_ASSERT(17 < LEASE_COLUMNS); + static_assert(17 < LEASE_COLUMNS, "17 < LEASE_COLUMNS"); } /// @brief Create MYSQL_BIND objects for Lease6 Pointer @@ -1536,7 +1535,7 @@ public: setErrorIndicators(bind_, error_, LEASE_COLUMNS); // .. and check that we have the numbers correct at compile time. - BOOST_STATIC_ASSERT(17 < LEASE_COLUMNS); + static_assert(17 < LEASE_COLUMNS, "17 < LEASE_COLUMNS"); } catch (const std::exception& ex) { isc_throw(DbOperationError, @@ -1702,7 +1701,7 @@ public: setErrorIndicators(bind_, error_, LEASE_COLUMNS); // .. and check that we have the numbers correct at compile time. - BOOST_STATIC_ASSERT(17 < LEASE_COLUMNS); + static_assert(17 < LEASE_COLUMNS, "17 < LEASE_COLUMNS"); // Add the data to the vector. Note the end element is one after the // end of the array. diff --git a/src/hooks/dhcp/mysql/mysql_legal_log.cc b/src/hooks/dhcp/mysql/mysql_legal_log.cc index 559e36a247..d7e4720127 100644 --- a/src/hooks/dhcp/mysql/mysql_legal_log.cc +++ b/src/hooks/dhcp/mysql/mysql_legal_log.cc @@ -15,7 +15,6 @@ #include #include -#include #include #include @@ -62,7 +61,7 @@ public: // Set the column names (for error messages) columns_[0] = "address"; columns_[1] = "log"; - BOOST_STATIC_ASSERT(1 < LOG_COLUMNS); + static_assert(1 < LOG_COLUMNS, "1 < LOG_COLUMNS"); } /// @brief Destructor @@ -183,7 +182,7 @@ public: setErrorIndicators(bind_, error_, LOG_COLUMNS); // .. and check that we have the numbers correct at compile time. - BOOST_STATIC_ASSERT(1 < LOG_COLUMNS); + static_assert(1 < LOG_COLUMNS, "1 < LOG_COLUMNS"); } catch (const std::exception& ex) { isc_throw(DbOperationError, diff --git a/src/hooks/dhcp/pgsql/pgsql_host_data_source.cc b/src/hooks/dhcp/pgsql/pgsql_host_data_source.cc index 12fc2d05a6..22e3a4c22e 100644 --- a/src/hooks/dhcp/pgsql/pgsql_host_data_source.cc +++ b/src/hooks/dhcp/pgsql/pgsql_host_data_source.cc @@ -30,7 +30,6 @@ #include #include #include -#include #include @@ -140,7 +139,7 @@ public: columns_[DHCP4_BOOT_FILE_NAME_COL] = "dhcp4_boot_file_name"; columns_[AUTH_KEY_COL] = "auth_key"; - BOOST_STATIC_ASSERT(12 < HOST_COLUMNS); + static_assert(12 < HOST_COLUMNS, "12 < HOST_COLUMNS"); }; /// @brief Virtual destructor. @@ -966,7 +965,7 @@ public: columns_[excluded_prefix_index_] = "excluded_prefix"; columns_[excluded_prefix_len_index_] = "excluded_prefix_len"; - BOOST_STATIC_ASSERT(6 < RESERVATION_COLUMNS); + static_assert(6 < RESERVATION_COLUMNS, "6 < RESERVATION_COLUMNS"); } /// @brief Reinitializes state information @@ -1150,7 +1149,7 @@ public: columns_[5] = "excluded_prefix"; columns_[6] = "excluded_prefix_len"; - BOOST_STATIC_ASSERT(7 < RESRV_COLUMNS); + static_assert(7 < RESRV_COLUMNS, "7 < RESRV_COLUMNS"); } /// @brief Populate a bind array representing an IPv6 reservation @@ -1268,7 +1267,7 @@ public: columns_[DHCP_SUBNET_ID_COL] = "dhcp_subnet_id"; columns_[HOST_ID_COL] = "host_id"; - BOOST_STATIC_ASSERT(11 <= OPTION_COLUMNS); + static_assert(11 <= OPTION_COLUMNS, "11 <= OPTION_COLUMNS"); } /// @brief Creates binding array to insert option data into database. diff --git a/src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc b/src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc index 02c8e7aab2..887029e10a 100644 --- a/src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc +++ b/src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc @@ -21,7 +21,6 @@ #include #include -#include #include #include @@ -780,7 +779,7 @@ public: : lease_(), addr4_(0), client_id_length_(0), relay_id_length_(0), remote_id_length_(0) { - BOOST_STATIC_ASSERT(13 < LEASE_COLUMNS); + static_assert(13 < LEASE_COLUMNS, "13 < LEASE_COLUMNS"); memset(hwaddr_buffer_, 0, sizeof(hwaddr_buffer_)); memset(client_id_buffer_, 0, sizeof(client_id_buffer_)); @@ -1082,7 +1081,7 @@ public: preferred_lifetime_str_(""), hwtype_(0), hwtype_str_(""), hwaddr_source_(0), hwaddr_source_str_("") { - BOOST_STATIC_ASSERT(17 < LEASE_COLUMNS); + static_assert(17 < LEASE_COLUMNS, "17 < LEASE_COLUMNS"); memset(duid_buffer_, 0, sizeof(duid_buffer_)); diff --git a/src/hooks/dhcp/pgsql/pgsql_legal_log.cc b/src/hooks/dhcp/pgsql/pgsql_legal_log.cc index 5b4aef5cdf..2599cff069 100644 --- a/src/hooks/dhcp/pgsql/pgsql_legal_log.cc +++ b/src/hooks/dhcp/pgsql/pgsql_legal_log.cc @@ -14,8 +14,6 @@ #include #include -#include - #include #include #include @@ -65,7 +63,7 @@ public: /// @brief Constructor PgSqlLegLExchange() : address_(""), log_("") { - BOOST_STATIC_ASSERT(0 < LOG_COLUMNS); + static_assert(0 < LOG_COLUMNS, "0 < LOG_COLUMNS"); // Set the column names (for error messages) columns_.push_back("log"); diff --git a/src/lib/asiolink/io_address.cc b/src/lib/asiolink/io_address.cc index e912f0f398..bbc96b15cd 100644 --- a/src/lib/asiolink/io_address.cc +++ b/src/lib/asiolink/io_address.cc @@ -10,7 +10,6 @@ #include #include -#include // moved to container_hash on recent boost versions (backward compatible) #include @@ -71,7 +70,8 @@ IOAddress::fromBytes(short family, const uint8_t* data) { << "are supported"); } - BOOST_STATIC_ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN); + static_assert(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN, + "INET6_ADDRSTRLEN >= INET_ADDRSTRLEN"); char addr_str[INET6_ADDRSTRLEN]; inet_ntop(family, data, addr_str, INET6_ADDRSTRLEN); return IOAddress(string(addr_str)); diff --git a/src/lib/dhcp/iface_mgr_linux.cc b/src/lib/dhcp/iface_mgr_linux.cc index d49518c7fb..89dd65d6ff 100644 --- a/src/lib/dhcp/iface_mgr_linux.cc +++ b/src/lib/dhcp/iface_mgr_linux.cc @@ -32,7 +32,6 @@ #include #include -#include #include #include @@ -45,7 +44,7 @@ using namespace isc::asiolink; using namespace isc::dhcp; using namespace isc::util::io::internal; -BOOST_STATIC_ASSERT(IFLA_MAX>=IFA_MAX); +static_assert(IFLA_MAX>=IFA_MAX, "IFLA_MAX>=IFA_MAX"); namespace { @@ -180,7 +179,8 @@ void Netlink::rtnl_send_request(int family, int type) { struct sockaddr_nl nladdr; // do a sanity check. Verify that Req structure is aligned properly - BOOST_STATIC_ASSERT(sizeof(nlmsghdr) == offsetof(Req, generic)); + static_assert(sizeof(nlmsghdr) == offsetof(Req, generic), + "sizeof(nlmsghdr) == offsetof(Req, generic)"); memset(&nladdr, 0, sizeof(nladdr)); nladdr.nl_family = AF_NETLINK; diff --git a/src/lib/dhcp/protocol_util.cc b/src/lib/dhcp/protocol_util.cc index da701045c8..f3bc355fa8 100644 --- a/src/lib/dhcp/protocol_util.cc +++ b/src/lib/dhcp/protocol_util.cc @@ -8,7 +8,6 @@ #include #include #include -#include // in_systm.h is required on some some BSD systems // complaining that n_time is undefined but used // in ip.h. @@ -41,7 +40,8 @@ decodeEthernetHeader(InputBuffer& buf, Pkt4Ptr& pkt) { // The size of the single address is always lower then the size of // the header that holds this address. Otherwise, it is a programming // error that we want to detect in the compilation time. - BOOST_STATIC_ASSERT(ETHERNET_HEADER_LEN > HWAddr::ETHERNET_HWADDR_LEN); + static_assert(ETHERNET_HEADER_LEN > HWAddr::ETHERNET_HWADDR_LEN, + "ETHERNET_HEADER_LEN > HWAddr::ETHERNET_HWADDR_LEN"); // Remember initial position. size_t start_pos = buf.getPosition(); @@ -76,7 +76,8 @@ decodeIpUdpHeader(InputBuffer& buf, Pkt4Ptr& pkt) { " packet headers"); } - BOOST_STATIC_ASSERT(IP_SRC_ADDR_OFFSET < MIN_IP_HEADER_LEN); + static_assert(IP_SRC_ADDR_OFFSET < MIN_IP_HEADER_LEN, + "IP_SRC_ADDR_OFFSET < MIN_IP_HEADER_LEN"); // Remember initial position of the read pointer. size_t start_pos = buf.getPosition(); diff --git a/src/lib/dhcp/tests/pkt4_unittest.cc b/src/lib/dhcp/tests/pkt4_unittest.cc index 72f0da76a7..49d1f11153 100644 --- a/src/lib/dhcp/tests/pkt4_unittest.cc +++ b/src/lib/dhcp/tests/pkt4_unittest.cc @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -87,9 +86,10 @@ const uint8_t dummyFile[] = "Lorem ipsum dolor sit amet, consectetur " const uint8_t dummySname[] = "Lorem ipsum dolor sit amet, consectetur " "adipiscing elit posuere."; -BOOST_STATIC_ASSERT(sizeof(dummyFile) == Pkt4::MAX_FILE_LEN + 1); -BOOST_STATIC_ASSERT(sizeof(dummySname) == Pkt4::MAX_SNAME_LEN + 1); - +static_assert(sizeof(dummyFile) == Pkt4::MAX_FILE_LEN + 1, + "sizeof(dummyFile) == Pkt4::MAX_FILE_LEN + 1"); +static_assert(sizeof(dummySname) == Pkt4::MAX_SNAME_LEN + 1, + "sizeof(dummySname) == Pkt4::MAX_SNAME_LEN + 1"); class Pkt4Test : public ::testing::Test { public: diff --git a/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc b/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc index 231266c50b..ea1d4d36cb 100644 --- a/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc +++ b/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -701,7 +700,8 @@ public: // Hence, it is convenient if the number of test leases is a // multiple of 10. const size_t reclamation_group_size = 10; - BOOST_STATIC_ASSERT(TEST_LEASES_NUM % reclamation_group_size == 0); + static_assert(TEST_LEASES_NUM % reclamation_group_size == 0, + "TEST_LEASES_NUM % reclamation_group_size == 0"); // Leases will be reclaimed in groups of 10. for (unsigned int i = reclamation_group_size; i < TEST_LEASES_NUM; @@ -770,7 +770,8 @@ public: } const size_t reclamation_group_size = 10; - BOOST_STATIC_ASSERT(TEST_LEASES_NUM % reclamation_group_size == 0); + static_assert(TEST_LEASES_NUM % reclamation_group_size == 0, + "TEST_LEASES_NUM % reclamation_group_size == 0"); // Leases will be reclaimed in groups of 10 for (unsigned int i = 10; i < TEST_LEASES_NUM; i += reclamation_group_size) { @@ -1457,7 +1458,7 @@ ExpirationAllocEngine6Test::setLeaseType(const uint16_t lease_index, void ExpirationAllocEngine6Test::testReclaimExpiredLeasesStats() { // This test requires that the number of leases is an even number. - BOOST_STATIC_ASSERT(TEST_LEASES_NUM % 2 == 0); + static_assert(TEST_LEASES_NUM % 2 == 0, "TEST_LEASES_NUM % 2 == 0"); for (unsigned int i = 0; i < TEST_LEASES_NUM; ++i) { // Mark all leases as expired. The higher the index the less @@ -1496,7 +1497,7 @@ ExpirationAllocEngine6Test::testReclaimExpiredLeasesStats() { void ExpirationAllocEngine6Test::testReclaimReusedLeases(const uint16_t msg_type, const bool use_reclaimed) { - BOOST_STATIC_ASSERT(TEST_LEASES_NUM < 1000); + static_assert(TEST_LEASES_NUM < 1000, "TEST_LEASES_NUM < 1000"); for (unsigned int i = 0; i < TEST_LEASES_NUM; ++i) { // Depending on the parameter, mark leases 'expired-reclaimed' or @@ -1604,7 +1605,7 @@ ExpirationAllocEngine6Test::testReclaimDeclinedHook(bool skip) { void ExpirationAllocEngine6Test::testReclaimExpiredLeasesRegisteredStats() { // This test requires that the number of leases is an even number. - BOOST_STATIC_ASSERT(TEST_LEASES_NUM % 2 == 0); + static_assert(TEST_LEASES_NUM % 2 == 0, "TEST_LEASES_NUM % 2 == 0"); for (unsigned int i = 0; i < TEST_LEASES_NUM; ++i) { // Mark all leases as expired. The higher the index the less @@ -1700,7 +1701,8 @@ TEST_F(ExpirationAllocEngine6Test, reclaimExpiredLeasesHooksWithSkip) { // execution of the lease reclamation routine. TEST_F(ExpirationAllocEngine6Test, reclaimExpiredLeasesTimeout) { // This test needs at least 40 leases to make sense. - BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 40); + static_assert(TEST_LEASES_NUM >= 40, "TEST_LEASES_NUM >= 40"); + // Run with timeout of 1.2s. testReclaimExpiredLeasesTimeout(1200); } @@ -1712,7 +1714,7 @@ TEST_F(ExpirationAllocEngine6Test, reclaimExpiredLeasesTimeout) { // reclamation. TEST_F(ExpirationAllocEngine6Test, reclaimExpiredLeasesShortTimeout) { // We will most likely reclaim just one lease, so 5 is more than enough. - BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 5); + static_assert(TEST_LEASES_NUM >= 5, "TEST_LEASES_NUM >= 5"); // Reclaim leases with the 1ms timeout. testReclaimExpiredLeasesTimeout(1); } @@ -1720,7 +1722,7 @@ TEST_F(ExpirationAllocEngine6Test, reclaimExpiredLeasesShortTimeout) { // This test verifies that expired-reclaimed leases are removed from the // lease database. TEST_F(ExpirationAllocEngine6Test, deleteExpiredReclaimedLeases) { - BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 10); + static_assert(TEST_LEASES_NUM >= 10, "TEST_LEASES_NUM >= 10"); testDeleteExpiredReclaimedLeases(); } @@ -2178,7 +2180,7 @@ ExpirationAllocEngine4Test::testReclaimExpiredLeasesWithDDNSAndClientId() { void ExpirationAllocEngine4Test::testReclaimExpiredLeasesStats() { // This test requires that the number of leases is an even number. - BOOST_STATIC_ASSERT(TEST_LEASES_NUM % 2 == 0); + static_assert(TEST_LEASES_NUM % 2 == 0, "TEST_LEASES_NUM % 2 == 0"); for (unsigned int i = 0; i < TEST_LEASES_NUM; ++i) { // Mark all leases as expired. The higher the index the less @@ -2217,7 +2219,7 @@ ExpirationAllocEngine4Test::testReclaimReusedLeases(const uint8_t msg_type, const bool client_renews, const bool use_reclaimed) { // Let's restrict the number of leases. - BOOST_STATIC_ASSERT(TEST_LEASES_NUM < 1000); + static_assert(TEST_LEASES_NUM < 1000, "TEST_LEASES_NUM < 1000"); for (unsigned int i = 0; i < TEST_LEASES_NUM; ++i) { // Depending on the parameter, mark leases 'expired-reclaimed' or @@ -2391,7 +2393,7 @@ TEST_F(ExpirationAllocEngine4Test, reclaimExpiredLeasesHooksWithSkip) { // execution of the lease reclamation routine. TEST_F(ExpirationAllocEngine4Test, reclaimExpiredLeasesTimeout) { // This test needs at least 40 leases to make sense. - BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 40); + static_assert(TEST_LEASES_NUM >= 40, "TEST_LEASES_NUM >= 40"); // Run with timeout of 1.2s. testReclaimExpiredLeasesTimeout(1200); } @@ -2403,7 +2405,7 @@ TEST_F(ExpirationAllocEngine4Test, reclaimExpiredLeasesTimeout) { // reclamation. TEST_F(ExpirationAllocEngine4Test, reclaimExpiredLeasesShortTimeout) { // We will most likely reclaim just one lease, so 5 is more than enough. - BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 5); + static_assert(TEST_LEASES_NUM >= 5, "TEST_LEASES_NUM >= 5"); // Reclaim leases with the 1ms timeout. testReclaimExpiredLeasesTimeout(1); } @@ -2411,7 +2413,7 @@ TEST_F(ExpirationAllocEngine4Test, reclaimExpiredLeasesShortTimeout) { // This test verifies that expired-reclaimed leases are removed from the // lease database. TEST_F(ExpirationAllocEngine4Test, deleteExpiredReclaimedLeases) { - BOOST_STATIC_ASSERT(TEST_LEASES_NUM >= 10); + static_assert(TEST_LEASES_NUM >= 10, "TEST_LEASES_NUM >= 10"); testDeleteExpiredReclaimedLeases(); } diff --git a/src/lib/dns/messagerenderer.cc b/src/lib/dns/messagerenderer.cc index 4e1dfeaa8b..5c9cc3674f 100644 --- a/src/lib/dns/messagerenderer.cc +++ b/src/lib/dns/messagerenderer.cc @@ -15,7 +15,6 @@ #include #include -#include #include #include #include diff --git a/src/lib/dns/rdataclass.cc b/src/lib/dns/rdataclass.cc index 1bf515cb0d..79dc09466d 100644 --- a/src/lib/dns/rdataclass.cc +++ b/src/lib/dns/rdataclass.cc @@ -1398,8 +1398,9 @@ SOA::getSerial() const { uint32_t SOA::getMinimum() const { // Make sure the buffer access is safe. - BOOST_STATIC_ASSERT(sizeof(numdata_) == - sizeof(uint32_t) * 4 + sizeof(uint32_t)); + static_assert( + sizeof(numdata_) == sizeof(uint32_t) * 4 + sizeof(uint32_t), + "sizeof(numdata_) == sizeof(uint32_t) * 4 + sizeof(uint32_t)"); InputBuffer b(&numdata_[sizeof(uint32_t) * 4], sizeof(uint32_t)); return (b.readUint32()); diff --git a/src/lib/hooks/callout_manager.cc b/src/lib/hooks/callout_manager.cc index fbf4b90a19..7c30b08097 100644 --- a/src/lib/hooks/callout_manager.cc +++ b/src/lib/hooks/callout_manager.cc @@ -12,8 +12,6 @@ #include #include -#include - #include #include #include diff --git a/src/lib/log/logger_impl.cc b/src/lib/log/logger_impl.cc index 1718f303c9..fe2c3afe56 100644 --- a/src/lib/log/logger_impl.cc +++ b/src/lib/log/logger_impl.cc @@ -17,7 +17,6 @@ #include #include -#include #include #include diff --git a/src/lib/log/logger_level_impl.cc b/src/lib/log/logger_level_impl.cc index a4aba73a20..a6a4fdd40d 100644 --- a/src/lib/log/logger_level_impl.cc +++ b/src/lib/log/logger_level_impl.cc @@ -44,13 +44,20 @@ LoggerLevelImpl::convertFromBindLevel(const Level& level) { }; // ... with compile-time checks to ensure that table indexes are correct. - BOOST_STATIC_ASSERT(static_cast(DEFAULT) == 0); - BOOST_STATIC_ASSERT(static_cast(DEBUG) == 1); - BOOST_STATIC_ASSERT(static_cast(INFO) == 2); - BOOST_STATIC_ASSERT(static_cast(WARN) == 3); - BOOST_STATIC_ASSERT(static_cast(ERROR) == 4); - BOOST_STATIC_ASSERT(static_cast(FATAL) == 5); - BOOST_STATIC_ASSERT(static_cast(NONE) == 6); + static_assert(static_cast(DEFAULT) == 0, + "static_cast(DEFAULT) == 0"); + static_assert(static_cast(DEBUG) == 1, + "static_cast(DEBUG) == 1"); + static_assert(static_cast(INFO) == 2, + "static_cast(INFO) == 2"); + static_assert(static_cast(WARN) == 3, + "static_cast(WARN) == 3"); + static_assert(static_cast(ERROR) == 4, + "static_cast(ERROR) == 4"); + static_assert(static_cast(FATAL) == 5, + "static_cast(FATAL) == 5"); + static_assert(static_cast(NONE) == 6, + "static_cast(NONE) == 6"); // Do the conversion if (level.severity == DEBUG) { diff --git a/src/lib/log/tests/logger_level_impl_unittest.cc b/src/lib/log/tests/logger_level_impl_unittest.cc index c82be69b17..d9375ee09c 100644 --- a/src/lib/log/tests/logger_level_impl_unittest.cc +++ b/src/lib/log/tests/logger_level_impl_unittest.cc @@ -10,7 +10,6 @@ #include #include -#include #include #include @@ -109,7 +108,7 @@ TEST_F(LoggerLevelImplTest, ConversionToBind) { // ... and some invalid valid values test_convert_to("DEBUG-1", INFO, MIN_DEBUG_LEVEL, (log4cplus::DEBUG_LOG_LEVEL + 1)); - BOOST_STATIC_ASSERT(MAX_DEBUG_LEVEL == 99); + static_assert(MAX_DEBUG_LEVEL == 99, "MAX_DEBUG_LEVEL == 99"); test_convert_to("DEBUG+100", DEFAULT, 0, (log4cplus::DEBUG_LOG_LEVEL - MAX_DEBUG_LEVEL - 1)); }