[PATCH 23/27] dlls/hhctrl.ocx: enable compilation with long types

Eric Pouech eric.pouech at gmail.com
Thu Feb 10 01:43:31 CST 2022


Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---
 dlls/hhctrl.ocx/Makefile.in  |    1 -
 dlls/hhctrl.ocx/chm.c        |   38 +++++++++++++++++++-------------------
 dlls/hhctrl.ocx/help.c       |    8 ++++----
 dlls/hhctrl.ocx/hhctrl.c     |    6 +++---
 dlls/hhctrl.ocx/search.c     |    6 +++---
 dlls/hhctrl.ocx/webbrowser.c |    6 +++---
 6 files changed, 32 insertions(+), 33 deletions(-)

diff --git a/dlls/hhctrl.ocx/Makefile.in b/dlls/hhctrl.ocx/Makefile.in
index 11dbc80e939..ef1876648c9 100644
--- a/dlls/hhctrl.ocx/Makefile.in
+++ b/dlls/hhctrl.ocx/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
 MODULE    = hhctrl.ocx
 IMPORTLIB = htmlhelp
 IMPORTS   = uuid advapi32 comctl32 shlwapi ole32 oleaut32 user32 gdi32
diff --git a/dlls/hhctrl.ocx/chm.c b/dlls/hhctrl.ocx/chm.c
index 4d7b3a5a7f9..3a9a8fa9e7a 100644
--- a/dlls/hhctrl.ocx/chm.c
+++ b/dlls/hhctrl.ocx/chm.c
@@ -55,7 +55,7 @@ static LPCSTR GetChmString(CHMInfo *chm, DWORD offset)
         pos.QuadPart = offset & ~BLOCK_MASK;
         hres = IStream_Seek(chm->strings_stream, pos, STREAM_SEEK_SET, NULL);
         if(FAILED(hres)) {
-            WARN("Seek failed: %08x\n", hres);
+            WARN("Seek failed: %08lx\n", hres);
             return NULL;
         }
 
@@ -64,7 +64,7 @@ static LPCSTR GetChmString(CHMInfo *chm, DWORD offset)
         hres = IStream_Read(chm->strings_stream, chm->strings[offset >> BLOCK_BITS],
                             BLOCK_SIZE, &read);
         if(FAILED(hres)) {
-            WARN("Read failed: %08x\n", hres);
+            WARN("Read failed: %08lx\n", hres);
             heap_free(chm->strings[offset >> BLOCK_BITS]);
             chm->strings[offset >> BLOCK_BITS] = NULL;
             return NULL;
@@ -72,7 +72,7 @@ static LPCSTR GetChmString(CHMInfo *chm, DWORD offset)
     }
 
     str = chm->strings[offset >> BLOCK_BITS] + (offset & BLOCK_MASK);
-    TRACE("offset %#x => %s\n", offset, debugstr_a(str));
+    TRACE("offset %#lx => %s\n", offset, debugstr_a(str));
     return str;
 }
 
@@ -92,12 +92,12 @@ static BOOL ReadChmSystem(CHMInfo *chm)
 
     hres = IStorage_OpenStream(chm->pStorage, wszSYSTEM, NULL, STGM_READ, 0, &stream);
     if(FAILED(hres)) {
-        WARN("Could not open #SYSTEM stream: %08x\n", hres);
+        WARN("Could not open #SYSTEM stream: %08lx\n", hres);
         return FALSE;
     }
 
     IStream_Read(stream, &ver, sizeof(ver), &read);
-    TRACE("version is %x\n", ver);
+    TRACE("version is %lx\n", ver);
 
     buf = heap_alloc(8*sizeof(DWORD));
     buf_size = 8*sizeof(DWORD);
@@ -132,7 +132,7 @@ static BOOL ReadChmSystem(CHMInfo *chm)
             break;
         case 0x4:
             /* TODO: Currently only the Locale ID is loaded from this field */
-            TRACE("Locale is: %d\n", *(LCID*)&buf[0]);
+            TRACE("Locale is: %ld\n", *(LCID*)&buf[0]);
             if(!GetLocaleInfoW(*(LCID*)&buf[0], LOCALE_IDEFAULTANSICODEPAGE|LOCALE_RETURN_NUMBER,
                                (WCHAR *)&chm->codePage, sizeof(chm->codePage)/sizeof(WCHAR)))
                 chm->codePage = CP_ACP;
