]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage_encryption: silence clang warning
authorEric Blake <eblake@redhat.com>
Fri, 7 May 2010 20:34:15 +0000 (14:34 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 10 May 2010 19:53:12 +0000 (13:53 -0600)
For printf("%*s",foo,bar), clang complains if foo is not int:

warning: field width should have type 'int', but argument has
type 'unsigned int' [-Wformat]

* src/conf/storage_encryption_conf.c
(virStorageEncryptionSecretFormat, virStorageEncryptionFormat):
Use correct type.
* src/conf/storage_encryption_conf.h (virStorageEncryptionFormat):
Likewise.

src/conf/storage_encryption_conf.c
src/conf/storage_encryption_conf.h

index 7a64050c90c6f6b7152a8d225a883e5cd8adfad8..7bbdbc1871a7288a1b800df8bed40ed80b3b79b3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * storage_encryption_conf.c: volume encryption information
  *
- * Copyright (C) 2009 Red Hat, Inc.
+ * Copyright (C) 2009-2010 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -216,7 +216,7 @@ virStorageEncryptionParseNode(xmlDocPtr xml, xmlNodePtr root)
 static int
 virStorageEncryptionSecretFormat(virBufferPtr buf,
                                  virStorageEncryptionSecretPtr secret,
-                                 unsigned int indent)
+                                 int indent)
 {
     const char *type;
     char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -237,7 +237,7 @@ virStorageEncryptionSecretFormat(virBufferPtr buf,
 int
 virStorageEncryptionFormat(virBufferPtr buf,
                            virStorageEncryptionPtr enc,
-                           unsigned int indent)
+                           int indent)
 {
     const char *format;
     size_t i;
@@ -252,7 +252,8 @@ virStorageEncryptionFormat(virBufferPtr buf,
                       indent, "", format);
 
     for (i = 0; i < enc->nsecrets; i++) {
-        if (virStorageEncryptionSecretFormat(buf, enc->secrets[i], indent + 2) < 0)
+        if (virStorageEncryptionSecretFormat(buf, enc->secrets[i],
+                                             indent + 2) < 0)
             return -1;
     }
 
index 83092554c12448ba837ab898f6106b7bd1b30d4c..c722cc698d6572e3752af1c040589329bb458c83 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * storage_encryption_conf.h: volume encryption information
  *
- * Copyright (C) 2009 Red Hat, Inc.
+ * Copyright (C) 2009-2010 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -68,7 +68,7 @@ virStorageEncryptionPtr virStorageEncryptionParseNode(xmlDocPtr xml,
                                                       xmlNodePtr root);
 int virStorageEncryptionFormat(virBufferPtr buf,
                                virStorageEncryptionPtr enc,
-                               unsigned int indent);
+                               int indent);
 
 /* A helper for VIR_STORAGE_ENCRYPTION_FORMAT_QCOW */
 enum {