Am Wed, 9 Sep 2020 22:42:59 +0300
schrieb Yuriy Skalko <[email protected]>:

> > 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
diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp
index d6b27856cb..218aab82ac 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 = 0;
 	if (!infile.empty())
 		CloseHandle(startup.hStdInput);
 	CloseHandle(process.hProcess);
 	if (fclose(inf) != 0)
 		pret = -1;

Attachment: pgp0VIEx3iy2e.pgp
Description: Digitale Signatur von OpenPGP

-- 
lyx-devel mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to