diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2010-09-18 05:53:14 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-09-18 05:53:14 +0000 |
commit | 45416789e8ccced568a4984af61974adfbfa0f62 (patch) | |
tree | 1d1a9df1f1f6170945b889b9fc6528d41b65bbf7 /hw/sm501.c | |
parent | bf1b00712375bea65f2254dea8281fa646eebbd5 (diff) | |
download | qemu-45416789e8ccced568a4984af61974adfbfa0f62.zip qemu-45416789e8ccced568a4984af61974adfbfa0f62.tar.gz qemu-45416789e8ccced568a4984af61974adfbfa0f62.tar.bz2 |
Use range_covers_byte
Use range_covers_byte() instead of comparisons.
This avoids some warnings with GCC flag -Wtype-limits.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/sm501.c')
-rw-r--r-- | hw/sm501.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -29,6 +29,7 @@ #include "devices.h" #include "sysbus.h" #include "qdev-addr.h" +#include "range.h" /* * Status: 2010/05/07 @@ -814,7 +815,7 @@ static uint32_t sm501_palette_read(void *opaque, target_phys_addr_t addr) /* TODO : consider BYTE/WORD access */ /* TODO : consider endian */ - assert(0 <= addr && addr < 0x400 * 3); + assert(range_covers_byte(0, 0x400 * 3, addr)); return *(uint32_t*)&s->dc_palette[addr]; } @@ -828,7 +829,7 @@ static void sm501_palette_write(void *opaque, /* TODO : consider BYTE/WORD access */ /* TODO : consider endian */ - assert(0 <= addr && addr < 0x400 * 3); + assert(range_covers_byte(0, 0x400 * 3, addr)); *(uint32_t*)&s->dc_palette[addr] = value; } |