The final vvp -Wextra cleanup

This patch resolves the last of the -Wextra warnings by either removing
the parameter or asserting that it is an appropriate value.
This commit is contained in:
Cary R 2010-10-14 13:47:40 -07:00 committed by Stephen Williams
parent b0269fa926
commit 7dd6883992
7 changed files with 25 additions and 11 deletions

View File

@ -1028,8 +1028,11 @@ static vpiHandle vpip_make_array(char*label, const char*name,
return &(obj->base);
}
void array_alias_word(vvp_array_t array, unsigned long addr, vpiHandle word)
void array_alias_word(vvp_array_t array, unsigned long addr, vpiHandle word,
int msb, int lsb)
{
assert(array->msb.value == msb);
assert(array->lsb.value == lsb);
assert(addr < array->array_count);
assert(array->nets);
array->nets[addr] = word;

View File

@ -1,7 +1,7 @@
#ifndef __array_H
#define __array_H
/*
* Copyright (c) 2007-2008 Stephen Williams (steve@icarus.com)
* Copyright (c) 2007-2010 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -36,7 +36,7 @@ extern void array_word_change(vvp_array_t array, unsigned long addr);
extern void array_attach_word(vvp_array_t array, unsigned addr, vpiHandle word);
extern void array_alias_word(vvp_array_t array, unsigned long addr,
vpiHandle word);
vpiHandle word, int msb, int lsb);
extern void array_set_word(vvp_array_t arr, unsigned idx,
unsigned off, vvp_vector4_t val);

View File

@ -675,7 +675,7 @@ void compile_functor(char*label, char*type, unsigned width,
}
vvp_net_t*net_drv = new vvp_net_t;
vvp_net_fun_t*obj_drv = new vvp_fun_drive(BIT4_X, ostr0, ostr1);
vvp_net_fun_t*obj_drv = new vvp_fun_drive(ostr0, ostr1);
net_drv->fun = obj_drv;
/* Point the gate to the drive node. */

View File

@ -2864,7 +2864,7 @@ void vvp_net_fun_t::force_flag(void)
/* **** vvp_fun_drive methods **** */
vvp_fun_drive::vvp_fun_drive(vvp_bit4_t /*init*/, unsigned str0, unsigned str1)
vvp_fun_drive::vvp_fun_drive(unsigned str0, unsigned str1)
{
assert(str0 < 8);
assert(str1 < 8);

View File

@ -1328,7 +1328,7 @@ class vvp_fun_repeat : public vvp_net_fun_t {
class vvp_fun_drive : public vvp_net_fun_t {
public:
vvp_fun_drive(vvp_bit4_t init, unsigned str0 =6, unsigned str1 =6);
vvp_fun_drive(unsigned str0 =6, unsigned str1 =6);
~vvp_fun_drive();
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit,

View File

@ -308,8 +308,12 @@ const vvp_vector4_t& vvp_fun_signal4_sa::vec4_unfiltered_value() const
return bits4_;
}
vvp_fun_signal4_aa::vvp_fun_signal4_aa(unsigned wid, vvp_bit4_t /*init */)
vvp_fun_signal4_aa::vvp_fun_signal4_aa(unsigned wid, vvp_bit4_t init)
{
/* To make init work we would need to save it and then use the
* saved value when we ran reset_instance(). For now just make
* sure it matches the value we use in reset_instance(). */
assert(init == BIT4_X);
context_idx_ = vpip_add_item_to_context(this, vpip_peek_context_scope());
size_ = wid;
}
@ -644,9 +648,12 @@ vvp_net_fil_t::prop_t vvp_wire_vec4::filter_vec4(const vvp_vector4_t&bit, vvp_ve
vvp_net_fil_t::prop_t vvp_wire_vec4::filter_vec8(const vvp_vector8_t&bit,
vvp_vector8_t&rep,
unsigned /*base */,
unsigned /*vwid */)
unsigned base,
unsigned vwid)
{
// For now there is no support for a non-zero base.
assert(0 == base);
assert(bits4_.size() == vwid);
assert(bits4_.size() == bit.size());
bits4_ = reduce4(bit);
return filter_mask_(bit, vvp_vector8_t(force4_,6,6), rep, 0);
@ -769,9 +776,13 @@ vvp_wire_vec8::vvp_wire_vec8(unsigned wid)
vvp_net_fil_t::prop_t vvp_wire_vec8::filter_vec4(const vvp_vector4_t&bit,
vvp_vector4_t&rep,
unsigned /*base */,
unsigned base,
unsigned vwid)
{
// For now there is no support for a non-zero base.
assert(0 == base);
assert(bits8_.size() == vwid);
assert(bits8_.size() == bit.size());
// QUESTION: Is it really correct to propagate a vec4 if this
// is a vec8 node? In fact, it is really possible for a vec4
// value to get through to a vec8 filter?

View File

@ -493,7 +493,7 @@ void compile_aliasw(char*label, char*array_label, unsigned long array_addr,
vpiHandle obj = vvp_lookup_handle(argv[0].text);
assert(obj);
array_alias_word(array, array_addr, obj);
array_alias_word(array, array_addr, obj, msb, lsb);
free(label);
free(array_label);