@@ -150,13 +150,13 @@ static BOOL ReadChmSystem(CHMInfo *chm)
             TRACE("Version is %s\n", debugstr_an(buf, entry.len));
             break;
         case 0xa:
-            TRACE("Time is %08x\n", *(DWORD*)buf);
+            TRACE("Time is %08lx\n", *(DWORD*)buf);
             break;
         case 0xc:
-            TRACE("Number of info types: %d\n", *(DWORD*)buf);
+            TRACE("Number of info types: %ld\n", *(DWORD*)buf);
             break;
         case 0xf:
-            TRACE("Check sum: %x\n", *(DWORD*)buf);
+            TRACE("Check sum: %lx\n", *(DWORD*)buf);
             break;
         default:
             TRACE("unhandled code %x, size %x\n", entry.code, entry.len);
@@ -181,13 +181,13 @@ LPWSTR FindContextAlias(CHMInfo *chm, DWORD index)
 
     hres = IStorage_OpenStream(chm->pStorage, wszIVB, NULL, STGM_READ, 0, &ivb_stream);
     if(FAILED(hres)) {
-        WARN("Could not open #IVB stream: %08x\n", hres);
+        WARN("Could not open #IVB stream: %08lx\n", hres);
         return NULL;
     }
 
     hres = IStream_Read(ivb_stream, &size, sizeof(size), &read);
     if(FAILED(hres)) {
-        WARN("Read failed: %08x\n", hres);
+        WARN("Read failed: %08lx\n", hres);
         IStream_Release(ivb_stream);
         return NULL;
     }
@@ -196,7 +196,7 @@ LPWSTR FindContextAlias(CHMInfo *chm, DWORD index)
     hres = IStream_Read(ivb_stream, buf, size, &read);
     IStream_Release(ivb_stream);
     if(FAILED(hres)) {
-        WARN("Read failed: %08x\n", hres);
+        WARN("Read failed: %08lx\n", hres);
         heap_free(buf);
         return NULL;
     }
@@ -261,7 +261,7 @@ void MergeChmProperties(HH_WINTYPEW *src, HHInfo *info, BOOL override)
     DWORD merge = override ? src->fsValidMembers : src->fsValidMembers & ~dst->fsValidMembers;
 
     if (unhandled_params)
-        FIXME("Unsupported fsValidMembers fields: 0x%x\n", unhandled_params);
+        FIXME("Unsupported fsValidMembers fields: 0x%lx\n", unhandled_params);
 
     dst->fsValidMembers |= merge;
     if (dst->cbStruct == 0)
@@ -543,7 +543,7 @@ IStream *GetChmStream(CHMInfo *info, LPCWSTR parent_chm, ChmPath *chm_file)
                 chm_file->chm_file ? chm_file->chm_file : parent_chm, NULL,
                 STGM_READ | STGM_SHARE_DENY_WRITE, NULL, 0, &storage);
         if(FAILED(hres)) {
-            WARN("Could not open storage: %08x\n", hres);
+            WARN("Could not open storage: %08lx\n", hres);
             return NULL;
         }
     }else {
@@ -554,7 +554,7 @@ IStream *GetChmStream(CHMInfo *info, LPCWSTR parent_chm, ChmPath *chm_file)
     hres = IStorage_OpenStream(storage, chm_file->chm_index, NULL, STGM_READ, 0, &stream);
     IStorage_Release(storage);
     if(FAILED(hres))
-        WARN("Could not open stream: %08x\n", hres);
+        WARN("Could not open stream: %08lx\n", hres);
 
     return stream;
 }
@@ -583,7 +583,7 @@ WCHAR *GetDocumentTitle(CHMInfo *info, LPCWSTR document)
     hres = IStorage_OpenStream(storage, document, NULL, STGM_READ, 0, &str);
     IStorage_Release(storage);
     if(FAILED(hres))
-        WARN("Could not open stream: %08x\n", hres);
+        WARN("Could not open stream: %08lx\n", hres);
 
     stream_init(&stream, str);
     strbuf_init(&node);
