aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg.c
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2010-10-08 10:32:23 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-10-20 20:52:12 +0000
commitc3b08d0e05f381b0a02647038d454eecf51ae014 (patch)
tree8aab9f1894d70aac3a94b689a561744e2276655e /tcg/tcg.c
parentb2d4d8329963b13c5cebe5944dcc99f0e9d1b5c7 (diff)
downloadqemu-c3b08d0e05f381b0a02647038d454eecf51ae014.zip
qemu-c3b08d0e05f381b0a02647038d454eecf51ae014.tar.gz
qemu-c3b08d0e05f381b0a02647038d454eecf51ae014.tar.bz2
tcg: Fix compiler error (comparison of unsigned expression)
When qemu is configured with --enable-debug-tcg, gcc throws this warning (or error with -Werror): tcg/tcg.c:1030: error: comparison of unsigned expression >= 0 is always true Fix it by removing the >= 0 part. The type cast to 'unsigned' catches negative values of op (which should never happen). This is a modification of Hollis Blanchard's patch. Cc: Hollis Blanchard <hollis@penguinppc.org> Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r--tcg/tcg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index e0a9030..0cdef0d 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1027,7 +1027,7 @@ void tcg_add_target_add_op_defs(const TCGTargetOpDef *tdefs)
if (tdefs->op == (TCGOpcode)-1)
break;
op = tdefs->op;
- assert(op >= 0 && op < NB_OPS);
+ assert((unsigned)op < NB_OPS);
def = &tcg_op_defs[op];
#if defined(CONFIG_DEBUG_TCG)
/* Duplicate entry in op definitions? */