summaryrefslogtreecommitdiffstats
path: root/test/cache_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/cache_common.c')
-rw-r--r--test/cache_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/cache_common.c b/test/cache_common.c
index 8cec96c..c3211f8 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -281,14 +281,14 @@ addr_to_type_and_index(haddr_t addr,
if ( addr >= PICO_ALT_BASE_ADDR ) {
- idx = (addr - alt_base_addrs[type]) / entry_sizes[type];
+ idx = (int32_t)((addr - alt_base_addrs[type]) / entry_sizes[type]);
HDassert( ( idx >= 0 ) && ( idx <= max_indices[type] ) );
HDassert( !((entries[type])[idx].at_main_addr) );
HDassert( addr == (entries[type])[idx].alt_addr );
} else {
- idx = (addr - base_addrs[type]) / entry_sizes[type];
+ idx = (int32_t)((addr - base_addrs[type]) / entry_sizes[type]);
HDassert( ( idx >= 0 ) && ( idx <= max_indices[type] ) );
HDassert( (entries[type])[idx].at_main_addr );
HDassert( addr == (entries[type])[idx].main_addr );