@@ -635,20 +635,20 @@ CHMInfo *OpenCHM(LPCWSTR szFile)
     hres = CoCreateInstance(&CLSID_ITStorage, NULL, CLSCTX_INPROC_SERVER,
             &IID_IITStorage, (void **) &ret->pITStorage) ;
     if(FAILED(hres)) {
-        WARN("Could not create ITStorage: %08x\n", hres);
+        WARN("Could not create ITStorage: %08lx\n", hres);
         return CloseCHM(ret);
     }
 
     hres = IITStorage_StgOpenStorage(ret->pITStorage, szFile, NULL,
             STGM_READ | STGM_SHARE_DENY_WRITE, NULL, 0, &ret->pStorage);
     if(FAILED(hres)) {
-        WARN("Could not open storage: %08x\n", hres);
+        WARN("Could not open storage: %08lx\n", hres);
         return CloseCHM(ret);
     }
     hres = IStorage_OpenStream(ret->pStorage, wszSTRINGS, NULL, STGM_READ, 0,
             &ret->strings_stream);
     if(FAILED(hres)) {
-        WARN("Could not open #STRINGS stream: %08x\n", hres);
+        WARN("Could not open #STRINGS stream: %08lx\n", hres);
         /* It's not critical, so we pass */
     }
 
diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c
index e9957a86e73..d76dfd4d94f 100644
--- a/dlls/hhctrl.ocx/help.c
+++ b/dlls/hhctrl.ocx/help.c
@@ -201,7 +201,7 @@ static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
     VariantClear(&url);
 
     if(FAILED(hres))
-        TRACE("Navigation failed: %08x\n", hres);
+        TRACE("Navigation failed: %08lx\n", hres);
 
     return hres;
 }
@@ -242,7 +242,7 @@ static BOOL AppendFullPathURL(LPCWSTR file, LPWSTR buf, LPCWSTR index)
     TRACE("%s %p %s\n", debugstr_w(file), buf, debugstr_w(index));
 
     if (!GetFullPathNameW(file, ARRAY_SIZE(full_path), full_path, NULL)) {
-        WARN("GetFullPathName failed: %u\n", GetLastError());
+        WARN("GetFullPathName failed: %lu\n", GetLastError());
         return FALSE;
     }
 
@@ -272,7 +272,7 @@ static void DoSync(HHInfo *info)
 
     if (FAILED(hres))
     {
-        WARN("get_LocationURL failed: %08x\n", hres);
+        WARN("get_LocationURL failed: %08lx\n", hres);
         return;
     }
 
@@ -954,7 +954,7 @@ static void TB_AddButtonsFromFlags(HHInfo *pHHInfo, TBBUTTON *pButtons, DWORD dw
         HHWIN_BUTTON_FAVORITES | HHWIN_BUTTON_JUMP1 | HHWIN_BUTTON_JUMP2 |
         HHWIN_BUTTON_ZOOM | HHWIN_BUTTON_TOC_NEXT | HHWIN_BUTTON_TOC_PREV);
     if (unsupported)
