• R
    fix GCC 5.0.0 logical-not-parentheses warnings · 8c1ac475
    Radim Krčmář 提交于
    man gcc:
      Warn about logical not used on the left hand side operand of a
      comparison.  This option does not warn if the RHS operand is of a
      boolean type.
    
    By preferring bool over int where sensible, but without modifying any
    depending code, make GCC happy in cases like this,
      qemu-img.c: In function ‘compare_sectors’:
      qemu-img.c:992:39: error: logical not is only applied to the left hand
      side of comparison [-Werror=logical-not-parentheses]
               if (!!memcmp(buf1, buf2, 512) != res) {
    
    hw/ide/core.c:1836 doesn't throw an error,
      assert(!!s->error == !!(s->status & ERR_STAT));
    even thought the second operand is int (and first hunk of this patch has
    a very similar case), maybe GCC developers still have a little faith in
    C programmers.
    Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
    Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
    8c1ac475
virtio-net.c 51.9 KB