From 15b1bfa709ca6a2277f77b24bcba1cf65dc45da3 Mon Sep 17 00:00:00 2001 From: Roman Nozdrin Date: Sun, 8 Nov 2020 14:57:28 +0000 Subject: [PATCH] Fix fallthrough compilation warnings --- dbcon/execplan/simplecolumn_decimal.h | 1 + dbcon/execplan/simplecolumn_uint.h | 1 + dbcon/execplan/windowfunctioncolumn.cpp | 1 + dbcon/joblist/batchprimitiveprocessor-jl.cpp | 3 ++- dbcon/joblist/columncommand-jl.cpp | 3 ++- dbcon/joblist/rowestimator.cpp | 4 ++-- primitives/linux-port/column.cpp | 6 +++--- utils/rowgroup/rowgroup.cpp | 4 +++- utils/windowfunction/wf_udaf.cpp | 11 +++++++---- utils/windowfunction/windowfunctiontype.cpp | 3 ++- writeengine/server/we_dmlcommandproc.cpp | 2 -- 11 files changed, 24 insertions(+), 15 deletions(-) diff --git a/dbcon/execplan/simplecolumn_decimal.h b/dbcon/execplan/simplecolumn_decimal.h index 7a5acbb56..a6fdac5e4 100644 --- a/dbcon/execplan/simplecolumn_decimal.h +++ b/dbcon/execplan/simplecolumn_decimal.h @@ -144,6 +144,7 @@ void SimpleColumn_Decimal::setNullVal() break; case 16: std::cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << std::endl; + //fallthrough default: fNullVal = joblist::BIGINTNULL; } diff --git a/dbcon/execplan/simplecolumn_uint.h b/dbcon/execplan/simplecolumn_uint.h index f8b8a5c96..edd811cba 100644 --- a/dbcon/execplan/simplecolumn_uint.h +++ b/dbcon/execplan/simplecolumn_uint.h @@ -144,6 +144,7 @@ void SimpleColumn_UINT::setNullVal() break; case 16: std::cout << __FILE__<< ":" <<__LINE__ << " Fix 16 Bytes ?" << std::endl; + //fallthrough default: fNullVal = joblist::UBIGINTNULL; } diff --git a/dbcon/execplan/windowfunctioncolumn.cpp b/dbcon/execplan/windowfunctioncolumn.cpp index c16c7b44b..ec6e32f16 100644 --- a/dbcon/execplan/windowfunctioncolumn.cpp +++ b/dbcon/execplan/windowfunctioncolumn.cpp @@ -491,6 +491,7 @@ void WindowFunctionColumn::evaluate(Row& row, bool& isNull) break; case 16: cout << __FILE__<< ":" <<__LINE__ << " Fix 16 Bytes ?" << endl; + //fallthrough default: if (row.equals(CPNULLSTRMARK, fInputIndex)) isNull = true; diff --git a/dbcon/joblist/batchprimitiveprocessor-jl.cpp b/dbcon/joblist/batchprimitiveprocessor-jl.cpp index 1f5707358..c989a52ed 100644 --- a/dbcon/joblist/batchprimitiveprocessor-jl.cpp +++ b/dbcon/joblist/batchprimitiveprocessor-jl.cpp @@ -681,7 +681,8 @@ void BatchPrimitiveProcessorJL::getTuples(messageqcpp::ByteStream& in, pos++; break; case 16: - cout << __FILE__<< ":" <<__LINE__ << " Fix 16 Bytes ?" << endl; + cout << __FILE__<< ":" <<__LINE__ << " Fix 16 Bytes ?" << endl; + //fallthrough default: cout << "BPP::getTuples(): bad column width of " << colWidths[j] << endl; diff --git a/dbcon/joblist/columncommand-jl.cpp b/dbcon/joblist/columncommand-jl.cpp index 66b3acb2e..63a57743c 100644 --- a/dbcon/joblist/columncommand-jl.cpp +++ b/dbcon/joblist/columncommand-jl.cpp @@ -270,7 +270,8 @@ uint8_t ColumnCommandJL::getTableColumnType() case 1: return TableColumn::UINT8; case 16: - cout << __FILE__<< ":" <<__LINE__ << " Fix 16 Bytes ?" << endl; + cout << __FILE__<< ":" <<__LINE__ << " Fix 16 Bytes ?" << endl; + //fallthrough default: throw logic_error("ColumnCommandJL: bad column width"); } diff --git a/dbcon/joblist/rowestimator.cpp b/dbcon/joblist/rowestimator.cpp index 95ae57140..78ef9c1bf 100644 --- a/dbcon/joblist/rowestimator.cpp +++ b/dbcon/joblist/rowestimator.cpp @@ -384,8 +384,8 @@ float RowEstimator::estimateRowReturnFactor(const BRM::EMEntry& emEntry, bigValue = static_cast(val); break; } - /* fall through */ } + // fallthrough case 8: default: @@ -430,8 +430,8 @@ float RowEstimator::estimateRowReturnFactor(const BRM::EMEntry& emEntry, bigValue = static_cast(val); break; } - /* fall through */ } + // fallthrough case 8: default: diff --git a/primitives/linux-port/column.cpp b/primitives/linux-port/column.cpp index a048d984e..72a0d747f 100644 --- a/primitives/linux-port/column.cpp +++ b/primitives/linux-port/column.cpp @@ -766,8 +766,8 @@ inline void store(const NewColRequestHeader* in, default: std::cout << __func__ << " WARNING!!! unspecified column width." << std::endl; - [[fallthrough]]; - + // fallthrough + case 8: ptr2 += (rid << 3); memcpy(ptr1, ptr2, 8); @@ -1840,7 +1840,7 @@ void PrimitiveProcessor::p_Col(NewColRequestHeader* in, NewColResultHeader* out, case 32: std::cout << __func__ << " WARNING!!! Not implemented for 32 byte data types." << std::endl; - [[fallthrough]]; + // fallthrough default: idbassert(0); diff --git a/utils/rowgroup/rowgroup.cpp b/utils/rowgroup/rowgroup.cpp index 5b460e27d..fbeb69ab7 100644 --- a/utils/rowgroup/rowgroup.cpp +++ b/utils/rowgroup/rowgroup.cpp @@ -648,7 +648,7 @@ string Row::toString() const os << buf << " "; break; } - // fallthrough if the legacy DECIMAL + //fallthrough default: os << getIntField(i) << " "; break; @@ -712,6 +712,7 @@ string Row::toCSV() const } case CalpontSystemCatalog::BINARY: std::cout << __FILE__<< __LINE__ << ":" << "toCSV"<< std::endl; + //fallthrough default: os << getIntField(i); @@ -1789,6 +1790,7 @@ void RowGroup::addToSysDataList(execplan::CalpontSystemCatalog::NJLSysDataList& case CalpontSystemCatalog::BINARY: std::cout << __FILE__<< __LINE__ << __func__<< std::endl; + //fallthrough default: cr->PutData(row.getIntField<8>(j)); } diff --git a/utils/windowfunction/wf_udaf.cpp b/utils/windowfunction/wf_udaf.cpp index b7e7881dd..b68173850 100644 --- a/utils/windowfunction/wf_udaf.cpp +++ b/utils/windowfunction/wf_udaf.cpp @@ -492,7 +492,8 @@ bool WF_udaf::dropValues(int64_t b, int64_t e) break; } case CalpontSystemCatalog::BINARY: - cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << endl; + cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << endl; + //fallthrough default: { string errStr = "(" + colType2String[(int)datum.dataType] + ")"; @@ -767,8 +768,9 @@ void WF_udaf::SetUDAFValue(static_any::any& valOut, int64_t colOut, setValue(colDataType, b, e, c, &strOut); } break; - case CalpontSystemCatalog::BINARY: - cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << endl; + case CalpontSystemCatalog::BINARY: + cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << endl; + //fallthrough default: { std::ostringstream errmsg; @@ -1149,7 +1151,8 @@ void WF_udaf::operator()(int64_t b, int64_t e, int64_t c) break; } case CalpontSystemCatalog::BINARY: - cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << endl; + cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << endl; + //fallthrough default: { string errStr = "(" + colType2String[(int)datum.dataType] + ")"; diff --git a/utils/windowfunction/windowfunctiontype.cpp b/utils/windowfunction/windowfunctiontype.cpp index d93b59683..d5bb92047 100644 --- a/utils/windowfunction/windowfunctiontype.cpp +++ b/utils/windowfunction/windowfunctiontype.cpp @@ -801,7 +801,8 @@ void* WindowFunctionType::getNullValueByType(int ct, int pos) v = &longDoubleNull; break; case CalpontSystemCatalog::BINARY: - cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << endl; + cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << endl; + //fallthrough case CalpontSystemCatalog::VARBINARY: default: std::ostringstream oss; diff --git a/writeengine/server/we_dmlcommandproc.cpp b/writeengine/server/we_dmlcommandproc.cpp index 56f8ebbc5..3eeed68fc 100644 --- a/writeengine/server/we_dmlcommandproc.cpp +++ b/writeengine/server/we_dmlcommandproc.cpp @@ -3006,7 +3006,6 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, break; } - [[fallthrough]]; } /* fall through */ @@ -3369,7 +3368,6 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, break; } - [[fallthrough]]; } /* fall through */