]> wimlib.net Git - wimlib/commitdiff
win32_*.c: avoid some format string warnings
authorEric Biggers <ebiggers3@gmail.com>
Thu, 30 Mar 2023 07:34:14 +0000 (00:34 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 30 Mar 2023 07:48:37 +0000 (00:48 -0700)
These aren't real issues as all the types in question are 32-bit ints,
but fixing these will prevent warnings later if we're ever able to
enable __attribute__((format)) on Windows (hopefully due to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64862 being fixed).

src/win32_apply.c
src/win32_vss.c

index 70211cd31b40c34f13516a6c2ca863f6f5dc3f16..fd34fcbea0b2863210092011783af15708d642d0 100644 (file)
@@ -1480,7 +1480,7 @@ retry:
        if (unlikely(!NT_SUCCESS(status))) {
                winnt_error(status, L"Can't open \"%ls\" for deletion "
                            "(perms=%x, flags=%x)",
-                           current_path(ctx), perms, flags);
+                           current_path(ctx), (u32)perms, (u32)flags);
                return WIMLIB_ERR_OPEN;
        }
 
index cab05663f420b1565c0eb4caa37bc02015014979..6e9f1a59c005783fec70cc66f15f43cdbad2e14c 100644 (file)
@@ -356,47 +356,55 @@ request_vss_snapshot(IVssBackupComponents *vss, wchar_t *volume,
 
        res = vss->vtable->InitializeForBackup(vss, NULL);
        if (FAILED(res)) {
-               ERROR("IVssBackupComponents.InitializeForBackup() error: %x", res);
+               ERROR("IVssBackupComponents.InitializeForBackup() error: %x",
+                     (u32)res);
                return false;
        }
 
        res = vss->vtable->SetBackupState(vss, FALSE, TRUE, VSS_BT_COPY, FALSE);
        if (FAILED(res)) {
-               ERROR("IVssBackupComponents.SetBackupState() error: %x", res);
+               ERROR("IVssBackupComponents.SetBackupState() error: %x",
+                     (u32)res);
                return false;
        }
 
        res = vss->vtable->StartSnapshotSet(vss, snapshot_id);
        if (FAILED(res)) {
-               ERROR("IVssBackupComponents.StartSnapshotSet() error: %x", res);
+               ERROR("IVssBackupComponents.StartSnapshotSet() error: %x",
+                     (u32)res);
                return false;
        }
 
        res = vss->vtable->AddToSnapshotSet(vss, volume, (GUID){}, snapshot_id);
        if (FAILED(res)) {
-               ERROR("IVssBackupComponents.AddToSnapshotSet() error: %x", res);
+               ERROR("IVssBackupComponents.AddToSnapshotSet() error: %x",
+                     (u32)res);
                return false;
        }
 
        res = vss->vtable->PrepareForBackup(vss, &async);
        if (FAILED(res)) {
-               ERROR("IVssBackupComponents.PrepareForBackup() error: %x", res);
+               ERROR("IVssBackupComponents.PrepareForBackup() error: %x",
+                     (u32)res);
                return false;
        }
        res = wait_and_release(async);
        if (FAILED(res)) {
-               ERROR("IVssAsync.Wait() error while preparing for backup: %x", res);
+               ERROR("IVssAsync.Wait() error while preparing for backup: %x",
+                     (u32)res);
                return false;
        }
 
        res = vss->vtable->DoSnapshotSet(vss, &async);
        if (FAILED(res)) {
-               ERROR("IVssBackupComponents.DoSnapshotSet() error: %x", res);
+               ERROR("IVssBackupComponents.DoSnapshotSet() error: %x",
+                     (u32)res);
                return false;
        }
        res = wait_and_release(async);
        if (FAILED(res)) {
-               ERROR("IVssAsync.Wait() error while doing snapshot set: %x", res);
+               ERROR("IVssAsync.Wait() error while doing snapshot set: %x",
+                     (u32)res);
                return false;
        }
 
@@ -456,7 +464,7 @@ vss_create_snapshot(const wchar_t *source, UNICODE_STRING *vss_path_ret,
 
        res = (*func_CreateVssBackupComponentsInternal)(&vss);
        if (FAILED(res)) {
-               ERROR("CreateVssBackupComponents error: %x", res);
+               ERROR("CreateVssBackupComponents error: %x", (u32)res);
                goto vss_err;
        }
 
@@ -467,7 +475,8 @@ vss_create_snapshot(const wchar_t *source, UNICODE_STRING *vss_path_ret,
 
        res = vss->vtable->GetSnapshotProperties(vss, snapshot_id, &snapshot->props);
        if (FAILED(res)) {
-               ERROR("IVssBackupComponents.GetSnapshotProperties() error: %x", res);
+               ERROR("IVssBackupComponents.GetSnapshotProperties() error: %x",
+                     (u32)res);
                goto vss_err;
        }