[libvirt] [PATCH] Fix compiler warnings in test code

Daniel P. Berrange berrange at redhat.com
Wed Dec 17 15:17:35 UTC 2008


On Tue, Dec 16, 2008 at 06:51:14PM -0800, john.levon at sun.com wrote:
> # HG changeset patch
> # User john.levon at sun.com
> # Date 1229399267 28800
> # Node ID 1b81ac255ad765ab782829e7fe0a55dc7bab72ab
> # Parent  ee6ccfc062f49f514d7ae8924d5a596b18441fee
> Fix compiler warnings in test code
> 
> Signed-off-by: John Levon <john.levon at sun.com>
> 
> diff --git a/src/test.c b/src/test.c
> --- a/src/test.c
> +++ b/src/test.c
> @@ -1299,7 +1299,7 @@ static unsigned long testGetMaxMemory(vi
>  static unsigned long testGetMaxMemory(virDomainPtr domain) {
>      testConnPtr privconn = domain->conn->privateData;
>      virDomainObjPtr privdom;
> -    unsigned long ret = -1;
> +    unsigned long ret = (unsigned long)-1;

The original code was actually bogus. It should have been
initialized to '0' as the error return value, rather than
the current '-1'.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list