[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH libvirt 2/8] domain: add <codec> sound sub-element



On 05/15/2012 04:55 PM, Marc-André Lureau wrote:
> Allow specifying sound device codecs. See formatdomain.html for
> more details.
> ---
>  docs/formatdomain.html.in     |   19 +++++++
>  docs/schemas/domaincommon.rng |   29 +++++++---
>  src/conf/domain_conf.c        |  120 ++++++++++++++++++++++++++++++++++++++++-
>  src/conf/domain_conf.h        |   20 +++++++
>  4 files changed, 180 insertions(+), 8 deletions(-)
> 

> +static int
>  virDomainSoundDefFormat(virBufferPtr buf,
>                          virDomainSoundDefPtr def,
>                          unsigned int flags)
>  {
>      const char *model = virDomainSoundModelTypeToString(def->model);
> +    int children = 0;

You are using this as a bool.

ACK with this squashed in:

diff --git i/src/conf/domain_conf.c w/src/conf/domain_conf.c
index 78755cf..9def71d 100644
--- i/src/conf/domain_conf.c
+++ w/src/conf/domain_conf.c
@@ -11888,7 +11888,7 @@ virDomainSoundDefFormat(virBufferPtr buf,
                         unsigned int flags)
 {
     const char *model = virDomainSoundModelTypeToString(def->model);
-    int children = 0;
+    bool children = false;
     int i;

     if (!model) {
@@ -11902,7 +11902,7 @@ virDomainSoundDefFormat(virBufferPtr buf,
     for (i = 0; i < def->ncodecs; i++) {
         if (!children) {
             virBufferAddLit(buf, ">\n");
-            children = 1;
+            children = true;
         }
         virDomainSoundCodecDefFormat(buf, def->codecs[i]);
     }
@@ -11910,7 +11910,7 @@ virDomainSoundDefFormat(virBufferPtr buf,
     if (virDomainDeviceInfoIsSet(&def->info, flags)) {
         if (!children) {
             virBufferAddLit(buf, ">\n");
-            children = 1;
+            children = true;
         }
         if (virDomainDeviceInfoFormat(buf, &def->info, flags) < 0)
             return -1;


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]