hw/xwin: Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute() to an integer
Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute() to an integer: Since HINSTANCE is a pointer type, use INT_PTR rather than int. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
parent
c21344add2
commit
5a47c6420c
|
@ -621,7 +621,7 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
case ID_ABOUT_CHANGELOG:
|
case ID_ABOUT_CHANGELOG:
|
||||||
{
|
{
|
||||||
int iReturn;
|
INT_PTR iReturn;
|
||||||
|
|
||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
const char *pszCygPath = "/usr/X11R6/share/doc/"
|
const char *pszCygPath = "/usr/X11R6/share/doc/"
|
||||||
|
@ -635,12 +635,12 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
"devel/server/changelog.html";
|
"devel/server/changelog.html";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
iReturn = (int) ShellExecute(NULL,
|
iReturn = (INT_PTR) ShellExecute(NULL,
|
||||||
"open",
|
"open",
|
||||||
pszWinPath, NULL, NULL, SW_MAXIMIZE);
|
pszWinPath, NULL, NULL, SW_MAXIMIZE);
|
||||||
if (iReturn < 32) {
|
if (iReturn < 32) {
|
||||||
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_CHANGELOG - "
|
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_CHANGELOG - "
|
||||||
"ShellExecute failed: %d\n", iReturn);
|
"ShellExecute failed: %d\n", (int)iReturn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -648,14 +648,15 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
case ID_ABOUT_WEBSITE:
|
case ID_ABOUT_WEBSITE:
|
||||||
{
|
{
|
||||||
const char *pszPath = __VENDORDWEBSUPPORT__;
|
const char *pszPath = __VENDORDWEBSUPPORT__;
|
||||||
int iReturn;
|
INT_PTR iReturn;
|
||||||
|
|
||||||
iReturn = (int) ShellExecute(NULL,
|
iReturn = (INT_PTR) ShellExecute(NULL,
|
||||||
"open",
|
"open",
|
||||||
pszPath, NULL, NULL, SW_MAXIMIZE);
|
pszPath, NULL, NULL, SW_MAXIMIZE);
|
||||||
if (iReturn < 32) {
|
if (iReturn < 32) {
|
||||||
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_WEBSITE - "
|
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_WEBSITE - "
|
||||||
"ShellExecute failed: %d\n", iReturn);
|
"ShellExecute failed: %d\n", (int)iReturn);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -663,14 +664,14 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
case ID_ABOUT_UG:
|
case ID_ABOUT_UG:
|
||||||
{
|
{
|
||||||
const char *pszPath = "http://x.cygwin.com/docs/ug/";
|
const char *pszPath = "http://x.cygwin.com/docs/ug/";
|
||||||
int iReturn;
|
INT_PTR iReturn;
|
||||||
|
|
||||||
iReturn = (int) ShellExecute(NULL,
|
iReturn = (INT_PTR) ShellExecute(NULL,
|
||||||
"open",
|
"open",
|
||||||
pszPath, NULL, NULL, SW_MAXIMIZE);
|
pszPath, NULL, NULL, SW_MAXIMIZE);
|
||||||
if (iReturn < 32) {
|
if (iReturn < 32) {
|
||||||
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_UG - "
|
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_UG - "
|
||||||
"ShellExecute failed: %d\n", iReturn);
|
"ShellExecute failed: %d\n", (int)iReturn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -678,14 +679,14 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
case ID_ABOUT_FAQ:
|
case ID_ABOUT_FAQ:
|
||||||
{
|
{
|
||||||
const char *pszPath = "http://x.cygwin.com/docs/faq/";
|
const char *pszPath = "http://x.cygwin.com/docs/faq/";
|
||||||
int iReturn;
|
INT_PTR iReturn;
|
||||||
|
|
||||||
iReturn = (int) ShellExecute(NULL,
|
iReturn = (INT_PTR) ShellExecute(NULL,
|
||||||
"open",
|
"open",
|
||||||
pszPath, NULL, NULL, SW_MAXIMIZE);
|
pszPath, NULL, NULL, SW_MAXIMIZE);
|
||||||
if (iReturn < 32) {
|
if (iReturn < 32) {
|
||||||
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_FAQ - "
|
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_FAQ - "
|
||||||
"ShellExecute failed: %d\n", iReturn);
|
"ShellExecute failed: %d\n", (int)iReturn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in New Issue