diff --git a/vpi/cppcheck.sup b/vpi/cppcheck.sup index 8bf16a13f..e3e22538e 100644 --- a/vpi/cppcheck.sup +++ b/vpi/cppcheck.sup @@ -4,6 +4,7 @@ // fstapi.c from GTKWave obsoleteFunctionsasctime:fstapi.c:652 +unreadVariable:fstapi.c:1297 variableScope:fstapi.c:751 variableScope:fstapi.c:1707 variableScope:fstapi.c:1965 diff --git a/vvp/symbols.h b/vvp/symbols.h index 8d6b205b6..b26c58b6a 100644 --- a/vvp/symbols.h +++ b/vvp/symbols.h @@ -1,7 +1,7 @@ #ifndef __symbols_H #define __symbols_H /* - * Copyright (c) 2001-2008 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2013 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 @@ -69,6 +69,7 @@ class symbol_table_s { symbol_value_t sym_get_value(const char*key); private: + symbol_table_s(const symbol_table_s&) { assert(0); }; struct tree_node_*root; struct key_strings*str_chunk; unsigned str_used; diff --git a/vvp/vpi_priv.cc b/vvp/vpi_priv.cc index 0c760de53..9c6645e31 100644 --- a/vvp/vpi_priv.cc +++ b/vvp/vpi_priv.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2012 Stephen Williams (steve@icarus.com) + * Copyright (c) 2008-2013 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 @@ -1009,7 +1009,7 @@ void vpip_put_value_event::run_run() static t_vpi_time *timedup(t_vpi_time *val) { t_vpi_time *rtn; - rtn = (t_vpi_time *) malloc(sizeof(t_vpi_time)); + rtn = static_cast (malloc(sizeof(t_vpi_time))); *rtn = *val; return rtn; } @@ -1021,7 +1021,7 @@ static t_vpi_vecval *vectordup(t_vpi_vecval *val, PLI_INT32 size) t_vpi_vecval *rtn; assert(size > 0); num_bytes = ((size + 31)/32)*sizeof(t_vpi_vecval); - rtn = (t_vpi_vecval *) malloc(num_bytes); + rtn = static_cast (malloc(num_bytes)); memcpy(rtn, val, num_bytes); return rtn; } @@ -1030,7 +1030,8 @@ static t_vpi_vecval *vectordup(t_vpi_vecval *val, PLI_INT32 size) static t_vpi_strengthval *strengthdup(t_vpi_strengthval *val) { t_vpi_strengthval *rtn; - rtn = (t_vpi_strengthval *) malloc(sizeof(t_vpi_strengthval)); + rtn = static_cast + (malloc(sizeof(t_vpi_strengthval))); *rtn = *val; return rtn; } diff --git a/vvp/vpi_scope.cc b/vvp/vpi_scope.cc index 94038f9b3..af27a4feb 100644 --- a/vvp/vpi_scope.cc +++ b/vvp/vpi_scope.cc @@ -54,7 +54,8 @@ void port_delete(__vpiHandle*handle); static void delete_sub_scopes(struct __vpiScope *scope) { for (unsigned idx = 0; idx < scope->nintern; idx += 1) { - struct __vpiScope*lscope = (__vpiScope*)(scope->intern)[idx]; + struct __vpiScope*lscope = static_cast<__vpiScope*> + ((scope->intern)[idx]); switch(scope->intern[idx]->get_type_code()) { case vpiFunction: case vpiTask: @@ -128,7 +129,8 @@ static void delete_sub_scopes(struct __vpiScope *scope) void root_table_delete(void) { for (unsigned idx = 0; idx < vpip_root_table_cnt; idx += 1) { - struct __vpiScope *scope = (__vpiScope *)vpip_root_table_ptr[idx]; + struct __vpiScope *scope = static_cast<__vpiScope *> + (vpip_root_table_ptr[idx]); delete_sub_scopes(scope); vthreads_delete(scope); delete scope; diff --git a/vvp/vpi_signal.cc b/vvp/vpi_signal.cc index fc43da193..1590a96ff 100644 --- a/vvp/vpi_signal.cc +++ b/vvp/vpi_signal.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2012 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2013 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 @@ -1054,7 +1054,7 @@ void __vpiSignal::operator delete(void*) #ifdef CHECK_WITH_VALGRIND void signal_delete(vpiHandle item) { - struct __vpiSignal *obj = (__vpiSignal *) item; + struct __vpiSignal *obj = static_cast<__vpiSignal *> (item); assert(obj->node->fil); obj->node->fil->clear_all_callbacks(); vvp_net_delete(obj->node); diff --git a/vvp/vvp_net_sig.cc b/vvp/vvp_net_sig.cc index 2b55f1169..b82d4ea0e 100644 --- a/vvp/vvp_net_sig.cc +++ b/vvp/vvp_net_sig.cc @@ -594,9 +594,9 @@ vvp_fun_signal_string_sa::vvp_fun_signal_string_sa() } #ifdef CHECK_WITH_VALGRIND -void vvp_fun_signal_string_aa::free_instance(vvp_context_t context) +void vvp_fun_signal_string_aa::free_instance(vvp_context_t) { -// Never knew how to do this! + assert(0); } #endif