fix some compiler warnings for dos_stub

This commit is contained in:
otavepto 2024-05-23 02:45:54 +03:00
parent 3a45d61147
commit 452b781fc0
3 changed files with 4 additions and 4 deletions

View File

@ -275,7 +275,7 @@ bool common_helpers::file_exist(const std::wstring &filepath)
bool common_helpers::file_size(const std::filesystem::path &filepath, size_t &size)
{
if (common_helpers::file_exist(filepath)) {
size = std::filesystem::file_size(filepath);
size = static_cast<size_t>(std::filesystem::file_size(filepath));
return true;
}
return false;

View File

@ -231,7 +231,7 @@ std::string pe_helpers::get_err_string(DWORD code)
code,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
(LPSTR)&err_str[0],
err_str.size(),
static_cast<DWORD>(err_str.size()),
NULL);
if (!msg_chars) return std::string();

View File

@ -35,7 +35,7 @@ static std::vector<uint8_t> load_file_partial(std::fstream &file)
file.seekg(org_pos, std::ios::beg);
return data;
}
catch(const std::exception& e)
catch(...)
{
return std::vector<uint8_t>();
}
@ -55,7 +55,7 @@ int main(int argc, char* *argv)
return 1;
}
for (size_t i = 1; i < argc; ++i) {
for (size_t i = 1; i < (size_t)argc; ++i) {
auto arg = argv[i];
std::fstream file(arg, std::ios::in | std::ios::out | std::ios::binary);
if (!file.is_open()) {