Fix implicit fallthrough warnings when building with recent GCC.

(cherry picked from commit f1608e163f)
This commit is contained in:
Martin Whitaker
2018-10-08 22:09:50 +01:00
parent 10fc8048ac
commit de63c0cedb
29 changed files with 69 additions and 31 deletions
+2 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003-2013 Stephen Williams ([email protected])
* Copyright (c) 2003-2018 Stephen Williams ([email protected])
*
* 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;
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2014 Stephen Williams ([email protected])
* Copyright (c) 2001-2018 Stephen Williams ([email protected])
*
* 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_);
+5 -4
View File
@@ -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());
+2 -1
View File
@@ -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;
+1
View File
@@ -475,6 +475,7 @@ vpiHandle sysfunc_4net::vpi_put_value(p_vpi_value vp, int)
(int)vp->value.scalar);
assert(0);
}
break;
}
case vpiIntVal: {
+2 -1
View File
@@ -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;
+3
View File
@@ -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;
+1
View File
@@ -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;
+2 -1
View File
@@ -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;
+1 -1
View File
@@ -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)