]> git.lyx.org Git - features.git/commitdiff
Fix return types for mingw-w64
authorShankar Giri Venkita Giri <girivs@gmx.com>
Thu, 5 May 2016 10:54:53 +0000 (12:54 +0200)
committerRichard Heck <rgheck@lyx.org>
Sun, 29 May 2016 21:55:43 +0000 (17:55 -0400)
This is needed for warning-free compilation with mingw-w64, and does not hurt
for other build configurations. Patch by Shankar Giri Venkita Giri (bug 10053).

src/support/filetools.cpp
src/support/os_win32.cpp

index 310e621e17a406d94e5b0606767ce4b5364e1ba7..657343fb935b17b92915a442ba5c6437a797a9d3 100644 (file)
@@ -1065,7 +1065,7 @@ cmd_ret const runCommand(string const & cmd)
                                0, 0, &startup, &process)) {
 
                        CloseHandle(process.hThread);
-                       int fno = _open_osfhandle((long)in, _O_RDONLY);
+                       int fno = _open_osfhandle(static_cast<intptr_t>(in), _O_RDONLY);
                        CloseHandle(out);
                        inf = _fdopen(fno, "r");
                }
index 292555d6c744bb55046699832922fce1027ba093..a6e5da7c5ad060b40f5b0c6b32ba4d99f4367d67 100644 (file)
@@ -569,7 +569,7 @@ bool autoOpenFile(string const & filename, auto_open_mode const mode,
 
        // reference: http://msdn.microsoft.com/en-us/library/bb762153.aspx
        char const * action = (mode == VIEW) ? "open" : "edit";
-       bool success = reinterpret_cast<int>(ShellExecute(NULL, action,
+       bool success = reinterpret_cast<intptr_t>(ShellExecute(NULL, action,
                to_local8bit(from_utf8(filename)).c_str(), NULL, NULL, 1)) > 32;
 
        if (!path.empty() && !lyxrc.texinputs_prefix.empty()) {