From: Simon Tatham Date: Sun, 1 Oct 2017 13:50:58 +0000 (+0100) Subject: Fix an int->pointer cast warning in windows.c. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=edcf839d4c557c3993d681665829390697353344;p=sgt-puzzles.git Fix an int->pointer cast warning in windows.c. If I increase clang-cl's warning pickiness, it starts objecting to my cast to HMENU from a (potentially, in 64 bits) smaller integer type. Actually I don't think there's a problem there - all the integer ids I cast to HMENU are nice small numbers and a widening cast is just fine. But I can suppress the warning by using INT_PTR instead of int in the prototype for mkctrl, so it's easiest just to do that. --- diff --git a/windows.c b/windows.c index ffd0f75..df1db4f 100644 --- a/windows.c +++ b/windows.c @@ -2140,7 +2140,7 @@ static char *frontend_set_config(frontend *fe, int which, config_item *cfg) /* Control coordinates should be specified in dialog units. */ HWND mkctrl(frontend *fe, int x1, int x2, int y1, int y2, LPCTSTR wclass, int wstyle, - int exstyle, const char *wtext, int wid) + int exstyle, const char *wtext, INT_PTR wid) { RECT rc; TCHAR wwtext[256]; @@ -2349,7 +2349,7 @@ static int CALLBACK ConfigDlgProc(HWND hwnd, UINT msg, #ifndef _WIN32_WCE HWND mkctrl(frontend *fe, int x1, int x2, int y1, int y2, char *wclass, int wstyle, - int exstyle, const char *wtext, int wid) + int exstyle, const char *wtext, INT_PTR wid) { HWND ret; ret = CreateWindowEx(exstyle, wclass, wtext,