Eric Pouech : winecfg: Enable compilation with long types.

Alexandre Julliard julliard at winehq.org
Mon Feb 7 15:56:04 CST 2022


Module: wine
Branch: master
Commit: 27aacaa73e47542f4ba5fae0b42734252751c3ef
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=27aacaa73e47542f4ba5fae0b42734252751c3ef

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Mon Feb  7 08:40:37 2022 +0100

winecfg: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/winecfg/Makefile.in |  1 -
 programs/winecfg/audio.c     |  8 ++++----
 programs/winecfg/drive.c     | 14 +++++++-------
 programs/winecfg/driveui.c   |  4 ++--
 programs/winecfg/main.c      |  2 +-
 programs/winecfg/winecfg.c   | 14 +++++++-------
 programs/winecfg/x11drvdlg.c |  2 +-
 7 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/programs/winecfg/Makefile.in b/programs/winecfg/Makefile.in
index f7540a55372..84be34eab10 100644
--- a/programs/winecfg/Makefile.in
+++ b/programs/winecfg/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
 MODULE    = winecfg.exe
 IMPORTS   = uuid comdlg32 comctl32 shell32 ole32 winmm shlwapi uxtheme user32 gdi32 advapi32
 
diff --git a/programs/winecfg/audio.c b/programs/winecfg/audio.c
index d1cb530e4eb..cd73703a0dd 100644
--- a/programs/winecfg/audio.c
+++ b/programs/winecfg/audio.c
@@ -412,7 +412,7 @@ static void apply_speaker_configs(void)
         CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&devenum);
 
     if(FAILED(hr)){
-        ERR("Unable to create MMDeviceEnumerator: 0x%08x\n", hr);
+        ERR("Unable to create MMDeviceEnumerator: 0x%08lx\n", hr);
         return;
     }
 
@@ -423,14 +423,14 @@ static void apply_speaker_configs(void)
         hr = IMMDeviceEnumerator_GetDevice(devenum, render_devs[i].id, &dev);
 
         if(FAILED(hr)){
-            WARN("Could not get MMDevice for %s: 0x%08x\n", wine_dbgstr_w(render_devs[i].id), hr);
+            WARN("Could not get MMDevice for %s: 0x%08lx\n", wine_dbgstr_w(render_devs[i].id), hr);
             continue;
         }
 
         hr = IMMDevice_OpenPropertyStore(dev, STGM_WRITE, &ps);
 
         if(FAILED(hr)){
-            WARN("Could not open property store for %s: 0x%08x\n", wine_dbgstr_w(render_devs[i].id), hr);
+            WARN("Could not open property store for %s: 0x%08lx\n", wine_dbgstr_w(render_devs[i].id), hr);
             IMMDevice_Release(dev);
             continue;
         }
@@ -440,7 +440,7 @@ static void apply_speaker_configs(void)
         hr = IPropertyStore_SetValue(ps, &PKEY_AudioEndpoint_PhysicalSpeakers, &pv);
 
         if (FAILED(hr))
-            WARN("IPropertyStore_SetValue failed for %s: 0x%08x\n", wine_dbgstr_w(render_devs[i].id), hr);
+            WARN("IPropertyStore_SetValue failed for %s: 0x%08lx\n", wine_dbgstr_w(render_devs[i].id), hr);
 
         IPropertyStore_Release(ps);
         IMMDevice_Release(dev);
diff --git a/programs/winecfg/drive.c b/programs/winecfg/drive.c
index b4b4239c003..4d798ef7671 100644
--- a/programs/winecfg/drive.c
+++ b/programs/winecfg/drive.c
@@ -85,7 +85,7 @@ ULONG drive_available_mask(char letter)
   result = ~result;
   if (letter) result |= DRIVE_MASK_BIT(letter);
 
-  WINE_TRACE("finished drive letter loop with %x\n", result);
+  WINE_TRACE("finished drive letter loop with %lx\n", result);
   return result;
 }
 
