Am Wed, 9 Sep 2020 22:14:40 +0200 schrieb Kornel Benko <kor...@lyx.org>:
> Am Wed, 9 Sep 2020 22:42:59 +0300 > schrieb Yuriy Skalko <yuriy.ska...@gmail.com>: > > > > I meant, > > > if what you done is correct, then also the call in ForkedCalls.cpp should > > > be > > > corrected. > > > > > > Both places refer to WIN32 anyway. > > > > > > Kornel > > > > > > Since pclose (Unix) returns signed int and GetExitCodeProcess (Windows) > > returns unsigned DWORD, and then result is compared with -1 in common > > branch, now I don't see clean way to get rid of the warning in this mix > > of conditional compilation branches. Let's leave as it is now. > > > > There is similar mix of signed/unsigned in ForkedCalls.cpp (setRetValue > > call) but without compiler warnings. > > > > > > Yuriy > > > > What about this? > > Kornel Forget it. Maybe this is better. Kornel
diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp index d6b27856cb..9ce6cd1cfc 100644 --- a/src/support/filetools.cpp +++ b/src/support/filetools.cpp @@ -1105,13 +1105,16 @@ cmd_ret const runCommand(string const & cmd) c = fgetc(inf); } #if defined (_WIN32) WaitForSingleObject(process.hProcess, INFINITE); - DWORD pret; - if (!GetExitCodeProcess(process.hProcess, &pret)) + DWORD pretw; + int pret; + if (!GetExitCodeProcess(process.hProcess, &pretw)) pret = -1; + else + pret = (int) pretw; if (!infile.empty()) CloseHandle(startup.hStdInput); CloseHandle(process.hProcess); if (fclose(inf) != 0) pret = -1;
pgpCJy0SDgtjY.pgp
Description: Digitale Signatur von OpenPGP
-- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel