Skip to content

Commit

Permalink
use cast instead
Browse files Browse the repository at this point in the history
  • Loading branch information
partouf committed Sep 9, 2023
1 parent b03a684 commit fc5ca60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ DWORD SpawnProcess(const cewrapper::Job &job, STARTUPINFOEX &si, HANDLE hUserTok
}
}

DWORD app_exit_code = std::to_underlying(SpecialExitCode::UnknownErrorWhileWaitingOnProcess);
DWORD app_exit_code = (DWORD)SpecialExitCode::UnknownErrorWhileWaitingOnProcess;

if (maxtime > 0 && timespent >= maxtime)
{
Expand Down Expand Up @@ -209,7 +209,7 @@ int wmain(int argc, wchar_t *argv[])
std::wcerr << L"Too few arguments\n";
std::wcerr << L"Usage: cewrapper.exe [-v] [--config=/full/path/to/config.json] [--home=/preferred/cwdpath] "
L"[--time_limit=1] ExePath [args]\n";
return std::to_underlying(SpecialExitCode::NotEnoughArgs);
return (DWORD)SpecialExitCode::NotEnoughArgs;
}

try
Expand All @@ -221,12 +221,12 @@ int wmain(int argc, wchar_t *argv[])
if (cewrapper::Config::get().debugging)
std::cerr << e.what() << "\n";
std::wcerr << L"Invalid arguments\n";
return std::to_underlying(SpecialExitCode::InvalidArgs);
return (DWORD)SpecialExitCode::InvalidArgs;
}

cewrapper::Job job(cewrapper::Config::get());

DWORD app_exit_code = std::to_underlying(SpecialExitCode::ErrorWhenExecutingProcess);
DWORD app_exit_code = (DWORD)SpecialExitCode::ErrorWhenExecutingProcess;
try
{
if (cewrapper::Config::get().use_appcontainer)
Expand Down

0 comments on commit fc5ca60

Please sign in to comment.