@@ -97,7 +97,7 @@ BOOL add_drive(char letter, const char *targetpath, const char *device, const WC
     if(drives[driveIndex].in_use)
         return FALSE;
 
-    WINE_TRACE("letter == '%c', unixpath == %s, device == %s, label == %s, serial == %08x, type == %d\n",
+    WINE_TRACE("letter == '%c', unixpath == %s, device == %s, label == %s, serial == %08lx, type == %ld\n",
                letter, wine_dbgstr_a(targetpath), wine_dbgstr_a(device),
                wine_dbgstr_w(label), serial, type);
 
@@ -183,7 +183,7 @@ static void set_drive_serial( WCHAR letter, DWORD serial )
     HANDLE hFile;
 
     filename[0] = letter;
-    WINE_TRACE("Putting serial number of %08X into file %s\n", serial, wine_dbgstr_w(filename));
+    WINE_TRACE("Putting serial number of %08lX into file %s\n", serial, wine_dbgstr_w(filename));
     hFile = CreateFileW(filename, GENERIC_WRITE, FILE_SHARE_READ, NULL,
                         CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
     if (hFile != INVALID_HANDLE_VALUE)
@@ -191,7 +191,7 @@ static void set_drive_serial( WCHAR letter, DWORD serial )
         DWORD w;
         char buffer[16];
 
-        sprintf( buffer, "%X\n", serial );
+        sprintf( buffer, "%lX\n", serial );
         WriteFile(hFile, buffer, strlen(buffer), &w, NULL);
         CloseHandle(hFile);
     }
@@ -204,7 +204,7 @@ static HANDLE open_mountmgr(void)
     if ((ret = CreateFileW( MOUNTMGR_DOS_DEVICE_NAME, GENERIC_READ|GENERIC_WRITE,
                             FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
                             0, 0 )) == INVALID_HANDLE_VALUE)
-        WINE_ERR( "failed to open mount manager err %u\n", GetLastError() );
+        WINE_ERR( "failed to open mount manager err %lu\n", GetLastError() );
     return ret;
 }
 
@@ -315,10 +315,10 @@ void apply_drive_changes(void)
         {
             set_drive_label( drives[i].letter, drives[i].label );
             if (drives[i].in_use) set_drive_serial( drives[i].letter, drives[i].serial );
-            WINE_TRACE( "set drive %c: to %s type %u\n", 'a' + i,
+            WINE_TRACE( "set drive %c: to %s type %lu\n", 'a' + i,
                         wine_dbgstr_a(drives[i].unixpath), drives[i].type );
         }
-        else WINE_WARN( "failed to set drive %c: to %s type %u err %u\n", 'a' + i,
+        else WINE_WARN( "failed to set drive %c: to %s type %lu err %lu\n", 'a' + i,
                        wine_dbgstr_a(drives[i].unixpath), drives[i].type, GetLastError() );
         HeapFree( GetProcessHeap(), 0, ioctl );
     }
diff --git a/programs/winecfg/driveui.c b/programs/winecfg/driveui.c
index 35689ac6007..28fc6cf02d6 100644
--- a/programs/winecfg/driveui.c
+++ b/programs/winecfg/driveui.c
@@ -463,7 +463,7 @@ static void update_controls(HWND dialog)
     set_textW(dialog, IDC_EDIT_LABEL, current_drive->label ? current_drive->label : emptyW);
 
     /* set serial edit text */
-    sprintf( serial, "%X", current_drive->serial );
+    sprintf( serial, "%lX", current_drive->serial );
     set_text(dialog, IDC_EDIT_SERIAL, serial);
 
     set_text(dialog, IDC_EDIT_DEVICE, current_drive->device);
@@ -542,7 +542,7 @@ static void on_edit_changed(HWND dialog, WORD id)
             HeapFree(GetProcessHeap(), 0, serial);
             current_drive->modified = TRUE;
 
-            WINE_TRACE("set serial to %08X\n", current_drive->serial);
+            WINE_TRACE("set serial to %08lX\n", current_drive->serial);
 
             /* enable the apply button  */
             SendMessageW(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0);
diff --git a/programs/winecfg/main.c b/programs/winecfg/main.c
index 77b732d6819..67df9146f3d 100644
--- a/programs/winecfg/main.c
+++ b/programs/winecfg/main.c
@@ -247,7 +247,7 @@ wWinMain (HINSTANCE hInstance, HINSTANCE hPrev, LPWSTR cmdline, int nShow)
             GetExitCodeProcess( pi.hProcess, &exit_code );
             ExitProcess( exit_code );
         }
-        else WINE_ERR( "failed to restart 64-bit %s, err %d\n", wine_dbgstr_w(filename), GetLastError() );
+        else WINE_ERR( "failed to restart 64-bit %s, err %ld\n", wine_dbgstr_w(filename), GetLastError() );
         Wow64RevertWow64FsRedirection( redir );
     }
 
