diff --git a/vvp/event.h b/vvp/event.h index e6cbef126..9833f8a57 100644 --- a/vvp/event.h +++ b/vvp/event.h @@ -1,7 +1,7 @@ #ifndef __event_H #define __event_H /* - * Copyright (c) 2004-2009 Stephen Williams (steve@icarus.com) + * Copyright (c) 2004-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 @@ -122,6 +122,7 @@ struct waitable_hooks_s { public: waitable_hooks_s() : event_ctls(0) { last = &event_ctls; } + virtual ~waitable_hooks_s() {} virtual vthread_t add_waiting_thread(vthread_t thread) = 0; @@ -138,7 +139,7 @@ struct waitable_hooks_s { * needed is the list of threads waiting on that instance. */ struct waitable_state_s { - waitable_state_s() : threads(0) { } + waitable_state_s() : threads(0) {} vthread_t threads; }; diff --git a/vvp/ufunc.cc b/vvp/ufunc.cc index 5a3527ac7..2613859c2 100644 --- a/vvp/ufunc.cc +++ b/vvp/ufunc.cc @@ -52,7 +52,10 @@ ufunc_core::ufunc_core(unsigned owid, vvp_net_t*ptr, functor_ref_lookup(&result_, result_label); - compile_vpi_lookup((vpiHandle*)(&func_scope_), scope_label); + /* A __vpiScope starts with a __vpiHandle structure so this is + a safe cast. We need the (void*) to avoid a dereferenced + type punned pointer warning from some gcc compilers. */ + compile_vpi_lookup((vpiHandle*)(void*)(&func_scope_), scope_label); } ufunc_core::~ufunc_core() diff --git a/vvp/vpi_scope.cc b/vvp/vpi_scope.cc index cfd19b1a6..01d78226c 100644 --- a/vvp/vpi_scope.cc +++ b/vvp/vpi_scope.cc @@ -484,7 +484,10 @@ compile_scope_decl(char*label, char*type, char*name, char*tname, void compile_scope_recall(char*symbol) { - compile_vpi_lookup((vpiHandle*)¤t_scope, symbol); + /* A __vpiScope starts with a __vpiHandle structure so this is + a safe cast. We need the (void*) to avoid a dereferenced + type punned pointer warning from some gcc compilers. */ + compile_vpi_lookup((vpiHandle*)(void*)¤t_scope, symbol); assert(current_scope); }