[libvirt] [PATCHv2] error: Fix typos in argument checking macros
Daniel P. Berrange
berrange at redhat.com
Tue Jun 19 14:20:36 UTC 2012
On Tue, Jun 19, 2012 at 04:19:02PM +0200, Peter Krempa wrote:
> Macro virCheckNullArgGoto is supposed to check for NULL argument but
> checks non-NULL instead.
>
> Macro virCheckNonNullArgReturn reports error as if the argument should
> be NULL when it shouldn't.
> ---
> src/internal.h | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/internal.h b/src/internal.h
> index 1b1598b..60be95d 100644
> --- a/src/internal.h
> +++ b/src/internal.h
> @@ -235,27 +235,27 @@
> virReportInvalidArg(flags, \
> _("unsupported flags (0x%lx) in function %s"), \
> __unsuppflags, __FUNCTION__); \
> return retval; \
> } \
> } while (0)
>
> # define virCheckNonNullArgReturn(argname, retval) \
> do { \
> if (argname == NULL) { \
> - virReportInvalidNullArg(argname); \
> + virReportInvalidNonNullArg(argname); \
> 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; \
> } \
ACK
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 :|
More information about the libvir-list
mailing list