]> xenbits.xensource.com Git - libvirt.git/commit
virSocketAddrIsPrivate: Work on 32bits platforms
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 30 May 2016 13:45:19 +0000 (15:45 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 30 May 2016 13:45:19 +0000 (15:45 +0200)
commit2bd61c84489918c0648aee317c18b5a03f5949a4
tree45c894dbba87b53d28e1e0e15665f2ad6cc3feaf
parent3864d86385e70a333e3b87c1459be0cc3cd683b7
virSocketAddrIsPrivate: Work on 32bits platforms

Yet another one of those where signed int (or long int) is not
enough. And useless to as we're aiming at unsigned anyway.

../../src/util/virsocketaddr.c: In function 'virSocketAddrIsPrivate':
../../src/util/virsocketaddr.c:289:45: error: result of '192l << 24' requires 33 bits to represent, but 'long int' only has 32 bits [-Werror=shift-overflow=]
        return ((val & 0xFFFF0000) == ((192L << 24) + (168 << 16)) ||
                                             ^~
../../src/util/virsocketaddr.c:290:45: error: result of '172l << 24' requires 33 bits to represent, but 'long int' only has 32 bits [-Werror=shift-overflow=]
                (val & 0xFFF00000) == ((172L << 24) + (16  << 16)) ||
                                             ^~
cc1: all warnings being treated as errors

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virsocketaddr.c