To: vim-dev@vim.org Subject: Patch 7.2b.019 (extra) Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 7.2b.019 (extra) Problem: Win32: Various compiler warnings. Solution: Use __w64 attribute. Comment-out unused parameters. Adjust a few #ifdefs. (George Reilly) Files: src/gui_w48.c, src/GvimExt/gvimext.cpp, src/Make_mvc.mak, src/os_mswin.c, src/os_win32.c, src/vim.h *** ../vim-7.2b.018/src/gui_w48.c Mon Dec 3 22:20:40 2007 --- src/gui_w48.c Thu Jul 24 15:06:07 2008 *************** *** 3154,3165 **** idc = MAKEINTRESOURCE(IDC_ARROW); else idc = mshape_idcs[shape]; ! #ifdef _WIN64 ! SetClassLongPtr(s_textArea, GCLP_HCURSOR, (LONG_PTR)LoadCursor(NULL, idc)); #else # ifdef WIN32 ! SetClassLong(s_textArea, GCL_HCURSOR, (LONG)LoadCursor(NULL, idc)); ! # else SetClassWord(s_textArea, GCW_HCURSOR, (WORD)LoadCursor(NULL, idc)); # endif #endif --- 3154,3165 ---- idc = MAKEINTRESOURCE(IDC_ARROW); else idc = mshape_idcs[shape]; ! #ifdef SetClassLongPtr ! SetClassLongPtr(s_textArea, GCLP_HCURSOR, (__int3264)(LONG_PTR)LoadCursor(NULL, idc)); #else # ifdef WIN32 ! SetClassLong(s_textArea, GCL_HCURSOR, (long_u)LoadCursor(NULL, idc)); ! # else /* Win16 */ SetClassWord(s_textArea, GCW_HCURSOR, (WORD)LoadCursor(NULL, idc)); # endif #endif *** ../vim-7.2b.018/src/GvimExt/gvimext.cpp Sat Aug 18 17:00:42 2007 --- src/GvimExt/gvimext.cpp Thu Jul 24 15:06:07 2008 *************** *** 205,217 **** } static char * ! null_libintl_bindtextdomain(const char *domainname, const char *dirname) { return NULL; } static char * ! null_libintl_textdomain(const char* domainname) { return NULL; } --- 205,217 ---- } static char * ! null_libintl_bindtextdomain(const char * /* domainname */, const char * /* dirname */) { return NULL; } static char * ! null_libintl_textdomain(const char* /* domainname */) { return NULL; } *************** *** 308,314 **** // DllMain //--------------------------------------------------------------------------- extern "C" int APIENTRY ! DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { switch (dwReason) { --- 308,314 ---- // DllMain //--------------------------------------------------------------------------- extern "C" int APIENTRY ! DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /* lpReserved */) { switch (dwReason) { *************** *** 438,444 **** } ! STDMETHODIMP CShellExtClassFactory::LockServer(BOOL fLock) { return NOERROR; } --- 438,444 ---- } ! STDMETHODIMP CShellExtClassFactory::LockServer(BOOL /* fLock */) { return NOERROR; } *************** *** 520,528 **** // It could be a context menu or a property sheet. // ! STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj, ! HKEY hRegKey) { // Initialize can be called more than once if (m_pDataObj) --- 520,528 ---- // It could be a context menu or a property sheet. // ! STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST /* pIDFolder */, LPDATAOBJECT pDataObj, ! HKEY /* hRegKey */) { // Initialize can be called more than once if (m_pDataObj) *************** *** 562,569 **** STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, ! UINT idCmdLast, ! UINT uFlags) { UINT idCmd = idCmdFirst; --- 562,569 ---- STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, ! UINT /* idCmdLast */, ! UINT /* uFlags */) { UINT idCmd = idCmdFirst; *************** *** 718,728 **** return hr; } ! STDMETHODIMP CShellExt::PushToWindow(HWND hParent, ! LPCSTR pszWorkingDir, ! LPCSTR pszCmd, ! LPCSTR pszParam, ! int iShowCmd, int idHWnd) { HWND hWnd = m_hWnd[idHWnd]; --- 718,728 ---- return hr; } ! STDMETHODIMP CShellExt::PushToWindow(HWND /* hParent */, ! LPCSTR /* pszWorkingDir */, ! LPCSTR /* pszCmd */, ! LPCSTR /* pszParam */, ! int /* iShowCmd */, int idHWnd) { HWND hWnd = m_hWnd[idHWnd]; *************** *** 740,748 **** return NOERROR; } ! STDMETHODIMP CShellExt::GetCommandString(UINT_PTR idCmd, UINT uFlags, ! UINT FAR *reserved, LPSTR pszName, UINT cchMax) { --- 740,748 ---- return NOERROR; } ! STDMETHODIMP CShellExt::GetCommandString(UINT_PTR /* idCmd */, UINT uFlags, ! UINT FAR * /* reserved */, LPSTR pszName, UINT cchMax) { *************** *** 841,850 **** #endif STDMETHODIMP CShellExt::InvokeGvim(HWND hParent, ! LPCSTR pszWorkingDir, ! LPCSTR pszCmd, ! LPCSTR pszParam, ! int iShowCmd) { char m_szFileUserClickedOn[BUFSIZE]; char cmdStr[BUFSIZE]; --- 841,850 ---- #endif STDMETHODIMP CShellExt::InvokeGvim(HWND hParent, ! LPCSTR /* pszWorkingDir */, ! LPCSTR /* pszCmd */, ! LPCSTR /* pszParam */, ! int /* iShowCmd */) { char m_szFileUserClickedOn[BUFSIZE]; char cmdStr[BUFSIZE]; *************** *** 911,920 **** STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent, ! LPCSTR pszWorkingDir, ! LPCSTR pszCmd, ! LPCSTR pszParam, ! int iShowCmd, int useDiff) { char m_szFileUserClickedOn[BUFSIZE]; --- 911,920 ---- STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent, ! LPCSTR /* pszWorkingDir */, ! LPCSTR /* pszCmd */, ! LPCSTR /* pszParam */, ! int /* iShowCmd */, int useDiff) { char m_szFileUserClickedOn[BUFSIZE]; *** ../vim-7.2b.018/src/Make_mvc.mak Sun Jul 13 19:15:09 2008 --- src/Make_mvc.mak Thu Jul 24 15:06:07 2008 *************** *** 207,215 **** !include ! # Turn on Win64 compatibility warnings for 32-bit compiler in VC8. (/Wp64 is ! # deprecated in VC9.) ! !if ("$(MSVCVER)" == "8.0") DEFINES=$(DEFINES) /Wp64 !endif --- 207,215 ---- !include ! # Turn on Win64 compatibility warnings for VC7.x and VC8. ! # (/Wp64 is deprecated in VC9 and generates an obnoxious warning.) ! !if ("$(MSVCVER)" == "7.0") || ("$(MSVCVER)" == "7.1") || ("$(MSVCVER)" == "8.0") DEFINES=$(DEFINES) /Wp64 !endif *** ../vim-7.2b.018/src/os_mswin.c Tue Jun 24 23:42:46 2008 --- src/os_mswin.c Thu Jul 24 15:19:19 2008 *************** *** 1729,1735 **** } /*ARGSUSED*/ ! static BOOL CALLBACK PrintDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { #ifdef FEAT_GETTEXT --- 1729,1735 ---- } /*ARGSUSED*/ ! static INT_PTR CALLBACK PrintDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { #ifdef FEAT_GETTEXT *************** *** 2125,2132 **** char_u *port_name = (char_u *)devname +devname->wOutputOffset; char_u *text = _("to %s on %s"); ! prt_name = alloc(STRLEN(printer_name) + STRLEN(port_name) ! + STRLEN(text)); if (prt_name != NULL) wsprintf(prt_name, text, printer_name, port_name); } --- 2125,2132 ---- char_u *port_name = (char_u *)devname +devname->wOutputOffset; char_u *text = _("to %s on %s"); ! prt_name = alloc((unsigned)(STRLEN(printer_name) + STRLEN(port_name) ! + STRLEN(text))); if (prt_name != NULL) wsprintf(prt_name, text, printer_name, port_name); } *** ../vim-7.2b.018/src/os_win32.c Tue Jun 24 22:54:14 2008 --- src/os_win32.c Thu Jul 24 15:06:07 2008 *************** *** 4663,4669 **** # endif ) { ! # if defined(DEBUG) && _MSC_VER > 1200 /* Work around an annoying assertion in the Microsoft debug CRT * when mode's text/binary setting doesn't match _get_fmode(). */ char newMode = mode[strlen(mode) - 1]; --- 4663,4669 ---- # endif ) { ! # if defined(DEBUG) && _MSC_VER >= 1400 /* Work around an annoying assertion in the Microsoft debug CRT * when mode's text/binary setting doesn't match _get_fmode(). */ char newMode = mode[strlen(mode) - 1]; *************** *** 4682,4688 **** vim_free(wn); vim_free(wm); ! # if defined(DEBUG) && _MSC_VER > 1200 _set_fmode(oldMode); # endif --- 4682,4688 ---- vim_free(wn); vim_free(wm); ! # if defined(DEBUG) && _MSC_VER >= 1400 _set_fmode(oldMode); # endif *** ../vim-7.2b.018/src/vim.h Sun Jul 13 19:15:26 2008 --- src/vim.h Thu Jul 24 15:06:07 2008 *************** *** 352,359 **** typedef unsigned short short_u; typedef unsigned int int_u; /* Make sure long_u is big enough to hold a pointer. ! * On Win64 longs are 32 bit and pointers 64 bit. ! * For printf() and scanf() we need to take care of long_u specifically. */ #ifdef _WIN64 typedef unsigned __int64 long_u; typedef __int64 long_i; --- 352,359 ---- typedef unsigned short short_u; typedef unsigned int int_u; /* Make sure long_u is big enough to hold a pointer. ! * On Win64, longs are 32 bits and pointers are 64 bits. ! * For printf() and scanf(), we need to take care of long_u specifically. */ #ifdef _WIN64 typedef unsigned __int64 long_u; typedef __int64 long_i; *************** *** 361,368 **** # define SCANF_DECIMAL_LONG_U "%Iu" # define PRINTF_HEX_LONG_U "0x%Ix" #else ! typedef unsigned long long_u; ! typedef long long_i; # define SCANF_HEX_LONG_U "%lx" # define SCANF_DECIMAL_LONG_U "%lu" # define PRINTF_HEX_LONG_U "0x%lx" --- 361,376 ---- # define SCANF_DECIMAL_LONG_U "%Iu" # define PRINTF_HEX_LONG_U "0x%Ix" #else ! /* Microsoft-specific. The __w64 keyword should be specified on any typedefs ! * that change size between 32-bit and 64-bit platforms. For any such type, ! * __w64 should appear only on the 32-bit definition of the typedef. ! * Define __w64 as an empty token for everything but MSVC 7.x or later. ! */ ! # if !defined(_MSC_VER) || (_MSC_VER < 1300) ! # define __w64 ! # endif ! typedef unsigned long __w64 long_u; ! typedef long __w64 long_i; # define SCANF_HEX_LONG_U "%lx" # define SCANF_DECIMAL_LONG_U "%lu" # define PRINTF_HEX_LONG_U "0x%lx" *** ../vim-7.2b.018/src/version.c Thu Jul 24 20:28:25 2008 --- src/version.c Thu Jul 24 20:46:49 2008 *************** *** 678,679 **** --- 678,681 ---- { /* Add new patch number below this line */ + /**/ + 19, /**/ -- Futility Factor: No experiment is ever a complete failure - it can always serve as a negative example. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///