fix some warnings

develop
Ben Lubar 2020-02-10 19:35:17 -06:00
parent 7b9ea1f1b6
commit 3c9f6f79ab
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
3 changed files with 5 additions and 5 deletions

@ -146,7 +146,7 @@ list(APPEND LIBPROTOBUF_FULL_SRCS ${LIBPROTOBUF_LITE_SRCS})
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wno-sign-compare")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result -Wno-unused-local-typedefs -Wno-misleading-indentation")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result -Wno-unused-local-typedefs -Wno-misleading-indentation -Wno-class-memaccess")
elseif(MSVC)
# Disable warnings for integer conversion to smaller type
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")

@ -240,7 +240,7 @@ void ServerConnection::Accepted(CActiveSocket* socket)
std::thread{[](CActiveSocket* socket) {
try {
ServerConnection(socket).threadFn();
} catch (BlockedException e) {
} catch (BlockedException &) {
}
}, socket}.detach();
}
@ -478,7 +478,7 @@ void ServerMainImpl::threadFn(std::promise<bool> promise, int port)
ServerConnection::Accepted(client);
client = nullptr;
}
} catch(BlockedException e) {
} catch(BlockedException &) {
if (client)
client->Close();
delete client;

@ -537,7 +537,7 @@ command_result FilterManager::saveConfig(DFHack::color_ostream& out) const noexc
if (!ofs.good())
throw std::runtime_error{"Failed to open configuration file for writing"};
ofs << archive;
} catch(std::exception e) {
} catch(std::exception & e) {
ERR(command, out) << "Serializing filters to '" << configPath << "' failed: "
<< e.what() << std::endl;
return CR_FAILURE;
@ -584,7 +584,7 @@ static command_result parseRegexParam(std::regex& target,
try {
std::regex temp{parameters[pos], defaultRegex};
target = std::move(temp);
} catch(std::regex_error e) {
} catch(std::regex_error & e) {
ERR(command,out) << "Failed to parse regular expression '"
<< parameters[pos] << "'\n";
ERR(command,out) << "Parser message: " << e.what() << std::endl;