Patchwork [03/15] linux-user: fix types in a comparison

login
register
mail settings
Submitter Blue Swirl
Date Sept. 10, 2010, 8:58 p.m.
Message ID <AANLkTim1SrC6HD0g=-vEPsSzbxA9CxZwXQJhKv68nO9R@mail.gmail.com>
Download mbox | patch
Permalink /patch/64462/
State New
Headers show

Comments

Blue Swirl - Sept. 10, 2010, 8:58 p.m.
-1ul is unsigned long, which does not necessarily match abi_ulong
type.

Fix by using abi_long instead.

This also avoids a warning with GCC flag -Wtype-limits.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 linux-user/mmap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index e10a6ef..035dfbd 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -342,7 +342,7 @@  abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
         munmap(ptr, size);

         /* ENOMEM if we checked the whole of the target address space.  */
-        if (addr == -1ul) {
+        if (addr == (abi_ulong)-1) {
             return (abi_ulong)-1;
         } else if (addr == 0) {
             if (wrapped) {