[libvirt] [PATCH 5/7] Explicitly cast some switch parameters to enum

Eric Blake eblake at redhat.com
Mon Mar 17 15:38:46 UTC 2014


On 03/17/2014 08:39 AM, Martin Kletzander wrote:
> This patch is not trying to fix every switch, just the ones I worked
> with last time, because some of these were especially unreadable.
> Covers enums virDomainGraphicsType and virDomainChrType (where
> applicable).
> 
> Also sort it's cases by their value.

s/it's/its/ (remember, "it's" is usable only if you could say "it is"
and still make sense; in all other usage you want "its")

> 
> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
> ---
>  src/conf/domain_conf.c  | 22 +++++++++++++---------
>  src/qemu/qemu_command.c |  4 +++-
>  2 files changed, 16 insertions(+), 10 deletions(-)
> 
> @@ -1201,6 +1201,10 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def)
>          VIR_FREE(def->data.spice.keymap);
>          virDomainGraphicsAuthDefClear(&def->data.spice.auth);
>          break;
> +
> +    case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
> +        /* coverity[dead_error_begin] */
> +        break;

This Coverity comment is probably not necessary (but John can confirm
faster than me).

ACK once we figure out if we can drop that comment.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140317/d6902cc2/attachment-0001.sig>


More information about the libvir-list mailing list