forked from Mirrors/openclonk
Improve "unexpected address family" asserts
parent
efe0b134ef
commit
890deb997d
|
@ -76,7 +76,8 @@ namespace std {
|
|||
auto unpack = make_tuple(v6.sin6_family, v6.sin6_port, v6.sin6_flowinfo, std::string((char*) v6.sin6_addr.s6_addr, 16), v6.sin6_scope_id);
|
||||
return hash<decltype(unpack)>()(unpack);
|
||||
}
|
||||
default:
|
||||
case C4NetIO::HostAddress::UnknownFamily:
|
||||
assert(!"Unexpected address family");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -948,8 +948,10 @@ C4NetpuncherID::value& C4Network2::getNetpuncherGameID(C4NetIO::HostAddress::Add
|
|||
{
|
||||
case C4NetIO::HostAddress::IPv4: return NetpuncherGameID.v4;
|
||||
case C4NetIO::HostAddress::IPv6: return NetpuncherGameID.v6;
|
||||
default: assert(false);
|
||||
case C4NetIO::HostAddress::UnknownFamily: assert(!"Unexpected address family");
|
||||
}
|
||||
// We need to return a valid reference to satisfy the compiler, even though the code here is unreachable.
|
||||
return NetpuncherGameID.v4;
|
||||
}
|
||||
|
||||
void C4Network2::InitPuncher()
|
||||
|
|
|
@ -468,8 +468,8 @@ bool C4Network2IO::InitPuncher(C4NetIO::addr_t nPuncherAddr)
|
|||
case C4NetIO::HostAddress::IPv6:
|
||||
PuncherAddrIPv6 = nPuncherAddr;
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
case C4NetIO::HostAddress::UnknownFamily:
|
||||
assert(!"Unexpected address family");
|
||||
}
|
||||
// let's punch
|
||||
return pNetIO_UDP->Connect(nPuncherAddr);
|
||||
|
|
Loading…
Reference in New Issue