[Libvir] use C99 initializer for lastErr

Richard W.M. Jones rjones at redhat.com
Mon Mar 31 10:07:48 UTC 2008


On Fri, Mar 28, 2008 at 04:46:12PM +0100, Guido Günther wrote:
> ...this makes things just a bit more readable.
>  -- Guido

> ---
>  src/virterror.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/src/virterror.c b/src/virterror.c
> index 1e39be4..1463129 100644
> --- a/src/virterror.c
> +++ b/src/virterror.c
> @@ -19,7 +19,9 @@
>  #include "internal.h"
>  
>  static virError lastErr =       /* the last error */
> -{ 0, 0, NULL, VIR_ERR_NONE, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL };
> +{ .code = 0, .domain = 0, .message = NULL, .level = VIR_ERR_NONE,
> +  .conn = NULL, .dom = NULL, .str1 = NULL, .str2 = NULL, .str3 = NULL,
> +  .int1 = 0, .int2 = 0, .net = NULL };
>  static virErrorFunc virErrorHandler = NULL;     /* global error handler */
>  static void *virUserData = NULL;        /* associated data */

+1 - I'll commit this later unless anyone objects.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v




More information about the libvir-list mailing list