core/CMakeLists: Make some warnings errors

Makes our error coverage a little more consistent across the board by
applying it to Linux side of things as well. This also makes it more
consistent with the warning settings in other libraries in the project.

This also updates httplib to 0.7.9, as there are several warning
cleanups made that allow us to enable several warnings as errors.
This commit is contained in:
Lioncash 2020-10-13 08:10:50 -04:00
parent d291fc1a51
commit 39c8d18feb
32 changed files with 3243 additions and 1539 deletions

View file

@ -89,9 +89,9 @@ Network::Protocol Translate(Type type, Protocol protocol) {
}
}
u16 TranslatePollEventsToHost(u16 flags) {
u16 result = 0;
const auto translate = [&result, &flags](u16 from, u16 to) {
u16 TranslatePollEventsToHost(u32 flags) {
u32 result = 0;
const auto translate = [&result, &flags](u32 from, u32 to) {
if ((flags & from) != 0) {
flags &= ~from;
result |= to;
@ -105,12 +105,12 @@ u16 TranslatePollEventsToHost(u16 flags) {
translate(POLL_NVAL, Network::POLL_NVAL);
UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags);
return result;
return static_cast<u16>(result);
}
u16 TranslatePollEventsToGuest(u16 flags) {
u16 result = 0;
const auto translate = [&result, &flags](u16 from, u16 to) {
u16 TranslatePollEventsToGuest(u32 flags) {
u32 result = 0;
const auto translate = [&result, &flags](u32 from, u32 to) {
if ((flags & from) != 0) {
flags &= ~from;
result |= to;
@ -125,7 +125,7 @@ u16 TranslatePollEventsToGuest(u16 flags) {
translate(Network::POLL_NVAL, POLL_NVAL);
UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags);
return result;
return static_cast<u16>(result);
}
Network::SockAddrIn Translate(SockAddrIn value) {

View file

@ -31,10 +31,10 @@ Network::Type Translate(Type type);
Network::Protocol Translate(Type type, Protocol protocol);
/// Translate abstract poll event flags to guest poll event flags
u16 TranslatePollEventsToHost(u16 flags);
u16 TranslatePollEventsToHost(u32 flags);
/// Translate guest poll event flags to abstract poll event flags
u16 TranslatePollEventsToGuest(u16 flags);
u16 TranslatePollEventsToGuest(u32 flags);
/// Translate guest socket address structure to abstract socket address structure
Network::SockAddrIn Translate(SockAddrIn value);