winecfg: Win64 printf format warning fixes.

Michael Stefaniuc mstefani at redhat.de
Mon Oct 2 16:19:18 CDT 2006


---
 programs/winecfg/Makefile.in   |    1 -
 programs/winecfg/appdefaults.c |    6 +++---
 programs/winecfg/drive.c       |    6 +++---
 programs/winecfg/winecfg.c     |   12 ++++++------
 4 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/programs/winecfg/Makefile.in b/programs/winecfg/Makefile.in
index 2cd4bad..74c18b3 100644
--- a/programs/winecfg/Makefile.in
+++ b/programs/winecfg/Makefile.in
@@ -6,7 +6,6 @@ MODULE    = winecfg.exe
 APPMODE   = -mwindows
 IMPORTS   = comdlg32 comctl32 shell32 ole32 winmm shlwapi uxtheme user32 gdi32 advapi32 kernel32
 EXTRALIBS = -luuid
-EXTRADEFS = -DWINE_NO_LONG_AS_INT
 
 C_SRCS = \
 	appdefaults.c \
diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c
index ad6b7cc..e71055f 100644
--- a/programs/winecfg/appdefaults.c
+++ b/programs/winecfg/appdefaults.c
@@ -360,7 +360,7 @@ static void on_winver_change(HWND dialog
         switch (win_versions[selection].dwPlatformId)
         {
         case VER_PLATFORM_WIN32_WINDOWS:
-            snprintf(Buffer, sizeof(Buffer), "%ld.%ld.%ld", win_versions[selection].dwMajorVersion,
+            snprintf(Buffer, sizeof(Buffer), "%d.%d.%d", win_versions[selection].dwMajorVersion,
                      win_versions[selection].dwMinorVersion, win_versions[selection].dwBuildNumber);
             set_reg_key(HKEY_LOCAL_MACHINE, szKey9x, "VersionNumber", Buffer);
             set_reg_key(HKEY_LOCAL_MACHINE, szKey9x, "SubVersionNumber", win_versions[selection].szCSDVersion);
@@ -374,11 +374,11 @@ static void on_winver_change(HWND dialog
             break;
 
         case VER_PLATFORM_WIN32_NT:
-            snprintf(Buffer, sizeof(Buffer), "%ld.%ld", win_versions[selection].dwMajorVersion,
+            snprintf(Buffer, sizeof(Buffer), "%d.%d", win_versions[selection].dwMajorVersion,
                      win_versions[selection].dwMinorVersion);
             set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, "CurrentVersion", Buffer);
             set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, "CSDVersion", win_versions[selection].szCSDVersion);
-            snprintf(Buffer, sizeof(Buffer), "%ld", win_versions[selection].dwBuildNumber);
+            snprintf(Buffer, sizeof(Buffer), "%d", win_versions[selection].dwBuildNumber);
             set_reg_key(HKEY_LOCAL_MACHINE, szKeyNT, "CurrentBuildNumber", Buffer);
             set_reg_key(HKEY_LOCAL_MACHINE, szKeyProdNT, "ProductType", win_versions[selection].szProductType);
             set_reg_key_dword(HKEY_LOCAL_MACHINE, szKeyWindNT, "CSDVersion",
diff --git a/programs/winecfg/drive.c b/programs/winecfg/drive.c
index 0b0cb84..34fee36 100644
--- a/programs/winecfg/drive.c
+++ b/programs/winecfg/drive.c
@@ -322,7 +322,7 @@ void load_drives()
             serial = 0;
         }
 
-        WINE_TRACE("serial: '0x%lX'\n", serial);
+        WINE_TRACE("serial: '0x%X'\n", serial);
 
         /* build rootpath for GetDriveType() */
         lstrcpynA(rootpath, devices, sizeof(rootpath));
@@ -343,7 +343,7 @@ void load_drives()
         c = targetpath;
         do if (*c == '\\') *c = '/'; while (*c++);
 
-        snprintf(serialstr, sizeof(serialstr), "%lX", serial);
+        snprintf(serialstr, sizeof(serialstr), "%X", serial);
         WINE_TRACE("serialstr: '%s'\n", serialstr);
         add_drive(*devices, targetpath, volname, serialstr, get_drive_type(devices[0]) );
 
@@ -486,7 +486,7 @@ void apply_drive_changes(void)
         if (drives[i].label && strcmp(drives[i].label, volumeNameBuffer))
             set_drive_label( drives[i].letter, drives[i].label );
 
-        snprintf(newSerialNumberText, sizeof(newSerialNumberText), "%lX", serialNumber);
+        snprintf(newSerialNumberText, sizeof(newSerialNumberText), "%X", serialNumber);
         if (drives[i].serial && drives[i].serial[0] && strcmp(drives[i].serial, newSerialNumberText))
             set_drive_serial( drives[i].letter, drives[i].serial );
 
diff --git a/programs/winecfg/winecfg.c b/programs/winecfg/winecfg.c
index d383482..42f03fb 100644
--- a/programs/winecfg/winecfg.c
+++ b/programs/winecfg/winecfg.c
@@ -119,7 +119,7 @@ static char *get_config_key (HKEY root, 
         }
         else
         {
-            WINE_ERR("RegOpenKey failed on wine config key (res=%ld)\n", res);
+            WINE_ERR("RegOpenKey failed on wine config key (res=%d)\n", res);
         }
         goto end;
     }
@@ -132,7 +132,7 @@ static char *get_config_key (HKEY root, 
 	goto end;
     } else if (res != ERROR_SUCCESS)
     {
-        WINE_ERR("Couldn't query value's length (res=%ld)\n", res);
+        WINE_ERR("Couldn't query value's length (res=%d)\n", res);
         goto end;
     }
 
@@ -162,7 +162,7 @@ static int set_config_key(HKEY root, con
     DWORD res = 1;
     HKEY key = NULL;
 
-    WINE_TRACE("subkey=%s: name=%s, value=%p, type=%ld\n", subkey, name, value, type);
+    WINE_TRACE("subkey=%s: name=%s, value=%p, type=%d\n", subkey, name, value, type);
 
     assert( subkey != NULL );
 
@@ -184,7 +184,7 @@ static int set_config_key(HKEY root, con
     res = 0;
 end:
     if (key && key != root) RegCloseKey(key);
-    if (res != 0) WINE_ERR("Unable to set configuration key %s in section %s, res=%ld\n", name, subkey, res);
+    if (res != 0) WINE_ERR("Unable to set configuration key %s in section %s, res=%d\n", name, subkey, res);
     return res;
 }
 
@@ -492,7 +492,7 @@ char **enumerate_values(HKEY root, char 
     }
     else
     {
-        WINE_WARN("failed opening registry key %s, res=0x%lx\n", path, res);
+        WINE_WARN("failed opening registry key %s, res=0x%x\n", path, res);
     }
 
     WINE_TRACE("adding settings in list but not registry\n");
@@ -629,7 +629,7 @@ int initialize(HINSTANCE hInstance)
     DWORD res = RegCreateKey(HKEY_CURRENT_USER, WINE_KEY_ROOT, &config_key);
 
     if (res != ERROR_SUCCESS) {
-	WINE_ERR("RegOpenKey failed on wine config key (%ld)\n", res);
+	WINE_ERR("RegOpenKey failed on wine config key (%d)\n", res);
 	return 1;
     }
 
-- 
1.4.2.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20061002/903e6e44/attachment.pgp


More information about the wine-patches mailing list