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

Re: [libvirt] [PATCH] error: Fix macro checking for NULL arguments



On Tue, Jun 19, 2012 at 03:58:32PM +0200, Peter Krempa wrote:
> Macro virCheckNullArgGoto is supposed to check for NULL argument but
> checks non-NULL instead.
> ---
>  src/internal.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/internal.h b/src/internal.h
> index 1b1598b..b09609e 100644
> --- a/src/internal.h
> +++ b/src/internal.h
> @@ -241,21 +241,21 @@
> 
>  # define virCheckNonNullArgReturn(argname, retval)  \
>      do {                                            \
>          if (argname == NULL) {                      \
>              virReportInvalidNullArg(argname);       \

This one has a typo too        ^^^^^  s/NullArg/NonNullArg/

>              return retval;                          \
>          }                                           \
>      } while (0)
>  # define virCheckNullArgGoto(argname, label)        \
>      do {                                            \
> -        if (argname == NULL) {                      \
> +        if (argname != NULL) {                      \
>              virReportInvalidNullArg(argname);       \
>              goto label;                             \
>          }                                           \
>      } while (0)
>  # define virCheckNonNullArgGoto(argname, label)     \
>      do {                                            \
>          if (argname == NULL) {                      \
>              virReportInvalidNonNullArg(argname);    \
>              goto label;                             \
>          }                                           \


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


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