From 9613c269d25dd1443d1c7b088e2fce0608fa4b40 Mon Sep 17 00:00:00 2001 From: Cary R Date: Mon, 17 May 2010 09:16:10 -0700 Subject: [PATCH] Fix some unreachable code warnings. This patch fixes three unreachable code warnings reported by the Sun compiler. It also simplifies one of the files in the process. --- libveriuser/a_fetch_type.c | 11 ++++------- libveriuser/a_fetch_type_str.c | 9 +++------ tgt-vvp/vvp_process.c | 12 ++---------- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/libveriuser/a_fetch_type.c b/libveriuser/a_fetch_type.c index d5aa92a3d..2a61f7422 100644 --- a/libveriuser/a_fetch_type.c +++ b/libveriuser/a_fetch_type.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2009 Stephen Williams (steve@icarus.com) + * Copyright (c) 2003-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 @@ -56,14 +56,11 @@ PLI_INT32 acc_fetch_type(handle obj) case vpiModule: return accModule; - - default: - vpi_printf("acc_fetch_type: vpiType %d is what accType?\n", - (int)vpi_get(vpiType, obj)); - return accUnknown; } - return 0; + vpi_printf("acc_fetch_type: vpiType %d is what accType?\n", + (int)vpi_get(vpiType, obj)); + return accUnknown; } PLI_INT32 acc_fetch_fulltype(handle obj) diff --git a/libveriuser/a_fetch_type_str.c b/libveriuser/a_fetch_type_str.c index 7dcc6144e..6b8b5464b 100644 --- a/libveriuser/a_fetch_type_str.c +++ b/libveriuser/a_fetch_type_str.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2009 Stephen Williams (steve@icarus.com) + * Copyright (c) 2003-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,11 +36,8 @@ char* acc_fetch_type_str(PLI_INT32 type) case accConstant: return "accConstant"; - - default: - vpi_printf("XXXX acc_fetch_type_str(%d);\n", (int)type); - return "acc_fetch_type_str(unknown)"; } - return ""; + vpi_printf("acc_fetch_type_str: type %d is what accType?\n", (int)type); + return "acc_fetch_type_str(unknown)"; } diff --git a/tgt-vvp/vvp_process.c b/tgt-vvp/vvp_process.c index d23336ef8..6d418e11a 100644 --- a/tgt-vvp/vvp_process.c +++ b/tgt-vvp/vvp_process.c @@ -643,19 +643,11 @@ static int show_stmt_assign(ivl_statement_t net) lval = ivl_stmt_lval(net, 0); sig = ivl_lval_sig(lval); - if (sig) switch (ivl_signal_data_type(sig)) { - - case IVL_VT_REAL: + if (sig && (ivl_signal_data_type(sig) == IVL_VT_REAL)) { return show_stmt_assign_sig_real(net); - - default: - return show_stmt_assign_vector(net); - - } else { - return show_stmt_assign_vector(net); } - return 0; + return show_stmt_assign_vector(net); } /*