|
6 | 6 | #include "../run-command.h"
|
7 | 7 | #include "../cache.h"
|
8 | 8 |
|
| 9 | +#define HCAST(type, handle) ((type)(intptr_t)handle) |
| 10 | + |
9 | 11 | static const int delay[] = { 0, 1, 10, 20, 40 };
|
10 | 12 | unsigned int _CRT_fmode = _O_BINARY;
|
11 | 13 |
|
@@ -726,13 +728,13 @@ int pipe(int filedes[2])
|
726 | 728 | errno = err_win_to_posix(GetLastError());
|
727 | 729 | return -1;
|
728 | 730 | }
|
729 |
| - filedes[0] = _open_osfhandle((int)h[0], O_NOINHERIT); |
| 731 | + filedes[0] = _open_osfhandle(HCAST(int, h[0]), O_NOINHERIT); |
730 | 732 | if (filedes[0] < 0) {
|
731 | 733 | CloseHandle(h[0]);
|
732 | 734 | CloseHandle(h[1]);
|
733 | 735 | return -1;
|
734 | 736 | }
|
735 |
| - filedes[1] = _open_osfhandle((int)h[1], O_NOINHERIT); |
| 737 | + filedes[1] = _open_osfhandle(HCAST(int, h[1]), O_NOINHERIT); |
736 | 738 | if (filedes[0] < 0) {
|
737 | 739 | close(filedes[0]);
|
738 | 740 | CloseHandle(h[1]);
|
@@ -1949,7 +1951,8 @@ void mingw_open_html(const char *unixpath)
|
1949 | 1951 | die("cannot run browser");
|
1950 | 1952 |
|
1951 | 1953 | printf("Launching default browser to display HTML ...\n");
|
1952 |
| - r = (int)ShellExecute(NULL, "open", htmlpath, NULL, "\\", SW_SHOWNORMAL); |
| 1954 | + r = HCAST(int, ShellExecute(NULL, "open", htmlpath, |
| 1955 | + NULL, "\\", SW_SHOWNORMAL)); |
1953 | 1956 | FreeLibrary(shell32);
|
1954 | 1957 | /* see the MSDN documentation referring to the result codes here */
|
1955 | 1958 | if (r <= 32) {
|
|
0 commit comments