Mercurial > dwindows
changeset 1838:ca304f28de3b
Fix 64bit crashes on Windows when building with Visual Studio 2012.
LPARAM in 32bit mode is LONG, but in 64bit mode it is uint64...
There were casts to LONG in several places that were getting truncated
with the new version of the compiler (but not gcc or older versions).
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 16 Nov 2012 21:18:20 +0000 |
parents | d7e13f446c41 |
children | 22225eb286e5 |
files | win/dw.c |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/win/dw.c Sat Nov 10 16:33:02 2012 +0000 +++ b/win/dw.c Fri Nov 16 21:18:20 2012 +0000 @@ -6168,7 +6168,7 @@ SendMessage(tmp, TB_SETPADDING, 0, 0); SendMessage(tmp, TB_SETIMAGELIST, 0, (LPARAM)imlist); SendMessage(tmp, TB_SETDISABLEDIMAGELIST, 0, (LPARAM)dimlist); - SendMessage(tmp, TB_ADDBUTTONS, 1, (LONG) &tbButtons); + SendMessage(tmp, TB_ADDBUTTONS, 1, (LPARAM) &tbButtons); _create_tooltip(tmp, text); return tmp; @@ -6493,7 +6493,7 @@ cinfo->pOldProc = SubclassWindow(tmp, _colorwndproc); SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo); - SendMessage(tmp, TBM_SETRANGE, (WPARAM)FALSE, (LPARAM)MAKELONG(0, increments-1)); + SendMessage(tmp, TBM_SETRANGE, (WPARAM)FALSE, MAKELPARAM(0, increments-1)); return tmp; } @@ -8396,7 +8396,7 @@ */ void API dw_mle_set_cursor(HWND handle, int point) { - SendMessage(handle, EM_SETSEL, 0, MAKELONG(point,point)); + SendMessage(handle, EM_SETSEL, 0, MAKELPARAM(point,point)); SendMessage(handle, EM_SCROLLCARET, 0, 0); } @@ -8696,7 +8696,7 @@ tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM; tvi.pszText = UTF8toWide(title); - tvi.lParam = (LONG)ptrs; + tvi.lParam = (LPARAM)ptrs; tvi.cchTextMax = (int)_tcslen(tvi.pszText); tvi.iSelectedImage = tvi.iImage = _lookup_icon(handle, (HICON)icon, 1); @@ -8730,7 +8730,7 @@ tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM; tvi.pszText = UTF8toWide(title); - tvi.lParam = (LONG)ptrs; + tvi.lParam = (LPARAM)ptrs; tvi.cchTextMax = (int)_tcslen(tvi.pszText); tvi.iSelectedImage = tvi.iImage = _lookup_icon(handle, (HICON)icon, 1);