aboutsummaryrefslogtreecommitdiff
path: root/hw/sm501.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-09-18 05:53:14 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-09-18 05:53:14 +0000
commit45416789e8ccced568a4984af61974adfbfa0f62 (patch)
tree1d1a9df1f1f6170945b889b9fc6528d41b65bbf7 /hw/sm501.c
parentbf1b00712375bea65f2254dea8281fa646eebbd5 (diff)
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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/sm501.c b/hw/sm501.c
index 8e6932d747..705e0a5c76 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -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;
}