From de63c0cedb9cf6719b4f6a55a32c655a871020cb Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 6 Oct 2018 20:13:31 +0100 Subject: [PATCH] Fix implicit fallthrough warnings when building with recent GCC. (cherry picked from commit f1608e163f664cf5900e09959609395a58f4ca97) --- elab_expr.cc | 1 + eval_tree.cc | 5 +++++ expr_synth.cc | 4 +++- main.cc | 6 ++++++ t-dll-api.cc | 3 ++- t-dll.cc | 3 ++- tgt-vhdl/stmt.cc | 4 +++- tgt-vlog95/expr.c | 4 +++- tgt-vlog95/logic_lpm.c | 10 +++++----- vpi/sys_countdrivers.c | 3 ++- vpi/sys_display.c | 2 +- vpi/sys_fileio.c | 4 ++-- vpi/sys_lxt.c | 3 ++- vpi/sys_lxt2.c | 3 ++- vpi/sys_queue.c | 3 ++- vpi/sys_readmem.c | 4 +++- vpi/sys_scanf.c | 3 ++- vpi/v2009_enum.c | 1 + vvp/stop.cc | 3 ++- vvp/vpi_callback.cc | 2 +- vvp/vpi_const.cc | 4 ++-- vvp/vpi_priv.cc | 9 +++++---- vvp/vpi_signal.cc | 3 ++- vvp/vpi_tasks.cc | 1 + vvp/vpi_time.cc | 3 ++- vvp/vpi_vthr_vector.cc | 3 +++ vvp/vpip_bin.cc | 1 + vvp/vpip_hex.cc | 3 ++- vvp/vpip_oct.cc | 2 +- 29 files changed, 69 insertions(+), 31 deletions(-) diff --git a/elab_expr.cc b/elab_expr.cc index 14038e0f3..55f11058c 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -2753,6 +2753,7 @@ NetExpr* PEConcat::elaborate_expr(Design*, NetScope*, tmp->set_line(*this); return tmp; } + // fallthrough default: cerr << get_fileline() << ": internal error: " << "I don't know how to elaborate(ivl_type_t)" diff --git a/eval_tree.cc b/eval_tree.cc index f3391c828..f98aa1ad4 100644 --- a/eval_tree.cc +++ b/eval_tree.cc @@ -1102,6 +1102,7 @@ NetEConst* NetEBShift::eval_arguments_(const NetExpr*l, const NetExpr*r) const break; case 'r': lv.has_sign(false); + // fallthrough case 'R': val = cast_to_width(lv >> shift, wid); break; @@ -1553,6 +1554,7 @@ NetEConst* NetEUReduce::eval_arguments_(const NetExpr*ex) const case 'A': invert = true; + // fallthrough case '&': { res = verinum::V1; for (unsigned idx = 0 ; idx < val.len() ; idx += 1) @@ -1562,6 +1564,7 @@ NetEConst* NetEUReduce::eval_arguments_(const NetExpr*ex) const case 'N': invert = true; + // fallthrough case '|': { res = verinum::V0; for (unsigned idx = 0 ; idx < val.len() ; idx += 1) @@ -1571,6 +1574,7 @@ NetEConst* NetEUReduce::eval_arguments_(const NetExpr*ex) const case 'X': invert = true; + // fallthrough case '^': { /* Reduction XOR. */ unsigned ones = 0, unknown = 0; @@ -1622,6 +1626,7 @@ NetExpr* NetECast::eval_arguments_(const NetExpr*ex) const res_val = cast_to_width(res_val, expr_width()); res = new NetEConst(res_val); } + // fallthrough case 'v': if (const NetECReal*val = dynamic_cast(ex)) { verinum res_val(val->value().as_double(), false); diff --git a/expr_synth.cc b/expr_synth.cc index b1a2a8165..6458eeddd 100644 --- a/expr_synth.cc +++ b/expr_synth.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2015 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2018 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 @@ -335,6 +335,7 @@ NetNet* NetEBComp::synthesize(Design*des, NetScope*scope, NetExpr*root) des->errors += 1; return 0; } + // fallthrough case 'e': // == connect(dev->pin_AEB(), osig->pin(0)); break; @@ -353,6 +354,7 @@ NetNet* NetEBComp::synthesize(Design*des, NetScope*scope, NetExpr*root) des->errors += 1; return 0; } + // fallthrough case 'n': // != connect(dev->pin_ANEB(), osig->pin(0)); break; diff --git a/main.cc b/main.cc index 30da7bacd..fb63d939d 100644 --- a/main.cc +++ b/main.cc @@ -933,16 +933,22 @@ int main(int argc, char*argv[]) switch (generation_flag) { case GN_VER2012: lexor_keyword_mask |= GN_KEYWORDS_1800_2012; + // fallthrough case GN_VER2009: lexor_keyword_mask |= GN_KEYWORDS_1800_2009; + // fallthrough case GN_VER2005_SV: lexor_keyword_mask |= GN_KEYWORDS_1800_2005; + // fallthrough case GN_VER2005: lexor_keyword_mask |= GN_KEYWORDS_1364_2005; + // fallthrough case GN_VER2001: lexor_keyword_mask |= GN_KEYWORDS_1364_2001_CONFIG; + // fallthrough case GN_VER2001_NOCONFIG: lexor_keyword_mask |= GN_KEYWORDS_1364_2001; + // fallthrough case GN_VER1995: lexor_keyword_mask |= GN_KEYWORDS_1364_1995; } diff --git a/t-dll-api.cc b/t-dll-api.cc index 79bc73a2b..dba4f468d 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2015 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2018 Stephen Williams (steve@icarus.com) * Copyright CERN 2013 / Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it @@ -1457,6 +1457,7 @@ extern "C" unsigned ivl_lpm_selects(ivl_lpm_t net) case IVL_LPM_CONCATZ: cerr << "error: ivl_lpm_selects() is no longer supported for " "IVL_LPM_CONCAT, use ivl_lpm_size() instead." << endl; + // fallthrough default: assert(0); return 0; diff --git a/t-dll.cc b/t-dll.cc index 47ed90aaa..6245e69f7 100644 --- a/t-dll.cc +++ b/t-dll.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2015 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2018 Stephen Williams (steve@icarus.com) * Copyright CERN 2013 / Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it @@ -2489,6 +2489,7 @@ void dll_target::scope(const NetScope*net) case NetScope::PACKAGE: cerr << "?:?" << ": internal error: " << "Package scopes should not have parents." << endl; + // fallthrough case NetScope::MODULE: scop->type_ = IVL_SCT_MODULE; scop->tname_ = net->module_name(); diff --git a/tgt-vhdl/stmt.cc b/tgt-vhdl/stmt.cc index 0da0d5e0b..6de800dec 100644 --- a/tgt-vhdl/stmt.cc +++ b/tgt-vhdl/stmt.cc @@ -1,7 +1,7 @@ /* * VHDL code generation for statements. * - * Copyright (C) 2008-2013 Nick Gasson (nick@nickg.me.uk) + * Copyright (C) 2008-2018 Nick Gasson (nick@nickg.me.uk) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -683,8 +683,10 @@ static void get_nexuses_from_expr(ivl_expr_t expr, set &out) break; case IVL_EX_TERNARY: get_nexuses_from_expr(ivl_expr_oper3(expr), out); + // fallthrough case IVL_EX_BINARY: get_nexuses_from_expr(ivl_expr_oper2(expr), out); + // fallthrough case IVL_EX_UNARY: get_nexuses_from_expr(ivl_expr_oper1(expr), out); break; diff --git a/tgt-vlog95/expr.c b/tgt-vlog95/expr.c index f516a7a9e..cf76e6071 100644 --- a/tgt-vlog95/expr.c +++ b/tgt-vlog95/expr.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2014 Cary R. (cygcary@yahoo.com) + * Copyright (C) 2011-2018 Cary R. (cygcary@yahoo.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -447,6 +447,7 @@ static void emit_expr_binary(ivl_scope_t scope, ivl_expr_t expr, unsigned wid, ivl_expr_file(expr), ivl_expr_lineno(expr)); vlog_errors += 1; } + //fallthrough case '+': case '-': case '*': @@ -492,6 +493,7 @@ static void emit_expr_binary(ivl_scope_t scope, ivl_expr_t expr, unsigned wid, ivl_expr_file(expr), ivl_expr_lineno(expr)); vlog_errors += 1; } + // fallthrough case 'l': case 'r': emit_expr(scope, oper1, wid, 0, 0, 0); diff --git a/tgt-vlog95/logic_lpm.c b/tgt-vlog95/logic_lpm.c index 07f46780e..a7359feb0 100644 --- a/tgt-vlog95/logic_lpm.c +++ b/tgt-vlog95/logic_lpm.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2015 Cary R. (cygcary@yahoo.com) + * Copyright (C) 2011-2018 Cary R. (cygcary@yahoo.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1055,6 +1055,7 @@ static void emit_lpm_as_ca(ivl_scope_t scope, ivl_lpm_t lpm, "should not be generated.\n", ivl_lpm_file(lpm), ivl_lpm_lineno(lpm)); vlog_errors += 1; + // fallthrough case IVL_LPM_CONCAT: emit_lpm_concat(scope, lpm); break; @@ -2167,10 +2168,9 @@ void dump_nexus_information(ivl_scope_t scope, ivl_nexus_t nex) case IVL_VT_BOOL: fprintf(stderr, " bool"); break; case IVL_VT_LOGIC: fprintf(stderr, " logic"); break; case IVL_VT_STRING: fprintf(stderr, " string"); break; - case IVL_VT_DARRAY: fprintf(stderr, " dynamic array"); - case IVL_VT_CLASS: fprintf(stderr, " class"); - case IVL_VT_QUEUE: fprintf(stderr, " queue"); - break; + case IVL_VT_DARRAY: fprintf(stderr, " dynamic array"); break; + case IVL_VT_CLASS: fprintf(stderr, " class"); break; + case IVL_VT_QUEUE: fprintf(stderr, " queue"); break; } if (ivl_signal_signed(sig)) fprintf(stderr, " "); } else fprintf(stderr, "Error: No/missing information!"); diff --git a/vpi/sys_countdrivers.c b/vpi/sys_countdrivers.c index 3eedc431e..d4fbb8ea4 100644 --- a/vpi/sys_countdrivers.c +++ b/vpi/sys_countdrivers.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2014 Martin Whitaker. (icarus@martin-whitaker.me.uk) + * Copyright (C) 2012-2018 Martin Whitaker. (icarus@martin-whitaker.me.uk) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,6 +33,7 @@ static void check_net_arg(vpiHandle arg, vpiHandle callh, const char *name) case vpiPartSelect: if (vpi_get(vpiType, vpi_handle(vpiParent, arg)) != vpiNet) break; + // fallthrough case vpiNet: if (vpi_get(vpiSize, arg) != 1) break; diff --git a/vpi/sys_display.c b/vpi/sys_display.c index 6c2db71b0..55733b9f5 100644 --- a/vpi/sys_display.c +++ b/vpi/sys_display.c @@ -1138,7 +1138,7 @@ static int sys_check_args(vpiHandle callh, vpiHandle argv, const PLI_BYTE8*name, name, vpi_get_str(vpiType, arg)); ret = 1; } - + // fallthrough case vpiConstant: case vpiParameter: case vpiNet: diff --git a/vpi/sys_fileio.c b/vpi/sys_fileio.c index f63fd64e0..dbdecf5dc 100644 --- a/vpi/sys_fileio.c +++ b/vpi/sys_fileio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2013 Stephen Williams (steve@icarus.com) + * Copyright (c) 2003-2018 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 @@ -132,7 +132,7 @@ static PLI_INT32 sys_fopen_calltf(ICARUS_VPI_CONST PLI_BYTE8*name) } } if (! fail) break; - + // fallthrough default: vpi_printf("WARNING: %s:%d: ", vpi_get_str(vpiFile, callh), diff --git a/vpi/sys_lxt.c b/vpi/sys_lxt.c index a0f16fbfc..046d8fa37 100644 --- a/vpi/sys_lxt.c +++ b/vpi/sys_lxt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2015 Stephen Williams (steve@icarus.com) + * Copyright (c) 2002-2018 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 @@ -549,6 +549,7 @@ static void scan_item(unsigned depth, vpiHandle item, int skip) PLI_INT32 idx = vpi_get(vpiIndex, item); item = vpi_handle_by_index(array, idx); } + // fallthrough case vpiIntegerVar: case vpiBitVar: case vpiByteVar: diff --git a/vpi/sys_lxt2.c b/vpi/sys_lxt2.c index bf211019a..44528e87e 100644 --- a/vpi/sys_lxt2.c +++ b/vpi/sys_lxt2.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2015 Stephen Williams (steve@icarus.com) + * Copyright (c) 2003-2018 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 @@ -612,6 +612,7 @@ static void scan_item(unsigned depth, vpiHandle item, int skip) PLI_INT32 idx = vpi_get(vpiIndex, item); item = vpi_handle_by_index(array, idx); } + // fallthrough case vpiIntegerVar: case vpiBitVar: case vpiByteVar: diff --git a/vpi/sys_queue.c b/vpi/sys_queue.c index 3d34c7b4a..7eb7525c2 100644 --- a/vpi/sys_queue.c +++ b/vpi/sys_queue.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2014 Cary R. (cygcary@yahoo.com) + * Copyright (C) 2011-2018 Cary R. (cygcary@yahoo.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -781,6 +781,7 @@ static PLI_INT32 fill_variable_with_scaled_time(vpiHandle var, uint64_t c_time) switch (words) { default: val_ptr[1].aval = (c_time >> 32) & 0xffffffff; + // fallthrough case 1: val_ptr[0].aval = c_time & 0xffffffff; } diff --git a/vpi/sys_readmem.c b/vpi/sys_readmem.c index a670a6317..0922214cf 100644 --- a/vpi/sys_readmem.c +++ b/vpi/sys_readmem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2018 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 @@ -49,6 +49,7 @@ static void get_mem_params(vpiHandle argv, vpiHandle callh, const char *name, case vpiConstant: case vpiParameter: if (vpi_get(vpiConstType, *start_item) != vpiRealConst) break; + // fallthrough case vpiRealVar: vpi_printf("WARNING: %s:%d: ", vpi_get_str(vpiFile, callh), (int)vpi_get(vpiLineNo, callh)); @@ -67,6 +68,7 @@ static void get_mem_params(vpiHandle argv, vpiHandle callh, const char *name, if (vpi_get(vpiConstType, *stop_item) != vpiRealConst) { break; } + // fallthrough case vpiRealVar: vpi_printf("WARNING: %s:%d: ", vpi_get_str(vpiFile, callh), diff --git a/vpi/sys_scanf.c b/vpi/sys_scanf.c index de567eba6..4768a72e8 100644 --- a/vpi/sys_scanf.c +++ b/vpi/sys_scanf.c @@ -1258,6 +1258,7 @@ static int is_assignable_obj(vpiHandle obj) break; case vpiPartSelect: if (! is_assignable_obj(vpi_handle(vpiParent, obj))) break; + // fallthrough case vpiIntegerVar: case vpiBitVar: case vpiByteVar: @@ -1403,7 +1404,7 @@ static PLI_INT32 sys_sscanf_compiletf(ICARUS_VPI_CONST PLI_BYTE8 *name) case vpiConstant: case vpiParameter: if (vpi_get(vpiConstType, reg) == vpiStringConst) break; - + // fallthrough default: vpi_printf("ERROR: %s:%d: ", vpi_get_str(vpiFile, callh), (int)vpi_get(vpiLineNo, callh)); diff --git a/vpi/v2009_enum.c b/vpi/v2009_enum.c index a8983e28a..8c638ff22 100644 --- a/vpi/v2009_enum.c +++ b/vpi/v2009_enum.c @@ -108,6 +108,7 @@ static PLI_INT32 ivl_enum_method_next_prev_compiletf(ICARUS_VPI_CONST PLI_BYTE8* case vpiConstant: case vpiParameter: if (vpi_get(vpiConstType, arg_count) != vpiStringConst) break; + // fallthrough default: vpi_printf("%s:%d: compiler error: ", vpi_get_str(vpiFile, sys), diff --git a/vvp/stop.cc b/vvp/stop.cc index c76c89d39..e07730508 100644 --- a/vvp/stop.cc +++ b/vvp/stop.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2013 Stephen Williams (steve@icarus.com) + * Copyright (c) 2003-2018 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 @@ -373,6 +373,7 @@ static void cmd_trace(unsigned argc, char*argv[]) break; default: printf("Only using the first argument to trace.\n"); + // fallthrough case 2: if ((strcmp(argv[1], "on") == 0) || (strcmp(argv[1], "1") == 0)) { show_file_line = true; diff --git a/vvp/vpi_callback.cc b/vvp/vpi_callback.cc index 77d7bc4ae..762095318 100644 --- a/vvp/vpi_callback.cc +++ b/vvp/vpi_callback.cc @@ -796,7 +796,7 @@ static void real_signal_value(struct t_vpi_value*vp, double rval) switch (vp->format) { case vpiObjTypeVal: vp->format = vpiRealVal; - + // fallthrough case vpiRealVal: vp->value.real = rval; break; diff --git a/vvp/vpi_const.cc b/vvp/vpi_const.cc index 6cff523cc..82a70572b 100644 --- a/vvp/vpi_const.cc +++ b/vvp/vpi_const.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2018 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 @@ -129,7 +129,7 @@ void __vpiStringConst::vpi_get_value(p_vpi_value vp) case vpiObjTypeVal: /* String parameters by default have vpiStringVal values. */ vp->format = vpiStringVal; - + // fallthrough case vpiStringVal: rbuf = (char *) need_result_buf(size + 1, RBUF_VAL); strcpy(rbuf, value_); diff --git a/vvp/vpi_priv.cc b/vvp/vpi_priv.cc index ddb69acd4..5384d0efb 100644 --- a/vvp/vpi_priv.cc +++ b/vvp/vpi_priv.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2017 Stephen Williams (steve@icarus.com) + * Copyright (c) 2008-2018 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 @@ -724,7 +724,7 @@ void vpip_vec4_get_value(const vvp_vector4_t&word_val, unsigned width, case vpiObjTypeVal: // Use the following case to actually set the value! vp->format = vpiVectorVal; - + // fallthrough case vpiVectorVal: { unsigned hwid = (width + 31)/32; @@ -784,6 +784,7 @@ void vpip_vec2_get_value(const vvp_vector2_t&word_val, unsigned width, case vpiObjTypeVal: vp->format = vpiIntVal; + // fallthrough case vpiIntVal: vector2_to_value(word_val, vp->value.integer, signed_flag); break; @@ -862,7 +863,7 @@ void vpip_real_get_value(double real, s_vpi_value*vp) case vpiObjTypeVal: // Use the following case to actually set the value! vp->format = vpiRealVal; - + // fallthrough case vpiRealVal: vp->value.real = real; break; @@ -944,7 +945,7 @@ void vpip_string_get_value(const string&val, s_vpi_value*vp) case vpiObjTypeVal: // Use the following case to actually set the value! vp->format = vpiStringVal; - + // fallthrough case vpiStringVal: rbuf = (char *) need_result_buf(val.size() + 1, RBUF_VAL); strcpy(rbuf, val.c_str()); diff --git a/vvp/vpi_signal.cc b/vvp/vpi_signal.cc index 27965db4d..976b4b7bc 100644 --- a/vvp/vpi_signal.cc +++ b/vvp/vpi_signal.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2016 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2018 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 @@ -1200,6 +1200,7 @@ static int PV_get(int code, vpiHandle ref) case vpiLeftRange: rval += rfp->width - 1; + // fallthrough case vpiRightRange: rval += vpi_get(vpiRightRange, rfp->parent) + PV_get_base(rfp); return rval; diff --git a/vvp/vpi_tasks.cc b/vvp/vpi_tasks.cc index fad8f07d3..0a37be788 100644 --- a/vvp/vpi_tasks.cc +++ b/vvp/vpi_tasks.cc @@ -475,6 +475,7 @@ vpiHandle sysfunc_4net::vpi_put_value(p_vpi_value vp, int) (int)vp->value.scalar); assert(0); } + break; } case vpiIntVal: { diff --git a/vvp/vpi_time.cc b/vvp/vpi_time.cc index 215838773..f2ab4f810 100644 --- a/vvp/vpi_time.cc +++ b/vvp/vpi_time.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2018 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 @@ -131,6 +131,7 @@ static void timevar_get_value(vpiHandle ref, s_vpi_value*vp, bool is_int_func, case vpiObjTypeVal: /* The default format is vpiTimeVal. */ vp->format = vpiTimeVal; + // fallthrough case vpiTimeVal: vp->value.time = &time_value; vp->value.time->type = vpiSimTime; diff --git a/vvp/vpi_vthr_vector.cc b/vvp/vpi_vthr_vector.cc index 4b4c580de..ad426af9a 100644 --- a/vvp/vpi_vthr_vector.cc +++ b/vvp/vpi_vthr_vector.cc @@ -108,6 +108,7 @@ static void vthr_real_get_value(vpiHandle ref, s_vpi_value*vp) case vpiObjTypeVal: vp->format = vpiRealVal; + // fallthrough case vpiRealVal: vp->value.real = val; break; @@ -258,6 +259,7 @@ void __vpiVThrStrStack::vpi_get_value(p_vpi_value vp) case vpiObjTypeVal: vp->format = vpiStringVal; + // fallthrough case vpiStringVal: rbuf = (char *) need_result_buf(val.size()+1, RBUF_VAL); strcpy(rbuf, val.c_str()); @@ -376,6 +378,7 @@ void __vpiVThrVec4Stack::vpi_get_value(p_vpi_value vp) break; case vpiObjTypeVal: vp->format = vpiVectorVal; + // fallthrough case vpiVectorVal: vpi_get_value_vector_(vp, val); break; diff --git a/vvp/vpip_bin.cc b/vvp/vpip_bin.cc index 991d00982..7ecf07dca 100644 --- a/vvp/vpip_bin.cc +++ b/vvp/vpip_bin.cc @@ -100,6 +100,7 @@ void vpip_bin_str_to_vec4(vvp_vector4_t&vec4, const char*buf) pad = BIT4_1; break; } + // fallthrough default: // Everything else gets '0' padded/ pad = BIT4_0; break; diff --git a/vvp/vpip_hex.cc b/vvp/vpip_hex.cc index e49468fab..fc0bf79fa 100644 --- a/vvp/vpip_hex.cc +++ b/vvp/vpip_hex.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2013 Stephen Williams (steve@icarus.com) + * Copyright (c) 2002-2018 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 @@ -126,6 +126,7 @@ void vpip_hex_str_to_vec4(vvp_vector4_t&val, const char*str) pad = BIT4_1; break; } + // fallthrough default: // Everything else gets '0' padded. pad = BIT4_0; break; diff --git a/vvp/vpip_oct.cc b/vvp/vpip_oct.cc index a362a79d6..b60b0a85b 100644 --- a/vvp/vpip_oct.cc +++ b/vvp/vpip_oct.cc @@ -106,6 +106,7 @@ void vpip_oct_str_to_vec4(vvp_vector4_t&val, const char*str) pad = BIT4_1; break; } + // fallthrough default: // Everything else gets '0' padded. pad = BIT4_0; break; @@ -116,7 +117,6 @@ void vpip_oct_str_to_vec4(vvp_vector4_t&val, const char*str) if (idx < tval.size()) val.set_bit(idx, tval.value(idx)); else val.set_bit(idx, pad); } - } void vpip_vec4_to_oct_str(const vvp_vector4_t&bits, char*buf, unsigned nbuf)