Update __vpiNamedEvent to remove struct and remove extra class statements

The clang compiler does not like using struct to reference a class object.
This patch removes all the struct keywords for __vpiNamedEvent objects
since they are now a class and can be called without a struct/class
qualifier.

This patch also removes all the extra class qualifiers from the rest of
the source code.
This commit is contained in:
Cary R 2012-02-12 13:21:30 -08:00
parent 5677efdfe6
commit 391073a750
15 changed files with 66 additions and 64 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999-2011 Stephen Williams (steve@icarus.com) * Copyright (c) 1999-2012 Stephen Williams (steve@icarus.com)
* *
* This source code is free software; you can redistribute it * This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU * and/or modify it in source code form under the terms of the GNU
@ -28,71 +28,71 @@ functor_t::~functor_t()
{ {
} }
void functor_t::event(class Design*, class NetEvent*) void functor_t::event(Design*, NetEvent*)
{ {
} }
void functor_t::signal(class Design*, class NetNet*) void functor_t::signal(Design*, NetNet*)
{ {
} }
void functor_t::process(class Design*, class NetProcTop*) void functor_t::process(Design*, NetProcTop*)
{ {
} }
void functor_t::lpm_abs(class Design*, class NetAbs*) void functor_t::lpm_abs(Design*, NetAbs*)
{ {
} }
void functor_t::lpm_add_sub(class Design*, class NetAddSub*) void functor_t::lpm_add_sub(Design*, NetAddSub*)
{ {
} }
void functor_t::lpm_compare(class Design*, class NetCompare*) void functor_t::lpm_compare(Design*, NetCompare*)
{ {
} }
void functor_t::lpm_const(class Design*, class NetConst*) void functor_t::lpm_const(Design*, NetConst*)
{ {
} }
void functor_t::lpm_divide(class Design*, class NetDivide*) void functor_t::lpm_divide(Design*, NetDivide*)
{ {
} }
void functor_t::lpm_literal(class Design*, class NetLiteral*) void functor_t::lpm_literal(Design*, NetLiteral*)
{ {
} }
void functor_t::lpm_modulo(class Design*, class NetModulo*) void functor_t::lpm_modulo(Design*, NetModulo*)
{ {
} }
void functor_t::lpm_ff(class Design*, class NetFF*) void functor_t::lpm_ff(Design*, NetFF*)
{ {
} }
void functor_t::lpm_logic(class Design*, class NetLogic*) void functor_t::lpm_logic(Design*, NetLogic*)
{ {
} }
void functor_t::lpm_mult(class Design*, class NetMult*) void functor_t::lpm_mult(Design*, NetMult*)
{ {
} }
void functor_t::lpm_mux(class Design*, class NetMux*) void functor_t::lpm_mux(Design*, NetMux*)
{ {
} }
void functor_t::lpm_pow(class Design*, class NetPow*) void functor_t::lpm_pow(Design*, NetPow*)
{ {
} }
void functor_t::sign_extend(class Design*, class NetSignExtend*) void functor_t::sign_extend(Design*, NetSignExtend*)
{ {
} }
void functor_t::lpm_ureduce(class Design*, class NetUReduce*) void functor_t::lpm_ureduce(Design*, NetUReduce*)
{ {
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999-2010 Stephen Williams (steve@icarus.com) * Copyright (c) 1999-2012 Stephen Williams (steve@icarus.com)
* *
* This source code is free software; you can redistribute it * This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU * and/or modify it in source code form under the terms of the GNU
@ -114,12 +114,12 @@ class synth_f : public functor_t {
public: public:
synth_f() { top_ = NULL; } synth_f() { top_ = NULL; }
void process(class Design*, class NetProcTop*); void process(Design*, NetProcTop*);
private: private:
void proc_always_(class Design*); void proc_always_(Design*);
void proc_initial_(class Design*); void proc_initial_(Design*);
void proc_final_(class Design*); void proc_final_(Design*);
NetProcTop*top_; NetProcTop*top_;
}; };
@ -129,7 +129,7 @@ class synth_f : public functor_t {
* Look at a process, and divide the problem into always and initial * Look at a process, and divide the problem into always and initial
* threads. * threads.
*/ */
void synth_f::process(class Design*des, class NetProcTop*top) void synth_f::process(Design*des, NetProcTop*top)
{ {
top_ = top; top_ = top;
switch (top->type()) { switch (top->type()) {
@ -145,19 +145,19 @@ void synth_f::process(class Design*des, class NetProcTop*top)
} }
} }
void synth_f::proc_always_(class Design*des) void synth_f::proc_always_(Design*des)
{ {
do_expr expr_pat(des, top_->scope()); do_expr expr_pat(des, top_->scope());
top_->statement()->match_proc(&expr_pat); top_->statement()->match_proc(&expr_pat);
} }
void synth_f::proc_initial_(class Design*des) void synth_f::proc_initial_(Design*des)
{ {
do_expr expr_pat(des, top_->scope()); do_expr expr_pat(des, top_->scope());
top_->statement()->match_proc(&expr_pat); top_->statement()->match_proc(&expr_pat);
} }
void synth_f::proc_final_(class Design*des) void synth_f::proc_final_(Design*des)
{ {
do_expr expr_pat(des, top_->scope()); do_expr expr_pat(des, top_->scope());
top_->statement()->match_proc(&expr_pat); top_->statement()->match_proc(&expr_pat);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002-2010 Stephen Williams (steve@icarus.com) * Copyright (c) 2002-2012 Stephen Williams (steve@icarus.com)
* *
* This source code is free software; you can redistribute it * This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU * and/or modify it in source code form under the terms of the GNU
@ -900,7 +900,7 @@ bool NetProcTop::synth_sync(Design*des)
class synth2_f : public functor_t { class synth2_f : public functor_t {
public: public:
void process(class Design*, class NetProcTop*); void process(Design*, NetProcTop*);
private: private:
}; };
@ -910,7 +910,7 @@ class synth2_f : public functor_t {
* Look at a process. If it is asynchronous, then synthesize it as an * Look at a process. If it is asynchronous, then synthesize it as an
* asynchronous process and delete the process itself for its gates. * asynchronous process and delete the process itself for its gates.
*/ */
void synth2_f::process(class Design*des, class NetProcTop*top) void synth2_f::process(Design*des, NetProcTop*top)
{ {
if (top->attribute(perm_string::literal("ivl_synthesis_off")).as_ulong() != 0) if (top->attribute(perm_string::literal("ivl_synthesis_off")).as_ulong() != 0)
return; return;

View File

@ -104,7 +104,7 @@ struct __vpiArray : public __vpiHandle {
vvp_realarray_t *valsr; vvp_realarray_t *valsr;
struct __vpiArrayWord*vals_words; struct __vpiArrayWord*vals_words;
class vvp_fun_arrayport*ports_; vvp_fun_arrayport*ports_;
struct __vpiCallback *vpi_callbacks; struct __vpiCallback *vpi_callbacks;
bool signed_flag; bool signed_flag;
bool swap_addr; bool swap_addr;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001-2011 Stephen Williams (steve@icarus.com) * Copyright (c) 2001-2012 Stephen Williams (steve@icarus.com)
* *
* This source code is free software; you can redistribute it * This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU * and/or modify it in source code form under the terms of the GNU
@ -342,14 +342,14 @@ vvp_net_t* vvp_net_lookup(const char*label)
* this call is its last chance. If it cannot complete the operation, * this call is its last chance. If it cannot complete the operation,
* it must print an error message and return false. * it must print an error message and return false.
*/ */
static class resolv_list_s*resolv_list = 0; static resolv_list_s*resolv_list = 0;
resolv_list_s::~resolv_list_s() resolv_list_s::~resolv_list_s()
{ {
free(label_); free(label_);
} }
void resolv_submit(class resolv_list_s*cur) void resolv_submit(resolv_list_s*cur)
{ {
if (cur->resolve()) { if (cur->resolve()) {
delete cur; delete cur;
@ -636,13 +636,13 @@ void compile_cleanup(void)
} }
do { do {
class resolv_list_s *res = resolv_list; resolv_list_s *res = resolv_list;
resolv_list = 0x0; resolv_list = 0x0;
last = nerrs == lnerrs; last = nerrs == lnerrs;
lnerrs = nerrs; lnerrs = nerrs;
nerrs = 0; nerrs = 0;
while (res) { while (res) {
class resolv_list_s *cur = res; resolv_list_s *cur = res;
res = res->next; res = res->next;
if (cur->resolve(last)) if (cur->resolve(last))
delete cur; delete cur;

View File

@ -71,7 +71,7 @@ bool evctl::dec_and_run()
return ecount_ == 0; return ecount_ == 0;
} }
evctl_real::evctl_real(class __vpiHandle*handle, double value, evctl_real::evctl_real(__vpiHandle*handle, double value,
unsigned long ecount) unsigned long ecount)
:evctl(ecount) :evctl(ecount)
{ {
@ -88,7 +88,7 @@ void evctl_real::run_run()
vpi_put_value(handle_, &val, 0, vpiNoDelay); vpi_put_value(handle_, &val, 0, vpiNoDelay);
} }
void schedule_evctl(class __vpiHandle*handle, double value, void schedule_evctl(__vpiHandle*handle, double value,
vvp_net_t*event, unsigned long ecount) vvp_net_t*event, unsigned long ecount)
{ {
// Get the functor we are going to wait on. // Get the functor we are going to wait on.
@ -655,7 +655,7 @@ void vvp_fun_event_or_aa::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit,
} }
} }
vvp_named_event::vvp_named_event(class __vpiHandle*h) vvp_named_event::vvp_named_event(__vpiHandle*h)
{ {
handle_ = h; handle_ = h;
} }
@ -664,7 +664,7 @@ vvp_named_event::~vvp_named_event()
{ {
} }
vvp_named_event_sa::vvp_named_event_sa(class __vpiHandle*h) vvp_named_event_sa::vvp_named_event_sa(__vpiHandle*h)
: vvp_named_event(h), threads_(0) : vvp_named_event(h), threads_(0)
{ {
} }
@ -693,7 +693,7 @@ void vvp_named_event_sa::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit,
obj->run_vpi_callbacks(); obj->run_vpi_callbacks();
} }
vvp_named_event_aa::vvp_named_event_aa(class __vpiHandle*h) vvp_named_event_aa::vvp_named_event_aa(__vpiHandle*h)
: vvp_named_event(h) : vvp_named_event(h)
{ {
context_idx_ = vpip_add_item_to_context(this, vpip_peek_context_scope()); context_idx_ = vpip_add_item_to_context(this, vpip_peek_context_scope());
@ -853,9 +853,9 @@ void compile_named_event(char*label, char*name)
} }
#ifdef CHECK_WITH_VALGRIND #ifdef CHECK_WITH_VALGRIND
void named_event_delete(class __vpiHandle*handle) void named_event_delete(__vpiHandle*handle)
{ {
struct __vpiNamedEvent *obj = (struct __vpiNamedEvent *) handle; __vpiNamedEvent *obj = (__vpiNamedEvent *) handle;
while (obj->callbacks) { while (obj->callbacks) {
struct __vpiCallback*tmp = obj->callbacks->next; struct __vpiCallback*tmp = obj->callbacks->next;

View File

@ -74,7 +74,7 @@ void sfunc_core::recv_vec4_from_inputs(unsigned port)
void sfunc_core::recv_real_from_inputs(unsigned port) void sfunc_core::recv_real_from_inputs(unsigned port)
{ {
vpiHandle vpi = argv_[port]; vpiHandle vpi = argv_[port];
class __vpiRealConst*obj = dynamic_cast<__vpiRealConst*>(vpi); __vpiRealConst*obj = dynamic_cast<__vpiRealConst*>(vpi);
assert(obj); assert(obj);
obj->value = value_r(port); obj->value = value_r(port);

View File

@ -74,7 +74,7 @@ static bool interact_flag = true;
static void cmd_call(unsigned argc, char*argv[]) static void cmd_call(unsigned argc, char*argv[])
{ {
class __vpiHandle**table; __vpiHandle**table;
unsigned ntable; unsigned ntable;
if (stop_current_scope == 0) { if (stop_current_scope == 0) {
@ -212,7 +212,7 @@ static void cmd_help(unsigned, char*[]);
static void cmd_list(unsigned, char*[]) static void cmd_list(unsigned, char*[])
{ {
class __vpiHandle**table; __vpiHandle**table;
unsigned ntable; unsigned ntable;
if (stop_current_scope == 0) { if (stop_current_scope == 0) {
@ -314,7 +314,7 @@ static void cmd_push(unsigned argc, char* argv[])
{ {
for (unsigned idx = 1 ; idx < argc ; idx += 1) { for (unsigned idx = 1 ; idx < argc ; idx += 1) {
class __vpiHandle**table; __vpiHandle**table;
unsigned ntable; unsigned ntable;
struct __vpiScope*child = 0; struct __vpiScope*child = 0;

View File

@ -49,8 +49,10 @@
* event. This member is only used for things like cbReadOnlySync. * event. This member is only used for things like cbReadOnlySync.
*/ */
class sync_callback;
struct sync_cb : public vvp_gen_event_s { struct sync_cb : public vvp_gen_event_s {
class sync_callback*handle; sync_callback*handle;
bool sync_flag; bool sync_flag;
~sync_cb () { } ~sync_cb () { }
@ -244,7 +246,7 @@ static value_callback* make_value_change(p_cb_data data)
break; break;
case vpiNamedEvent: case vpiNamedEvent:
struct __vpiNamedEvent*nev; __vpiNamedEvent*nev;
nev = dynamic_cast<__vpiNamedEvent*>(data->obj); nev = dynamic_cast<__vpiNamedEvent*>(data->obj);
nev->add_vpi_callback(obj); nev->add_vpi_callback(obj);
break; break;

View File

@ -240,7 +240,7 @@ __vpiHandle::free_object_fun_t __vpiStringConstTEMP::free_object_fun(void)
vpiHandle vpip_make_string_const(char*text, bool persistent_flag) vpiHandle vpip_make_string_const(char*text, bool persistent_flag)
{ {
class __vpiStringConst*obj; __vpiStringConst*obj;
obj = persistent_flag? new __vpiStringConst(text) : new __vpiStringConstTEMP(text); obj = persistent_flag? new __vpiStringConst(text) : new __vpiStringConstTEMP(text);
@ -314,7 +314,7 @@ vpiHandle __vpiStringParam::vpi_handle(int code)
vpiHandle vpip_make_string_param(char*name, char*text, vpiHandle vpip_make_string_param(char*name, char*text,
long file_idx, long lineno) long file_idx, long lineno)
{ {
class __vpiStringParam*obj = new __vpiStringParam(text, name); __vpiStringParam*obj = new __vpiStringParam(text, name);
obj->scope = vpip_peek_current_scope(); obj->scope = vpip_peek_current_scope();
obj->file_idx = (unsigned) file_idx; obj->file_idx = (unsigned) file_idx;
obj->lineno = (unsigned) lineno; obj->lineno = (unsigned) lineno;
@ -649,7 +649,7 @@ void __vpiRealConst::vpi_get_value(p_vpi_value val)
vpiHandle vpip_make_real_const(double value) vpiHandle vpip_make_real_const(double value)
{ {
class __vpiRealConst*obj = new __vpiRealConst(value); __vpiRealConst*obj = new __vpiRealConst(value);
return obj; return obj;
} }

View File

@ -71,7 +71,7 @@ vpiHandle __vpiNamedEvent::vpi_handle(int code)
vpiHandle vpip_make_named_event(const char*name, vvp_net_t*funct) vpiHandle vpip_make_named_event(const char*name, vvp_net_t*funct)
{ {
struct __vpiNamedEvent*obj = new __vpiNamedEvent(vpip_peek_current_scope(), name); __vpiNamedEvent*obj = new __vpiNamedEvent(vpip_peek_current_scope(), name);
obj->funct = funct; obj->funct = funct;

View File

@ -41,7 +41,7 @@ vpiHandle vpip_make_root_iterator(void)
vpip_root_table_ptr, false); vpip_root_table_ptr, false);
} }
void vpip_make_root_iterator(class __vpiHandle**&table, unsigned&ntable) void vpip_make_root_iterator(__vpiHandle**&table, unsigned&ntable)
{ {
table = vpip_root_table_ptr; table = vpip_root_table_ptr;
ntable = vpip_root_table_cnt; ntable = vpip_root_table_cnt;

View File

@ -733,7 +733,7 @@ static void cleanup_vpi_call_args(unsigned argc, vpiHandle*argv)
* vbit is also a non-zero value, the address in thread space of the result. * vbit is also a non-zero value, the address in thread space of the result.
*/ */
vpiHandle vpip_build_vpi_call(const char*name, unsigned vbit, int vwid, vpiHandle vpip_build_vpi_call(const char*name, unsigned vbit, int vwid,
class vvp_net_t*fnet, vvp_net_t*fnet,
bool func_as_task_err, bool func_as_task_warn, bool func_as_task_err, bool func_as_task_warn,
unsigned argc, vpiHandle*argv, unsigned argc, vpiHandle*argv,
long file_idx, long lineno) long file_idx, long lineno)

View File

@ -1173,7 +1173,7 @@ bool of_ASSIGN_WR(vthread_t thr, vvp_code_t cp)
del.type = vpiSimTime; del.type = vpiSimTime;
vpip_time_to_timestruct(&del, delay); vpip_time_to_timestruct(&del, delay);
class __vpiHandle*tmp = cp->handle; __vpiHandle*tmp = cp->handle;
t_vpi_value val; t_vpi_value val;
val.format = vpiRealVal; val.format = vpiRealVal;
@ -1192,7 +1192,7 @@ bool of_ASSIGN_WRD(vthread_t thr, vvp_code_t cp)
del.type = vpiSimTime; del.type = vpiSimTime;
vpip_time_to_timestruct(&del, delay); vpip_time_to_timestruct(&del, delay);
class __vpiHandle*tmp = cp->handle; __vpiHandle*tmp = cp->handle;
t_vpi_value val; t_vpi_value val;
val.format = vpiRealVal; val.format = vpiRealVal;
@ -1206,7 +1206,7 @@ bool of_ASSIGN_WRE(vthread_t thr, vvp_code_t cp)
{ {
assert(thr->event != 0); assert(thr->event != 0);
unsigned index = cp->bit_idx[0]; unsigned index = cp->bit_idx[0];
class __vpiHandle*tmp = cp->handle; __vpiHandle*tmp = cp->handle;
// If the count is zero then just put the value. // If the count is zero then just put the value.
if (thr->ecount == 0) { if (thr->ecount == 0) {
@ -3184,7 +3184,7 @@ bool of_LOAD_VP0_S(vthread_t thr, vvp_code_t cp)
bool of_LOAD_WR(vthread_t thr, vvp_code_t cp) bool of_LOAD_WR(vthread_t thr, vvp_code_t cp)
{ {
class __vpiHandle*tmp = cp->handle; __vpiHandle*tmp = cp->handle;
t_vpi_value val; t_vpi_value val;
val.format = vpiRealVal; val.format = vpiRealVal;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2004-2011 Stephen Williams (steve@icarus.com) * Copyright (c) 2004-2012 Stephen Williams (steve@icarus.com)
* *
* This source code is free software; you can redistribute it * This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU * and/or modify it in source code form under the terms of the GNU
@ -449,7 +449,7 @@ int edge(vvp_bit4_t from, vvp_bit4_t to)
void vvp_send_vec8(vvp_net_ptr_t ptr, const vvp_vector8_t&val) void vvp_send_vec8(vvp_net_ptr_t ptr, const vvp_vector8_t&val)
{ {
while (class vvp_net_t*cur = ptr.ptr()) { while (vvp_net_t*cur = ptr.ptr()) {
vvp_net_ptr_t next = cur->port[ptr.port()]; vvp_net_ptr_t next = cur->port[ptr.port()];
if (cur->fun) if (cur->fun)
@ -461,7 +461,7 @@ void vvp_send_vec8(vvp_net_ptr_t ptr, const vvp_vector8_t&val)
void vvp_send_real(vvp_net_ptr_t ptr, double val, vvp_context_t context) void vvp_send_real(vvp_net_ptr_t ptr, double val, vvp_context_t context)
{ {
while (class vvp_net_t*cur = ptr.ptr()) { while (vvp_net_t*cur = ptr.ptr()) {
vvp_net_ptr_t next = cur->port[ptr.port()]; vvp_net_ptr_t next = cur->port[ptr.port()];
if (cur->fun) if (cur->fun)
@ -473,7 +473,7 @@ void vvp_send_real(vvp_net_ptr_t ptr, double val, vvp_context_t context)
void vvp_send_long(vvp_net_ptr_t ptr, long val) void vvp_send_long(vvp_net_ptr_t ptr, long val)
{ {
while (class vvp_net_t*cur = ptr.ptr()) { while (vvp_net_t*cur = ptr.ptr()) {
vvp_net_ptr_t next = cur->port[ptr.port()]; vvp_net_ptr_t next = cur->port[ptr.port()];
if (cur->fun) if (cur->fun)
@ -486,7 +486,7 @@ void vvp_send_long(vvp_net_ptr_t ptr, long val)
void vvp_send_long_pv(vvp_net_ptr_t ptr, long val, void vvp_send_long_pv(vvp_net_ptr_t ptr, long val,
unsigned base, unsigned wid) unsigned base, unsigned wid)
{ {
while (class vvp_net_t*cur = ptr.ptr()) { while (vvp_net_t*cur = ptr.ptr()) {
vvp_net_ptr_t next = cur->port[ptr.port()]; vvp_net_ptr_t next = cur->port[ptr.port()];
if (cur->fun) if (cur->fun)