[PATCH v2] atl: Fix a MSVC-x64 warning about wci.

Serge Gautherie winehq-git_serge_180711 at gautherie.fr
Tue Oct 29 16:56:07 CDT 2019


Signed-off-by: Serge Gautherie <winehq-git_serge_180711 at gautherie.fr>
---
"...\atl30.c(316): warning C4477: 'sprintf' : format string '%08lx' requires an argument of type 'unsigned long', but variadic argument 1 has type 'UINT_PTR'"
---
 dlls/atl/atl30.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/atl/atl30.c b/dlls/atl/atl30.c
index c2db138..d30a4cd 100644
--- a/dlls/atl/atl30.c
+++ b/dlls/atl/atl30.c
@@ -313,7 +313,7 @@ ATOM WINAPI AtlModuleRegisterWndClassInfoA(_ATL_MODULEA *pm, _ATL_WNDCLASSINFOA
 
         if (!wci->m_wc.lpszClassName)
         {
-            sprintf(wci->m_szAutoName, "ATL%08lx", (UINT_PTR)wci);
+            sprintf(wci->m_szAutoName, "ATL%08lx", PtrToUlong(wci));
             TRACE("auto-generated class name %s\n", wci->m_szAutoName);
             wci->m_wc.lpszClassName = wci->m_szAutoName;
         }
@@ -373,7 +373,7 @@ ATOM WINAPI AtlModuleRegisterWndClassInfoW(_ATL_MODULEW *pm, _ATL_WNDCLASSINFOW
         if (!wci->m_wc.lpszClassName)
         {
             static const WCHAR szFormat[] = {'A','T','L','%','0','8','l','x',0};
-            swprintf(wci->m_szAutoName, ARRAY_SIZE(wci->m_szAutoName), szFormat, (UINT_PTR)wci);
+            swprintf(wci->m_szAutoName, ARRAY_SIZE(wci->m_szAutoName), szFormat, PtrToUlong(wci));
             TRACE("auto-generated class name %s\n", debugstr_w(wci->m_szAutoName));
             wci->m_wc.lpszClassName = wci->m_szAutoName;
         }
-- 
2.10.0.windows.1




More information about the wine-devel mailing list