diff --git a/programs/winecfg/winecfg.c b/programs/winecfg/winecfg.c
index 23aa10cd2d4..ed319e91f5d 100644
--- a/programs/winecfg/winecfg.c
+++ b/programs/winecfg/winecfg.c
@@ -120,7 +120,7 @@ static WCHAR *get_config_key (HKEY root, const WCHAR *subkey, const WCHAR *name,
         }
         else
         {
-            WINE_ERR("RegOpenKey failed on wine config key (res=%d)\n", res);
+            WINE_ERR("RegOpenKey failed on wine config key (res=%ld)\n", res);
         }
         goto end;
     }
@@ -133,7 +133,7 @@ static WCHAR *get_config_key (HKEY root, const WCHAR *subkey, const WCHAR *name,
 	goto end;
     } else if (res != ERROR_SUCCESS)
     {
-        WINE_ERR("Couldn't query value's length (res=%d)\n", res);
+        WINE_ERR("Couldn't query value's length (res=%ld)\n", res);
         goto end;
     }
 
@@ -164,7 +164,7 @@ static int set_config_key(HKEY root, const WCHAR *subkey, REGSAM access, const W
     DWORD res = 1;
     HKEY key = NULL;
 
-    WINE_TRACE("subkey=%s: name=%s, value=%p, type=%d\n", wine_dbgstr_w(subkey),
+    WINE_TRACE("subkey=%s: name=%s, value=%p, type=%ld\n", wine_dbgstr_w(subkey),
                wine_dbgstr_w(name), value, type);
 
     assert( subkey != NULL );
@@ -189,7 +189,7 @@ static int set_config_key(HKEY root, const WCHAR *subkey, REGSAM access, const W
 end:
     if (key && key != root) RegCloseKey(key);
     if (res != 0)
-        WINE_ERR("Unable to set configuration key %s in section %s, res=%d\n",
+        WINE_ERR("Unable to set configuration key %s in section %s, res=%ld\n",
                  wine_dbgstr_w(name), wine_dbgstr_w(subkey), res);
     return res;
 }
@@ -430,13 +430,13 @@ WCHAR **enumerate_values(HKEY root, const WCHAR *path)
             else values = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR*));
 
             values[valueslen++] = strdupW(name);
-            WINE_TRACE("valueslen is now %d\n", valueslen);
+            WINE_TRACE("valueslen is now %ld\n", valueslen);
             i++;
         }
     }
     else
     {
-        WINE_WARN("failed opening registry key %s, res=0x%x\n",
+        WINE_WARN("failed opening registry key %s, res=0x%lx\n",
                   wine_dbgstr_w(path), res);
     }
 
@@ -610,7 +610,7 @@ BOOL initialize(HINSTANCE hInstance)
     DWORD res = RegCreateKeyW(HKEY_CURRENT_USER, WINE_KEY_ROOT, &config_key);
 
     if (res != ERROR_SUCCESS) {
-	WINE_ERR("RegOpenKey failed on wine config key (%d)\n", res);
+	WINE_ERR("RegOpenKey failed on wine config key (%ld)\n", res);
         return TRUE;
     }
 
diff --git a/programs/winecfg/x11drvdlg.c b/programs/winecfg/x11drvdlg.c
index f1b543d5311..a480eac7ead 100644
--- a/programs/winecfg/x11drvdlg.c
+++ b/programs/winecfg/x11drvdlg.c
@@ -245,7 +245,7 @@ static void init_dpi_editbox(HWND hDlg)
     updating_ui = TRUE;
 
     dwLogpixels = read_logpixels_reg();
-    WINE_TRACE("%u\n", dwLogpixels);
+    WINE_TRACE("%lu\n", dwLogpixels);
 
     SetDlgItemInt(hDlg, IDC_RES_DPIEDIT, dwLogpixels, FALSE);
 




More information about the wine-cvs mailing list