fix leftover signed/unsigned comparisons
triggers warnings in gcc-3.3.5 and gcc-3.4.6 vintage compilers
This commit is contained in:
parent
731f1df70b
commit
e03fd9e6f2
|
|
@ -25,6 +25,7 @@
|
|||
# include "compiler.h"
|
||||
# include <cstdlib>
|
||||
# include <iostream>
|
||||
# include <climits>
|
||||
# include "ivl_assert.h"
|
||||
|
||||
/*
|
||||
|
|
@ -350,7 +351,8 @@ NetAssign_* PEIdent::elaborate_lval_net_word_(Design*des,
|
|||
if (NetEConst*word_const = dynamic_cast<NetEConst*>(word)) {
|
||||
verinum word_val = word_const->value();
|
||||
long index = word_val.as_long();
|
||||
if (index < 0 || index >= reg->array_count()) {
|
||||
assert (reg->array_count() <= LONG_MAX);
|
||||
if (index < 0 || index >= (long) reg->array_count()) {
|
||||
cerr << get_fileline() << ": warning: Constant array index "
|
||||
<< (index + reg->array_first())
|
||||
<< " is out of range for array "
|
||||
|
|
|
|||
|
|
@ -225,10 +225,11 @@ static vpiHandle memory_word_put(vpiHandle ref, p_vpi_value val)
|
|||
|
||||
/* Addresses are converted to canonical form by offsetting the
|
||||
address by the lowest index. */
|
||||
unsigned addr_off = memory_left_range(rfp->mem->mem, 0);
|
||||
long addr_off = memory_left_range(rfp->mem->mem, 0);
|
||||
if (memory_right_range(rfp->mem->mem, 0) < addr_off)
|
||||
addr_off = memory_right_range(rfp->mem->mem, 0);
|
||||
|
||||
assert(addr_off >= 0 && (unsigned) addr_off <= word_addr);
|
||||
word_addr -= addr_off;
|
||||
|
||||
/* Build up the word value from whatever format the user
|
||||
|
|
|
|||
Loading…
Reference in New Issue