mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 20:05:54 +00:00
lib/net: enable strict warnings
Enables strict warnings in the net lib and fixes all related compile errors. Fixes #4924
This commit is contained in:
parent
c907e44a02
commit
bf18ffbbdd
@ -1,6 +1,4 @@
|
||||
SRC_CC += ethernet.cc ipv4.cc dhcp.cc arp.cc udp.cc tcp.cc
|
||||
SRC_CC += icmp.cc internet_checksum.cc
|
||||
|
||||
CC_CXX_WARN_STRICT_CONVERSION =
|
||||
|
||||
vpath %.cc $(REP_DIR)/src/lib/net
|
||||
|
@ -68,10 +68,10 @@ uint32_t Ipv4_address::to_uint32_big_endian() const
|
||||
Ipv4_address Ipv4_address::from_uint32_big_endian(uint32_t ip_raw)
|
||||
{
|
||||
Ipv4_address ip;
|
||||
ip.addr[0] = ip_raw;
|
||||
ip.addr[1] = ip_raw >> 8;
|
||||
ip.addr[2] = ip_raw >> 16;
|
||||
ip.addr[3] = ip_raw >> 24;
|
||||
ip.addr[0] = (uint8_t)(ip_raw);
|
||||
ip.addr[1] = (uint8_t)(ip_raw >> 8);
|
||||
ip.addr[2] = (uint8_t)(ip_raw >> 16);
|
||||
ip.addr[3] = (uint8_t)(ip_raw >> 24);
|
||||
return ip;
|
||||
}
|
||||
|
||||
@ -88,10 +88,10 @@ uint32_t Ipv4_address::to_uint32_little_endian() const
|
||||
Ipv4_address Ipv4_address::from_uint32_little_endian(uint32_t ip_raw)
|
||||
{
|
||||
Ipv4_address ip;
|
||||
ip.addr[3] = ip_raw;
|
||||
ip.addr[2] = ip_raw >> 8;
|
||||
ip.addr[1] = ip_raw >> 16;
|
||||
ip.addr[0] = ip_raw >> 24;
|
||||
ip.addr[3] = (uint8_t)(ip_raw);
|
||||
ip.addr[2] = (uint8_t)(ip_raw >> 8);
|
||||
ip.addr[1] = (uint8_t)(ip_raw >> 16);
|
||||
ip.addr[0] = (uint8_t)(ip_raw >> 24);
|
||||
return ip;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user