monitor: avoid clang shifting negative signed warning
authorJinhyung Jo <jinhyung.jo@samsung.com>
Wed, 31 Aug 2016 08:30:50 +0000 (17:30 +0900)
committerJinhyung Jo <jinhyung.jo@samsung.com>
Tue, 6 Sep 2016 05:42:36 +0000 (14:42 +0900)
clang 3.7.0 on x86_64 warns about the following:

  target-i386/monitor.c:38:22: warning: shifting a negative signed value is
undefined [-Wshift-negative-value]
        addr |= -1LL << 48;
                ~~~~ ^

Change-Id: I0885a0fbadc0273b09e58ef756fea34208ca7230
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
target-i386/monitor.c

index fccfe40..1f0e46c 100644 (file)
@@ -36,7 +36,7 @@ static void print_pte(Monitor *mon, hwaddr addr,
 {
 #ifdef TARGET_X86_64
     if (addr & (1ULL << 47)) {
-        addr |= -1LL << 48;
+        addr |= ~0ULL << 48;
     }
 #endif
     monitor_printf(mon, TARGET_FMT_plx ": " TARGET_FMT_plx