diff options
50 files changed, 92 insertions, 68 deletions
diff --git a/basegfx/source/matrix/b3dhommatrix.cxx b/basegfx/source/matrix/b3dhommatrix.cxx index 6e496d1298aa..923387524c92 100644 --- a/basegfx/source/matrix/b3dhommatrix.cxx +++ b/basegfx/source/matrix/b3dhommatrix.cxx @@ -465,6 +465,7 @@ namespace basegfx if(!fTools::equalZero(fShearY)) { + // coverity[copy_paste_error] - this is correct getZ, not getY rShear.setY(rShear.getY() / rScale.getZ()); } @@ -472,6 +473,7 @@ namespace basegfx if(!fTools::equalZero(fShearZ)) { + // coverity[original] - this is not an original copy-and-paste source for ^^^ rShear.setZ(rShear.getZ() / rScale.getZ()); } diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 13bc3dc47a3e..36e419eab68a 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -905,7 +905,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal ) sal_Int32 nIdx = nLower; for( sal_Int32 i = 0 ; i < nSize ; i++,nIdx++ ) { - // coverity[array_vs_singleton] + // coverity[callee_ptr_arith] SbxVariableRef xVar = pArray->Get32( &nIdx ); Type aType = getUnoTypeForSbxValue( (SbxVariable*)xVar ); if( bNeedsInit ) @@ -1351,7 +1351,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper sal_Int32 nIdx = nLower; for( sal_Int32 i = 0 ; i < nSeqSize ; i++,nIdx++ ) { - // coverity[array_vs_singleton] + // coverity[callee_ptr_arith] SbxVariableRef xVar = pArray->Get32( &nIdx ); // Convert the value of Sbx to Uno diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 4ab4fff52036..c1b688903e92 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -4372,7 +4372,7 @@ RTLFUNC(StrConv) { ++index; } - // coverity[array_vs_singleton] + // coverity[callee_ptr_arith] pArray->Put( pNew, &index ); } diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 3c816524e7db..94ee18bd2161 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -839,7 +839,7 @@ RTLFUNC(Array) { ++index; } - // coverity[array_vs_singleton] + // coverity[callee_ptr_arith] pArray->Put( pNew, &index ); } @@ -1734,7 +1734,7 @@ RTLFUNC(Join) pArr->GetDim( 1, nLower, nUpper ); for (short i = nLower; i <= nUpper; ++i) { - // coverity[array_vs_singleton] + // coverity[callee_ptr_arith] OUString aStr = pArr->Get( &i )->GetOUString(); aRetStr += aStr; if( i != nUpper ) diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 455611f4c4e2..a8a5e94b1759 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -669,7 +669,7 @@ void SbiRuntime::SetParameters( SbxArray* pParams ) { SbxVariable* v = pParams->Get( j ); short nDimIndex = j - i; - // coverity[array_vs_singleton] + // coverity[callee_ptr_arith] pArray->Put( v, &nDimIndex ); } SbxVariable* pArrayVar = new SbxVariable( SbxVARIANT ); diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx index 6409c2a86058..da3a33be415d 100644 --- a/bridges/source/jni_uno/jni_bridge.cxx +++ b/bridges/source/jni_uno/jni_bridge.cxx @@ -490,7 +490,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_ext_getMapping( uno_registerMapping( &mapping, Bridge_free, pFrom, (uno_Environment *)pTo->pExtEnv, 0 ); - //coverity[leaked_storage] + // coverity[leaked_storage] } else if ( from_env_typename == UNO_LB_UNO && to_env_typename == UNO_LB_JAVA ) { @@ -500,7 +500,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_ext_getMapping( uno_registerMapping( &mapping, Bridge_free, (uno_Environment *)pFrom->pExtEnv, pTo, 0 ); - //coverity[leaked_storage] + // coverity[leaked_storage] } } catch (const BridgeRuntimeError & err) diff --git a/bridges/source/jni_uno/jni_info.cxx b/bridges/source/jni_uno/jni_info.cxx index 96f695783b1e..038d971dc271 100644 --- a/bridges/source/jni_uno/jni_info.cxx +++ b/bridges/source/jni_uno/jni_info.cxx @@ -104,6 +104,7 @@ JNI_interface_type_info::JNI_interface_type_info( typelib_InterfaceTypeDescription * td = reinterpret_cast< typelib_InterfaceTypeDescription * >( m_td.get() ); + // coverity [ctor_dtor_leak] m_methods = new jmethodID[ td->nMapFunctionIndexToMemberIndex ]; sal_Int32 nMethodIndex = 0; typelib_TypeDescriptionReference ** ppMembers = td->ppMembers; @@ -289,6 +290,7 @@ JNI_compound_type_info::JNI_compound_type_info( ((typelib_TypeDescription *)td)->pWeakRef, jni_info->m_RuntimeException_type.getTypeLibType() )) { + // coverity [ctor_dtor_leak] m_fields = new jfieldID[ 2 ]; m_fields[ 0 ] = 0; // special Throwable.getMessage() // field Context @@ -848,7 +850,7 @@ JNI_info::JNI_info( css::uno::TypeDescription XInterface_td( ::getCppuType( (css::uno::Reference< css::uno::XInterface > const *)0 ) ); - //coverity [ctor_dtor_leak] + // coverity [ctor_dtor_leak] m_XInterface_type_info = new JNI_interface_type_info( jni, XInterface_td.get() ); } diff --git a/cppu/source/typelib/static_types.cxx b/cppu/source/typelib/static_types.cxx index 887a884bf0ce..13d2e859bf4c 100644 --- a/cppu/source/typelib/static_types.cxx +++ b/cppu/source/typelib/static_types.cxx @@ -445,7 +445,7 @@ CPPU_DLLPUBLIC void SAL_CALL typelib_static_interface_type_init( typelib_TypeDescriptionReference * pBaseType ) SAL_THROW_EXTERN_C() { - // coverity[array_vs_singleton] + // coverity[callee_ptr_arith] typelib_static_mi_interface_type_init( ppRef, pTypeName, pBaseType == 0 ? 0 : 1, &pBaseType); } diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index b0b1a17d306e..7f3e808ebda4 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.cxx @@ -901,14 +901,12 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newInterface( typelib_TypeDescriptionReference ** ppMembers ) SAL_THROW_EXTERN_C() { - // coverity[array_vs_singleton] + // coverity[callee_ptr_arith] typelib_typedescription_newMIInterface( ppRet, pTypeName, 0, 0, 0, 0, 0, pBaseInterface == 0 ? 0 : 1, &pBaseInterface, nMembers, ppMembers); } - - namespace { class BaseList { diff --git a/cppu/source/uno/sequence.cxx b/cppu/source/uno/sequence.cxx index 1f06dd39c4c6..2d2a894b36e9 100644 --- a/cppu/source/uno/sequence.cxx +++ b/cppu/source/uno/sequence.cxx @@ -268,7 +268,10 @@ static inline bool idefaultConstructElements( case typelib_TypeClass_SEQUENCE: { if (nAlloc >= 0) - pSeq = reallocSeq( pSeq, sizeof(uno_Sequence *), nAlloc ); + { + // coverity[suspicious_sizeof] - sizeof(uno_Sequence*) is correct here + pSeq = reallocSeq(pSeq, sizeof(uno_Sequence*), nAlloc); + } if (pSeq != 0) { uno_Sequence ** pElements = @@ -431,8 +434,8 @@ static inline bool icopyConstructFromElements( rtl_uString ** pDestElements = (rtl_uString **) pSeq->elements; for ( sal_Int32 nPos = nStartIndex; nPos < nStopIndex; ++nPos ) { - // https://communities.coverity.com/thread/2993 - /* coverity[overrun-buffer-arg] */ + // This code tends to trigger coverity's overrun-buffer-arg warning + // coverity[index_parm_via_loop_bound] - https://communities.coverity.com/thread/2993 ::rtl_uString_acquire( ((rtl_uString **)pSourceElements)[nPos] ); pDestElements[nPos] = ((rtl_uString **)pSourceElements)[nPos]; @@ -534,7 +537,10 @@ static inline bool icopyConstructFromElements( case typelib_TypeClass_SEQUENCE: // sequence of sequence { if (nAlloc >= 0) - pSeq = reallocSeq( pSeq, sizeof(uno_Sequence *), nAlloc ); + { + // coverity[suspicious_sizeof] - sizeof(uno_Sequence*) is correct here + pSeq = reallocSeq(pSeq, sizeof(uno_Sequence*), nAlloc); + } if (pSeq != 0) { typelib_TypeDescription * pElementTypeDescr = 0; diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index 91d75b479fd9..e5944aeeb4e5 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -493,7 +493,7 @@ SAL_IMPLEMENT_MAIN() nIndex = 0; OUString aUnoUrlToken( aUnoUrl.getToken( 1, ';', nIndex ) ); - // coverity[infinite_loop] + // coverity[loop_top] - not really an infinite loop, we can be instructed to exit via the connection for (;;) { // accepting diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index fe30080f46fd..7976be5f0022 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -458,7 +458,7 @@ void BackendImpl::initServiceRdbFiles() // switch native rdb: if (!m_nativeRDB_orig.isEmpty()) { - create_ucb_content( + (void)create_ucb_content( &oldRDB, makeURL(getCachePath(), m_nativeRDB_orig), xCmdEnv, false /* no throw */ ); } diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index 0f776587b892..af59a4539321 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -378,9 +378,10 @@ namespace drawinglayer aRetval = Primitive2DSequence(&aPrimitiveBlackAndWhite, 1); break; } + // coverity[dead_error_begin] - intentional dead case case GRAPHICDRAWMODE_WATERMARK: { - OSL_ENSURE(false, "OOps, GRAPHICDRAWMODE_WATERMARK should already be handled (see above)"); + assert(false && "OOps, GRAPHICDRAWMODE_WATERMARK should already be handled (see above)"); // fallthrough intended } default: // case GRAPHICDRAWMODE_STANDARD: diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx index c6a16aac899b..a55451acad5a 100644 --- a/forms/source/runtime/formoperations.cxx +++ b/forms/source/runtime/formoperations.cxx @@ -1520,7 +1520,7 @@ namespace frm if ( m_xCursor->isLast() ) m_xUpdateCursor->moveToInsertRow(); else - m_xCursor->next(); + (void)m_xCursor->next(); } return true; diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index be5799d18c6f..a36cec094c7e 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -1208,7 +1208,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_save(bool bPreferred, const css:: // take over all changes into the original container SolarMutexGuard g; - // coverity[reverse_inull] + // coverity[check_after_deref] if (m_pPrimaryWriteCache) { m_aPrimaryReadCache.takeOver(*m_pPrimaryWriteCache); @@ -1247,7 +1247,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_save(bool bPreferred, const css:: // take over all changes into the original container SolarMutexGuard g; - // coverity[reverse_inull] + // coverity[check_after_deref] if (m_pSecondaryWriteCache) { m_aSecondaryReadCache.takeOver(*m_pSecondaryWriteCache); diff --git a/idlc/source/parser.y b/idlc/source/parser.y index afa38013a3da..400778026c9c 100644 --- a/idlc/source/parser.y +++ b/idlc/source/parser.y @@ -2154,7 +2154,7 @@ at_least_one_scoped_name : } else { StringList* pScopedNames = new StringList(); - //coverity [copy_paste_error] + // coverity [copy_paste_error] pScopedNames->push_back(*$1); $$ = pScopedNames; } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index f3b8991f5107..46f39113a7f4 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -683,7 +683,7 @@ void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec) //check if version of current is recognized, by comparing it with itself try { - cur->compareVersions(cur->getVersion()); + (void)cur->compareVersions(cur->getVersion()); } catch (MalformedVersionException &) { diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx index 463c8a4139da..e68abb53f9c4 100644 --- a/l10ntools/source/helpex.cxx +++ b/l10ntools/source/helpex.cxx @@ -88,6 +88,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { aInput >> sTemp; while( !aInput.eof() ) { + // coverity[tainted_data] - this is a build time tool const OString sXhpFile( sTemp.data(), (sal_Int32)sTemp.length() ); HelpParser aParser( sXhpFile ); const OString sOutput( diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index 09ee4aafb49b..ee980093c709 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -240,6 +240,7 @@ MergeDataFile::MergeDataFile( bool bSkipCurrentPOFile = false; const OString sFileName( lcl_NormalizeFilename(rFile) ); const bool bReadAll = sFileName.isEmpty(); + // coverity[tainted_data] - this is a build time tool const OString sPoFileName(sPoFile.data(), (sal_Int32)sPoFile.length()); PoIfstream aPoInput; aPoInput.open( sPoFileName ); diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index b4e478673e64..2b6c3c3c5e0f 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -634,6 +634,7 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const case RG_VALUETYPE_BINARY: memcpy(value, pBuffer, valueSize); break; + // coverity[dead_error_begin] - following conditions exist to avoid compiler warning case RG_VALUETYPE_LONGLIST: case RG_VALUETYPE_STRINGLIST: case RG_VALUETYPE_UNICODELIST: diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx index ec34bb5749b8..ab4980755375 100644 --- a/reportdesign/source/filter/xml/xmlGroup.cxx +++ b/reportdesign/source/filter/xml/xmlGroup.cxx @@ -43,7 +43,7 @@ namespace rptxml { sal_uInt16 nRet = report::KeepTogether::NO; const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetKeepTogetherOptions(); - SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap ); + (void)SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap ); return nRet; } diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index 0dde198e802e..009442c56a13 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -182,7 +182,7 @@ void SAL_CALL ImportDocumentHandler::startElement(const OUString & _sName, const { sal_uInt16 nRet = static_cast<sal_uInt16>(sdb::CommandType::COMMAND); const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetCommandTypeOptions(); - SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap ); + (void)SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap ); m_xDatabaseDataProvider->setCommandType(nRet); } break; diff --git a/reportdesign/source/filter/xml/xmlSection.cxx b/reportdesign/source/filter/xml/xmlSection.cxx index 909445796b94..ed2e20afd546 100644 --- a/reportdesign/source/filter/xml/xmlSection.cxx +++ b/reportdesign/source/filter/xml/xmlSection.cxx @@ -41,11 +41,11 @@ namespace rptxml using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; - sal_uInt16 lcl_getReportPrintOption(const OUString& _sValue) + sal_uInt16 lcl_getReportPrintOption(const OUString& _sValue) { sal_uInt16 nRet = report::ReportPrintOption::ALL_PAGES; const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetReportPrintOptions(); - SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap ); + (void)SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap ); return nRet; } diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx index 8af0b1009824..7b32c7ae7c22 100644 --- a/reportdesign/source/filter/xml/xmlTable.cxx +++ b/reportdesign/source/filter/xml/xmlTable.cxx @@ -50,7 +50,7 @@ namespace rptxml { sal_uInt16 nRet = report::ForceNewPage::NONE; const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetForceNewPageOptions(); - SvXMLUnitConverter::convertEnum( nRet,_sValue,aXML_EnumMap ); + (void)SvXMLUnitConverter::convertEnum( nRet,_sValue,aXML_EnumMap ); return nRet; } diff --git a/sal/qa/osl/process/osl_process_child.cxx b/sal/qa/osl/process/osl_process_child.cxx index ca9adb3441c7..ee5ecf5bb2c9 100644 --- a/sal/qa/osl/process/osl_process_child.cxx +++ b/sal/qa/osl/process/osl_process_child.cxx @@ -94,7 +94,10 @@ int main(int argc, char* argv[]) if (argc > 2) { if (0 == strcmp("-join", argv[1])) + { + // coverity[tainted_data] - this is a build-time only test tool wait_for_seconds(argv[2]); + } else if (0 == strcmp("-env", argv[1])) dump_env(argv[2]); } diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx index c49f147c4ba2..b826f1347571 100644 --- a/sal/rtl/alloc_arena.cxx +++ b/sal/rtl/alloc_arena.cxx @@ -309,6 +309,7 @@ rtl_arena_hash_rescale ( rtl_arena_segment_type * next = curr->m_fnext; rtl_arena_segment_type ** head; + // coverity[negative_shift] head = &(arena->m_hash_table[RTL_ARENA_HASH_INDEX(arena, curr->m_addr)]); curr->m_fnext = (*head); (*head) = curr; diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx index be6cd4dadbaa..a8db5c23ed59 100644 --- a/sal/rtl/alloc_cache.cxx +++ b/sal/rtl/alloc_cache.cxx @@ -138,6 +138,7 @@ rtl_cache_hash_rescale ( rtl_cache_bufctl_type * next = curr->m_next; rtl_cache_bufctl_type ** head; + // coverity[negative_shift] head = &(cache->m_hash_table[RTL_CACHE_HASH_INDEX(cache, curr->m_addr)]); curr->m_next = (*head); (*head) = curr; @@ -208,6 +209,7 @@ rtl_cache_hash_remove ( if (!(cache->m_features & RTL_CACHE_FEATURE_RESCALE)) { sal_Size ave = nbuf >> cache->m_hash_shift; + // coverity[negative_shift] sal_Size new_size = cache->m_hash_size << (highbit(ave) - 1); cache->m_features |= RTL_CACHE_FEATURE_RESCALE; @@ -1438,6 +1440,7 @@ rtl_cache_depot_wsupdate ( RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock)); } } + // coverity[missing_unlock] } /** rtl_cache_wsupdate() diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index ce9a07e2c3a2..701e6d5eb42b 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -366,7 +366,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, nRow = sal::static_int_cast<SCROW>( nRow + nAddY ); for (sal_uInt16 i=1; i<nCount && rListData; i++) { - GetString(nCol, nRow, aStr); + (void)GetString(nCol, nRow, aStr); if (!rListData->GetSubIndex(aStr, rListIndex)) rListData = NULL; nCol = sal::static_int_cast<SCCOL>( nCol + nAddX ); diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index 8488b46de7e5..fd95bf65d3a5 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -328,7 +328,7 @@ void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVect nSheetsLeft++; } - // coverity[infinite_loop] + // coverity[loop_top] - this isn't an infinite loop where nSheetsLeft gets decremented by the above threads while( nSheetsLeft > 0) { // This is a much more controlled re-enterancy hazard than @@ -438,6 +438,7 @@ void WorkbookFragment::finalizeImport() case SHEETTYPE_CHARTSHEET: xFragment.set( new ChartsheetFragment( *xSheetGlob, aFragmentPath ) ); break; + // coverity[dead_error_begin] - following conditions exist to avoid compiler warning case SHEETTYPE_EMPTYSHEET: case SHEETTYPE_MODULESHEET: break; diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index 1dc310b01f59..9e7e8efd62d7 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -598,7 +598,7 @@ double GetYearFrac( sal_Int32 nNullDate, sal_Int32 nStartDate, sal_Int32 nEndDat case 3: // 3=exact/365 nDaysInYear = 365; break; - //coverity[dead_error_begin] - condition exists to avoid compiler warning + // coverity[dead_error_begin] - following conditions exist to avoid compiler warning default: throw lang::IllegalArgumentException(); } @@ -928,7 +928,7 @@ bool ParseDouble( const sal_Unicode*& rp, double& rRet ) else eS = S_End; break; - //coverity[dead_error_begin] - condition exists to avoid compiler warning + // coverity[dead_error_begin] - following conditions exist to avoid compiler warning case S_End: break; } diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index e24f65cad031..df62929197d8 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -429,7 +429,8 @@ OUString SAL_CALL ScaDateAddIn::getProgrammaticCategoryName( case ScaCat_Inf: aRet = STR_FROM_ANSI( "Information" ); break; case ScaCat_Math: aRet = STR_FROM_ANSI( "Mathematical" ); break; case ScaCat_Tech: aRet = STR_FROM_ANSI( "Technical" ); break; - default: // to prevent compiler warnings + // coverity[dead_error_begin] - following conditions exist to avoid compiler warning + default: break; } } diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx index 772f1e36626a..8da57250bddc 100644 --- a/scaddins/source/pricing/pricing.cxx +++ b/scaddins/source/pricing/pricing.cxx @@ -438,7 +438,8 @@ OUString SAL_CALL ScaPricingAddIn::getProgrammaticCategoryName( case ScaCat_Inf: aRet = STR_FROM_ANSI( "Information" ); break; case ScaCat_Math: aRet = STR_FROM_ANSI( "Mathematical" ); break; case ScaCat_Tech: aRet = STR_FROM_ANSI( "Technical" ); break; - default: // to prevent compiler warnings + // coverity[dead_error_begin] - following conditions exist to avoid compiler warning + default: break; } } diff --git a/sfx2/source/control/itemdel.cxx b/sfx2/source/control/itemdel.cxx index 7ff4d38e237f..9ba81f7050ca 100644 --- a/sfx2/source/control/itemdel.cxx +++ b/sfx2/source/control/itemdel.cxx @@ -80,6 +80,7 @@ void DeleteItemOnIdle(SfxPoolItem* pItem) DBG_ASSERT( 0 == pItem->GetRefCount(), "deleting item in use" ); SfxItemDisruptor_Impl *pDesruptor = new SfxItemDisruptor_Impl(pItem); pDesruptor->LaunchDeleteOnIdle(); + // coverity[leaked_storage] pDesruptor takes care of its own destruction at idle time } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/whiter.cxx b/svl/source/items/whiter.cxx index 9a4e748a62ad..d69960c6f628 100644 --- a/svl/source/items/whiter.cxx +++ b/svl/source/items/whiter.cxx @@ -26,18 +26,14 @@ SfxWhichIter::SfxWhichIter( const SfxItemSet& rSet, sal_uInt16 nFromWh, sal_uInt pStart(rSet.GetRanges()), nOfst(0), nFrom(nFromWh), nTo(nToWh) { - if ( nFrom > 0 ) - FirstWhich(); + if (nFrom > 0) + (void)FirstWhich(); } - - SfxWhichIter::~SfxWhichIter() { } - - sal_uInt16 SfxWhichIter::NextWhich() { while ( 0 != *pRanges ) @@ -56,8 +52,6 @@ sal_uInt16 SfxWhichIter::NextWhich() return 0; } - - sal_uInt16 SfxWhichIter::FirstWhich() { pRanges = pStart; diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index 7b8dc4e05168..207e52137668 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -945,6 +945,7 @@ bool SvDataPipe_Impl::removeMark(sal_uInt32 nPosition) if (t == m_aMarks.end()) return false; m_aMarks.erase(t); + // coverity[pass_freed_arg] - remove frees m_pFirstPage but then sets m_pFirstPage to something else while (remove(m_pFirstPage)) ; return true; } diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 54941d311b25..b88d3880b236 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -455,7 +455,7 @@ static OString lcl_ConvertCharToHTML( sal_Unicode c, // If the character could not be converted to the destination // character set, the UNICODE character is exported as character // entity. - // coverity[array_vs_singleton] + // coverity[callee_ptr_arith] nLen = rtl_convertUnicodeToText( rContext.m_hConv, rContext.m_hContext, &c, 0, cBuffer, TXTCONV_BUFFER_SIZE, diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 06ade19e81b8..71b6ac783038 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -421,8 +421,6 @@ namespace drawinglayer switch(eStyle) { - case drawing::FillStyle_NONE : // for warnings - case drawing::FillStyle_SOLID : default: { // nothing to do, color is defined diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx index 7a25d12697c3..9b181a487c64 100644 --- a/sw/source/core/access/acccontext.cxx +++ b/sw/source/core/access/acccontext.cxx @@ -243,6 +243,7 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm, GetMap() ); } break; + // coverity[dead_error_begin] - following conditions exist to avoid compiler warning case Action::NONE: break; } diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 3188fedea780..ee5a6214dcc3 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1614,7 +1614,9 @@ const SfxPoolItem* SwCntntNode::GetNoCondAttr( sal_uInt16 nWhich, { if( !GetpSwAttrSet() || ( SfxItemState::SET != GetpSwAttrSet()->GetItemState( nWhich, false, &pFnd ) && bInParents )) - ((SwFmt*)GetRegisteredIn())->GetItemState( nWhich, bInParents, &pFnd ); + { + (void)((SwFmt*)GetRegisteredIn())->GetItemState( nWhich, bInParents, &pFnd ); + } } // undo change of issue #i51029# // Note: <GetSwAttrSet()> returns <mpAttrSet>, if set, otherwise it returns diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 3669a5902734..4f10aebca39f 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -965,7 +965,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames ) else if( FLY_AT_FLY == aAnchor.GetAnchorId() ) { Point aPt; - lcl_SetAnchor( *PCURCRSR->GetPoint(), PCURCRSR->GetNode(), + (void)lcl_SetAnchor( *PCURCRSR->GetPoint(), PCURCRSR->GetNode(), 0, aPt, *this, aAnchor, aPt, false ); } diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index cbd2e2f112d2..a9c43e8c3e99 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -1126,9 +1126,6 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( sal_Int16 nVertOri = text::VertOrientation::NONE; switch( eVertOri ) { - case text::VertOrientation::NONE: - nVertOri = text::VertOrientation::NONE; - break; case text::VertOrientation::TOP: nVertOri = text::VertOrientation::TOP; break; @@ -1156,6 +1153,10 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( case text::VertOrientation::LINE_BOTTOM: nVertOri = text::VertOrientation::LINE_BOTTOM; break; + // coverity[dead_error_begin] - following conditions exist to avoid compiler warning + case text::VertOrientation::NONE: + nVertOri = text::VertOrientation::NONE; + break; } aTmp <<= (sal_Int16)nVertOri ; xShapePropSet->setPropertyValue("VertOrient", aTmp ); diff --git a/sw/source/uibase/envelp/labelcfg.cxx b/sw/source/uibase/envelp/labelcfg.cxx index 232faa918344..809df914ea95 100644 --- a/sw/source/uibase/envelp/labelcfg.cxx +++ b/sw/source/uibase/envelp/labelcfg.cxx @@ -99,7 +99,7 @@ SwLabelConfig::SwLabelConfig() : res == xmlreader::XmlReader::RESULT_BEGIN && name.equals("manufacturer")); // Get the name - reader.nextAttribute(&nsId, &name); + (void)reader.nextAttribute(&nsId, &name); assert( nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals("name")); diff --git a/ucb/source/ucp/ftp/ftpdirp.cxx b/ucb/source/ucp/ftp/ftpdirp.cxx index 32a6e6dc22ab..d5d7d93e48be 100644 --- a/ucb/source/ucp/ftp/ftpdirp.cxx +++ b/ucb/source/ucp/ftp/ftpdirp.cxx @@ -934,6 +934,7 @@ bool FTPDirectoryParser::parseUNIX ( else eMode = FOUND_NONE; break; + // coverity[dead_error_begin] - following conditions exist to avoid compiler warning case FOUND_YEAR_TIME: break; } diff --git a/unotest/source/cpp/officeconnection.cxx b/unotest/source/cpp/officeconnection.cxx index b86a4c2abfff..91568b089633 100644 --- a/unotest/source/cpp/officeconnection.cxx +++ b/unotest/source/cpp/officeconnection.cxx @@ -81,7 +81,7 @@ void OfficeConnection::setUp() { { envs = &argEnv.pData; } - // coverity[array_vs_singleton] + // coverity[callee_ptr_arith] CPPUNIT_ASSERT_EQUAL( osl_Process_E_None, osl_executeProcess( diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 1b66eb5f39b3..42a2caa5c82b 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -776,8 +776,10 @@ bool SvtPathOptions::SearchFile( OUString& rIniFile, Paths ePath ) case PATH_WORK: aPath = GetWorkPath(); break; case PATH_UICONFIG: aPath = GetUIConfigPath(); break; case PATH_FINGERPRINT: aPath = GetFingerprintPath(); break; - case PATH_USERCONFIG:/*-Wall???*/ break; - case PATH_COUNT: /*-Wall???*/ break; + // coverity[dead_error_begin] - following conditions exist to avoid compiler warning + case PATH_USERCONFIG: + case PATH_COUNT: + break; } sal_Int32 nPathIndex = 0; diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx index f83d7bc0de4e..3b2ce07de4a9 100644 --- a/vcl/generic/print/genpspgraphics.cxx +++ b/vcl/generic/print/genpspgraphics.cxx @@ -638,7 +638,7 @@ bool PspFontLayout::LayoutText( ImplLayoutArgs& rArgs ) // update fallback_runs if needed psp::CharacterMetric aMetric; - // coverity[array_vs_singleton] + // coverity[callee_ptr_arith] mrPrinterGfx.GetFontMgr().getMetrics( mnFontID, cChar, cChar, &aMetric, mbVertical ); if( aMetric.width == -1 && aMetric.height == -1 ) rArgs.NeedFallback( nCharPos, bRightToLeft ); diff --git a/vcl/generic/print/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx index 40744455a66d..a228aa9bd50b 100644 --- a/vcl/generic/print/text_gfx.cxx +++ b/vcl/generic/print/text_gfx.cxx @@ -329,9 +329,9 @@ PrinterGfx::DrawText ( for( int n = 0; n < nLen; n++ ) { CharacterMetric aBBox; - // coverity[array_vs_singleton] - pFontMap[n] = getCharMetric (aFont, pEffectiveStr[n], &aBBox); - pCharWidth[n] = getCharWidth (mbTextVertical, pEffectiveStr[n], &aBBox); + // coverity[callee_ptr_arith] + pFontMap[n] = getCharMetric(aFont, pEffectiveStr[n], &aBBox); + pCharWidth[n] = getCharWidth(mbTextVertical, pEffectiveStr[n], &aBBox); } // setup a new delta array, use virtual resolution of 1000 @@ -644,8 +644,8 @@ PrinterGfx::GetCharWidth (sal_Unicode nFrom, sal_Unicode nTo, long *pWidthArray) for( int n = 0; n < (nTo - nFrom + 1); n++ ) { CharacterMetric aBBox; - // coverity[array_vs_singleton] - getCharMetric (aFont, n + nFrom, &aBBox); + // coverity[callee_ptr_arith] + getCharMetric(aFont, n + nFrom, &aBBox); pWidthArray[n] = getCharWidth (mbTextVertical, n + nFrom, &aBBox); } diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx index 0732baaf5a96..84dd40a75b69 100644 --- a/vcl/qa/cppunit/timer.cxx +++ b/vcl/qa/cppunit/timer.cxx @@ -104,7 +104,7 @@ void TimerTest::testDurations() { bool bDone = false; TimerBool aTimer( aDurations[i], bDone ); - // coverity[infinite_loop] + // coverity[loop_top] - Application::Yield allows the timer to fire and toggle bDone while( !bDone ) { Application::Yield(); @@ -135,7 +135,6 @@ void TimerTest::testAutoTimer() { sal_Int32 nCount = 0; AutoTimerCount aCount(1, nCount); - // coverity[infinite_loop] while (nCount < 100) { Application::Yield(); } @@ -163,7 +162,7 @@ void TimerTest::testRecursiveTimer() sal_Int32 nCount = 0; YieldTimer aCount(5); AutoTimerCount aCountUp( 3, nCount ); - // coverity[infinite_loop] + // coverity[loop_top] - Application::Yield allows the timer to fire and increment nCount while (nCount < 20) Application::Yield(); } @@ -197,10 +196,10 @@ void TimerTest::testSlowTimerCallback() sal_Int32 nCount = 0; AutoTimerCount aHighFreq(1, nCount); SlowCallbackTimer aSlow(250, bBeenSlow); - // coverity[infinite_loop] + // coverity[loop_top] - Application::Yield allows the timer to fire and toggle bBeenSlow while (!bBeenSlow) Application::Yield(); - // coverity[infinite_loop] + // coverity[loop_top] - Application::Yield allows the timer to fire and increment nCount while (nCount < 200) Application::Yield(); } diff --git a/xmloff/source/transform/ChartOASISTContext.cxx b/xmloff/source/transform/ChartOASISTContext.cxx index 3ec0748bccb8..d451334abeae 100644 --- a/xmloff/source/transform/ChartOASISTContext.cxx +++ b/xmloff/source/transform/ChartOASISTContext.cxx @@ -122,6 +122,7 @@ void XMLChartOASISTransformerContext::StartElement( OUString aAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_CHART, GetXMLToken( XML_ADD_IN_NAME ) ) ); + // coverity[var_deref_model] - pMutableAttrList is assigned in a superset of the enclosing if condition entry logic pMutableAttrList->AddAttribute( aAttrQName, aAddInName ); } diff --git a/xmloff/source/transform/StyleOOoTContext.cxx b/xmloff/source/transform/StyleOOoTContext.cxx index b66077ef83dd..9e934fb9b921 100644 --- a/xmloff/source/transform/StyleOOoTContext.cxx +++ b/xmloff/source/transform/StyleOOoTContext.cxx @@ -981,7 +981,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement( aDrawMirrorAttrValue); } - if( bMoveProtect || bSizeProtect || !aProtectAttrValue.isEmpty() ) + if (bMoveProtect || bSizeProtect || !aProtectAttrValue.isEmpty()) { if( (bMoveProtect ||bSizeProtect) && IsXMLToken( aProtectAttrValue, XML_NONE ) ) aProtectAttrValue = OUString(); @@ -1002,6 +1002,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement( aProtectAttrValue += rSize; } + // coverity[var_deref_model] - pProtectContext is assigned in a superset of the enclosing if condition entry logic pProtectContext->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_STYLE, GetXMLToken( XML_PROTECT ) ), aProtectAttrValue ); } |