# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1353100700 0 # Node ID ca304f28de3b4f2a5fe7b55918836fa4f594f710 # Parent d7e13f446c4137010ced8d249ed868b0a92d2ea1 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). diff -r d7e13f446c41 -r ca304f28de3b win/dw.c --- 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);