-        FIXME("got asked for unsupported buttons: %06x\n", unsupported);
+        FIXME("got asked for unsupported buttons: %06lx\n", unsupported);
 
     if (dwButtonFlags & HHWIN_BUTTON_EXPAND)
     {
diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c
index b1ccabb2c0e..d0f73e5a784 100644
--- a/dlls/hhctrl.ocx/hhctrl.c
+++ b/dlls/hhctrl.ocx/hhctrl.c
@@ -44,7 +44,7 @@ BOOL hh_process = FALSE;
 
 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)
 {
-    TRACE("(%p,%d,%p)\n", hInstance, fdwReason, lpvReserved);
+    TRACE("(%p,%ld,%p)\n", hInstance, fdwReason, lpvReserved);
 
     switch (fdwReason)
     {
@@ -158,7 +158,7 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
 {
     WCHAR fullname[MAX_PATH];
 
-    TRACE("(%p, %s, command=%s, data=%lx)\n",
+    TRACE("(%p, %s, command=%s, data=%Ix)\n",
           caller, debugstr_w( filename ),
           command_to_string( command ), data);
 
@@ -345,7 +345,7 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
         else
             heap_free(window);
 
-        TRACE("Changing WINTYPE, fsValidMembers=0x%x\n", wintype->fsValidMembers);
+        TRACE("Changing WINTYPE, fsValidMembers=0x%lx\n", wintype->fsValidMembers);
 
         MergeChmProperties(wintype, info, TRUE);
         UpdateHelpWindow(info);
diff --git a/dlls/hhctrl.ocx/search.c b/dlls/hhctrl.ocx/search.c
index 75bbc2e4ba2..56d9a898005 100644
--- a/dlls/hhctrl.ocx/search.c
+++ b/dlls/hhctrl.ocx/search.c
@@ -83,7 +83,7 @@ static WCHAR *SearchCHM_File(IStorage *pStorage, const WCHAR *file, const char *
 
     hres = IStorage_OpenStream(pStorage, file, NULL, STGM_READ, 0, &temp_stream);
     if(FAILED(hres)) {
-        FIXME("Could not open '%s' stream: %08x\n", debugstr_w(file), hres);
+        FIXME("Could not open '%s' stream: %08lx\n", debugstr_w(file), hres);
         goto cleanup;
     }
 
@@ -162,7 +162,7 @@ static SearchItem *SearchCHM_Storage(SearchItem *item, IStorage *pStorage,
     hres = IStorage_EnumElements(pStorage, 0, NULL, 0, &elem);
     if(hres != S_OK)
     {
-        FIXME("Could not enumerate '/' storage elements: %08x\n", hres);
+        FIXME("Could not enumerate '/' storage elements: %08lx\n", hres);
         return NULL;
     }
     while (IEnumSTATSTG_Next(elem, 1, &entries, &retr) == NOERROR)
@@ -206,7 +206,7 @@ static SearchItem *SearchCHM_Folder(SearchItem *item, IStorage *pStorage,
     hres = IStorage_OpenStorage(pStorage, folder, NULL, STGM_READ, NULL, 0, &temp_storage);
     if(FAILED(hres))
     {
-        FIXME("Could not open '%s' storage object: %08x\n", debugstr_w(folder), hres);
+        FIXME("Could not open '%s' storage object: %08lx\n", debugstr_w(folder), hres);
         return NULL;
     }
     item = SearchCHM_Storage(item, temp_storage, needle);
diff --git a/dlls/hhctrl.ocx/webbrowser.c b/dlls/hhctrl.ocx/webbrowser.c
index e44c4ecd9de..3b662bd4bf5 100644
--- a/dlls/hhctrl.ocx/webbrowser.c
+++ b/dlls/hhctrl.ocx/webbrowser.c
@@ -64,7 +64,7 @@ static ULONG STDMETHODCALLTYPE Site_AddRef(IOleClientSite *iface)
     WebBrowserContainer *This = impl_from_IOleClientSite(iface);
     LONG ref = InterlockedIncrement(&This->ref);
 
-    TRACE("(%p) ref=%d\n", This, ref);
+    TRACE("(%p) ref=%ld\n", This, ref);
 
     return ref;
 }
@@ -74,7 +74,7 @@ static ULONG STDMETHODCALLTYPE Site_Release(IOleClientSite *iface)
     WebBrowserContainer *This = impl_from_IOleClientSite(iface);
     LONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p) ref=%d\n", This, ref);
+    TRACE("(%p) ref=%ld\n", This, ref);
 
     if(!ref) {
         if(This->ole_obj)
@@ -164,7 +164,7 @@ static HRESULT STDMETHODCALLTYPE UI_ShowContextMenu(IDocHostUIHandler *iface, DW
     DWORD cmdid, menu_id = 0;
     HMENU menu, submenu;
 
-    TRACE("(%p)->(%d %s)\n", This, dwID, wine_dbgstr_point(ppt));
+    TRACE("(%p)->(%ld %s)\n", This, dwID, wine_dbgstr_point(ppt));
 
     menu = LoadMenuW(hhctrl_hinstance, MAKEINTRESOURCEW(MENU_WEBBROWSER));
     if (!menu)




More information about the wine-devel mailing list