From c3a4beb2000c98273f52df2e8b2ae1907de8187c Mon Sep 17 00:00:00 2001 From: Joshua DeWeese Date: Thu, 8 Feb 2024 10:12:22 -0500 Subject: [PATCH] treewide: make use of new IPv4 static init macro This commit makes use of the newly added static initializer for IPv4 addresses. --- sys/include/net/dns_mock.h | 4 ++-- tests/net/netutils/main.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/include/net/dns_mock.h b/sys/include/net/dns_mock.h index a32bb9828996..58a251f019c2 100644 --- a/sys/include/net/dns_mock.h +++ b/sys/include/net/dns_mock.h @@ -34,9 +34,9 @@ extern "C" { /** * @brief IPv4 address for @ref SOCK_DNS_MOCK_EXAMPLE_COM_HOSTNAME. - * Address represents "93.184.216.34". */ -static const ipv4_addr_t sock_dns_mock_example_com_addr_ipv4 = { { 0x5d, 0xb8, 0xd8, 0x22 } }; +static const ipv4_addr_t sock_dns_mock_example_com_addr_ipv4 = + IPV4_ADDR_INIT(93, 184, 216, 34); /** * @brief IPv6 address for @ref SOCK_DNS_MOCK_EXAMPLE_COM_HOSTNAME. diff --git a/tests/net/netutils/main.c b/tests/net/netutils/main.c index d207e4bf5e5d..6ee05f7a2af7 100644 --- a/tests/net/netutils/main.c +++ b/tests/net/netutils/main.c @@ -151,7 +151,7 @@ static void test_ipv4_addr_from_str__address_NULL(void) static void test_ipv4_addr_from_str__success(void) { - static const ipv4_addr_t a = { { 0x01, 0x02, 0x03, 0x04 } }; + static const ipv4_addr_t a = IPV4_ADDR_INIT(1, 2, 3, 4); ipv4_addr_t address; TEST_ASSERT_EQUAL_INT(netutils_get_ipv4(&address, "1.2.3.4"), 0);