markup with event type not checker type

Change-Id: I14c0c5d90b67000cb4fe9e6be647854abfe784da
This commit is contained in:
Caolán McNamara 2014-11-05 10:15:38 +00:00
parent ea272d9fe4
commit 12bcfec04f
50 changed files with 92 additions and 68 deletions

View File

@ -465,6 +465,7 @@ namespace basegfx
if(!fTools::equalZero(fShearY)) if(!fTools::equalZero(fShearY))
{ {
// coverity[copy_paste_error] - this is correct getZ, not getY
rShear.setY(rShear.getY() / rScale.getZ()); rShear.setY(rShear.getY() / rScale.getZ());
} }
@ -472,6 +473,7 @@ namespace basegfx
if(!fTools::equalZero(fShearZ)) if(!fTools::equalZero(fShearZ))
{ {
// coverity[original] - this is not an original copy-and-paste source for ^^^
rShear.setZ(rShear.getZ() / rScale.getZ()); rShear.setZ(rShear.getZ() / rScale.getZ());
} }

View File

@ -905,7 +905,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal )
sal_Int32 nIdx = nLower; sal_Int32 nIdx = nLower;
for( sal_Int32 i = 0 ; i < nSize ; i++,nIdx++ ) for( sal_Int32 i = 0 ; i < nSize ; i++,nIdx++ )
{ {
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
SbxVariableRef xVar = pArray->Get32( &nIdx ); SbxVariableRef xVar = pArray->Get32( &nIdx );
Type aType = getUnoTypeForSbxValue( (SbxVariable*)xVar ); Type aType = getUnoTypeForSbxValue( (SbxVariable*)xVar );
if( bNeedsInit ) if( bNeedsInit )
@ -1351,7 +1351,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
sal_Int32 nIdx = nLower; sal_Int32 nIdx = nLower;
for( sal_Int32 i = 0 ; i < nSeqSize ; i++,nIdx++ ) for( sal_Int32 i = 0 ; i < nSeqSize ; i++,nIdx++ )
{ {
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
SbxVariableRef xVar = pArray->Get32( &nIdx ); SbxVariableRef xVar = pArray->Get32( &nIdx );
// Convert the value of Sbx to Uno // Convert the value of Sbx to Uno

View File

@ -4372,7 +4372,7 @@ RTLFUNC(StrConv)
{ {
++index; ++index;
} }
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
pArray->Put( pNew, &index ); pArray->Put( pNew, &index );
} }

View File

@ -839,7 +839,7 @@ RTLFUNC(Array)
{ {
++index; ++index;
} }
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
pArray->Put( pNew, &index ); pArray->Put( pNew, &index );
} }
@ -1734,7 +1734,7 @@ RTLFUNC(Join)
pArr->GetDim( 1, nLower, nUpper ); pArr->GetDim( 1, nLower, nUpper );
for (short i = nLower; i <= nUpper; ++i) for (short i = nLower; i <= nUpper; ++i)
{ {
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
OUString aStr = pArr->Get( &i )->GetOUString(); OUString aStr = pArr->Get( &i )->GetOUString();
aRetStr += aStr; aRetStr += aStr;
if( i != nUpper ) if( i != nUpper )

View File

@ -669,7 +669,7 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
{ {
SbxVariable* v = pParams->Get( j ); SbxVariable* v = pParams->Get( j );
short nDimIndex = j - i; short nDimIndex = j - i;
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
pArray->Put( v, &nDimIndex ); pArray->Put( v, &nDimIndex );
} }
SbxVariable* pArrayVar = new SbxVariable( SbxVARIANT ); SbxVariable* pArrayVar = new SbxVariable( SbxVARIANT );

View File

@ -490,7 +490,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_ext_getMapping(
uno_registerMapping( uno_registerMapping(
&mapping, Bridge_free, &mapping, Bridge_free,
pFrom, (uno_Environment *)pTo->pExtEnv, 0 ); 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 ) 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( uno_registerMapping(
&mapping, Bridge_free, &mapping, Bridge_free,
(uno_Environment *)pFrom->pExtEnv, pTo, 0 ); (uno_Environment *)pFrom->pExtEnv, pTo, 0 );
//coverity[leaked_storage] // coverity[leaked_storage]
} }
} }
catch (const BridgeRuntimeError & err) catch (const BridgeRuntimeError & err)

View File

@ -104,6 +104,7 @@ JNI_interface_type_info::JNI_interface_type_info(
typelib_InterfaceTypeDescription * td = typelib_InterfaceTypeDescription * td =
reinterpret_cast< typelib_InterfaceTypeDescription * >( reinterpret_cast< typelib_InterfaceTypeDescription * >(
m_td.get() ); m_td.get() );
// coverity [ctor_dtor_leak]
m_methods = new jmethodID[ td->nMapFunctionIndexToMemberIndex ]; m_methods = new jmethodID[ td->nMapFunctionIndexToMemberIndex ];
sal_Int32 nMethodIndex = 0; sal_Int32 nMethodIndex = 0;
typelib_TypeDescriptionReference ** ppMembers = td->ppMembers; typelib_TypeDescriptionReference ** ppMembers = td->ppMembers;
@ -289,6 +290,7 @@ JNI_compound_type_info::JNI_compound_type_info(
((typelib_TypeDescription *)td)->pWeakRef, ((typelib_TypeDescription *)td)->pWeakRef,
jni_info->m_RuntimeException_type.getTypeLibType() )) jni_info->m_RuntimeException_type.getTypeLibType() ))
{ {
// coverity [ctor_dtor_leak]
m_fields = new jfieldID[ 2 ]; m_fields = new jfieldID[ 2 ];
m_fields[ 0 ] = 0; // special Throwable.getMessage() m_fields[ 0 ] = 0; // special Throwable.getMessage()
// field Context // field Context
@ -848,7 +850,7 @@ JNI_info::JNI_info(
css::uno::TypeDescription XInterface_td( css::uno::TypeDescription XInterface_td(
::getCppuType( ::getCppuType(
(css::uno::Reference< css::uno::XInterface > const *)0 ) ); (css::uno::Reference< css::uno::XInterface > const *)0 ) );
//coverity [ctor_dtor_leak] // coverity [ctor_dtor_leak]
m_XInterface_type_info = m_XInterface_type_info =
new JNI_interface_type_info( jni, XInterface_td.get() ); new JNI_interface_type_info( jni, XInterface_td.get() );
} }

View File

@ -445,7 +445,7 @@ CPPU_DLLPUBLIC void SAL_CALL typelib_static_interface_type_init(
typelib_TypeDescriptionReference * pBaseType ) typelib_TypeDescriptionReference * pBaseType )
SAL_THROW_EXTERN_C() SAL_THROW_EXTERN_C()
{ {
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
typelib_static_mi_interface_type_init( typelib_static_mi_interface_type_init(
ppRef, pTypeName, pBaseType == 0 ? 0 : 1, &pBaseType); ppRef, pTypeName, pBaseType == 0 ? 0 : 1, &pBaseType);
} }

View File

@ -901,14 +901,12 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newInterface(
typelib_TypeDescriptionReference ** ppMembers ) typelib_TypeDescriptionReference ** ppMembers )
SAL_THROW_EXTERN_C() SAL_THROW_EXTERN_C()
{ {
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
typelib_typedescription_newMIInterface( typelib_typedescription_newMIInterface(
ppRet, pTypeName, 0, 0, 0, 0, 0, pBaseInterface == 0 ? 0 : 1, ppRet, pTypeName, 0, 0, 0, 0, 0, pBaseInterface == 0 ? 0 : 1,
&pBaseInterface, nMembers, ppMembers); &pBaseInterface, nMembers, ppMembers);
} }
namespace { namespace {
class BaseList { class BaseList {

View File

@ -268,7 +268,10 @@ static inline bool idefaultConstructElements(
case typelib_TypeClass_SEQUENCE: case typelib_TypeClass_SEQUENCE:
{ {
if (nAlloc >= 0) 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) if (pSeq != 0)
{ {
uno_Sequence ** pElements = uno_Sequence ** pElements =
@ -431,8 +434,8 @@ static inline bool icopyConstructFromElements(
rtl_uString ** pDestElements = (rtl_uString **) pSeq->elements; rtl_uString ** pDestElements = (rtl_uString **) pSeq->elements;
for ( sal_Int32 nPos = nStartIndex; nPos < nStopIndex; ++nPos ) for ( sal_Int32 nPos = nStartIndex; nPos < nStopIndex; ++nPos )
{ {
// https://communities.coverity.com/thread/2993 // This code tends to trigger coverity's overrun-buffer-arg warning
/* coverity[overrun-buffer-arg] */ // coverity[index_parm_via_loop_bound] - https://communities.coverity.com/thread/2993
::rtl_uString_acquire( ::rtl_uString_acquire(
((rtl_uString **)pSourceElements)[nPos] ); ((rtl_uString **)pSourceElements)[nPos] );
pDestElements[nPos] = ((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 case typelib_TypeClass_SEQUENCE: // sequence of sequence
{ {
if (nAlloc >= 0) 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) if (pSeq != 0)
{ {
typelib_TypeDescription * pElementTypeDescr = 0; typelib_TypeDescription * pElementTypeDescr = 0;

View File

@ -493,7 +493,7 @@ SAL_IMPLEMENT_MAIN()
nIndex = 0; nIndex = 0;
OUString aUnoUrlToken( aUnoUrl.getToken( 1, ';', nIndex ) ); 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 (;;) for (;;)
{ {
// accepting // accepting

View File

@ -458,7 +458,7 @@ void BackendImpl::initServiceRdbFiles()
// switch native rdb: // switch native rdb:
if (!m_nativeRDB_orig.isEmpty()) if (!m_nativeRDB_orig.isEmpty())
{ {
create_ucb_content( (void)create_ucb_content(
&oldRDB, makeURL(getCachePath(), m_nativeRDB_orig), &oldRDB, makeURL(getCachePath(), m_nativeRDB_orig),
xCmdEnv, false /* no throw */ ); xCmdEnv, false /* no throw */ );
} }

View File

@ -378,9 +378,10 @@ namespace drawinglayer
aRetval = Primitive2DSequence(&aPrimitiveBlackAndWhite, 1); aRetval = Primitive2DSequence(&aPrimitiveBlackAndWhite, 1);
break; break;
} }
// coverity[dead_error_begin] - intentional dead case
case GRAPHICDRAWMODE_WATERMARK: 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 // fallthrough intended
} }
default: // case GRAPHICDRAWMODE_STANDARD: default: // case GRAPHICDRAWMODE_STANDARD:

View File

@ -1520,7 +1520,7 @@ namespace frm
if ( m_xCursor->isLast() ) if ( m_xCursor->isLast() )
m_xUpdateCursor->moveToInsertRow(); m_xUpdateCursor->moveToInsertRow();
else else
m_xCursor->next(); (void)m_xCursor->next();
} }
return true; return true;

View File

@ -1208,7 +1208,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_save(bool bPreferred, const css::
// take over all changes into the original container // take over all changes into the original container
SolarMutexGuard g; SolarMutexGuard g;
// coverity[reverse_inull] // coverity[check_after_deref]
if (m_pPrimaryWriteCache) if (m_pPrimaryWriteCache)
{ {
m_aPrimaryReadCache.takeOver(*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 // take over all changes into the original container
SolarMutexGuard g; SolarMutexGuard g;
// coverity[reverse_inull] // coverity[check_after_deref]
if (m_pSecondaryWriteCache) if (m_pSecondaryWriteCache)
{ {
m_aSecondaryReadCache.takeOver(*m_pSecondaryWriteCache); m_aSecondaryReadCache.takeOver(*m_pSecondaryWriteCache);

View File

@ -2154,7 +2154,7 @@ at_least_one_scoped_name :
} else } else
{ {
StringList* pScopedNames = new StringList(); StringList* pScopedNames = new StringList();
//coverity [copy_paste_error] // coverity [copy_paste_error]
pScopedNames->push_back(*$1); pScopedNames->push_back(*$1);
$$ = pScopedNames; $$ = pScopedNames;
} }

View File

@ -683,7 +683,7 @@ void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec)
//check if version of current is recognized, by comparing it with itself //check if version of current is recognized, by comparing it with itself
try try
{ {
cur->compareVersions(cur->getVersion()); (void)cur->compareVersions(cur->getVersion());
} }
catch (MalformedVersionException &) catch (MalformedVersionException &)
{ {

View File

@ -88,6 +88,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
aInput >> sTemp; aInput >> sTemp;
while( !aInput.eof() ) while( !aInput.eof() )
{ {
// coverity[tainted_data] - this is a build time tool
const OString sXhpFile( sTemp.data(), (sal_Int32)sTemp.length() ); const OString sXhpFile( sTemp.data(), (sal_Int32)sTemp.length() );
HelpParser aParser( sXhpFile ); HelpParser aParser( sXhpFile );
const OString sOutput( const OString sOutput(

View File

@ -240,6 +240,7 @@ MergeDataFile::MergeDataFile(
bool bSkipCurrentPOFile = false; bool bSkipCurrentPOFile = false;
const OString sFileName( lcl_NormalizeFilename(rFile) ); const OString sFileName( lcl_NormalizeFilename(rFile) );
const bool bReadAll = sFileName.isEmpty(); const bool bReadAll = sFileName.isEmpty();
// coverity[tainted_data] - this is a build time tool
const OString sPoFileName(sPoFile.data(), (sal_Int32)sPoFile.length()); const OString sPoFileName(sPoFile.data(), (sal_Int32)sPoFile.length());
PoIfstream aPoInput; PoIfstream aPoInput;
aPoInput.open( sPoFileName ); aPoInput.open( sPoFileName );

View File

@ -634,6 +634,7 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const
case RG_VALUETYPE_BINARY: case RG_VALUETYPE_BINARY:
memcpy(value, pBuffer, valueSize); memcpy(value, pBuffer, valueSize);
break; break;
// coverity[dead_error_begin] - following conditions exist to avoid compiler warning
case RG_VALUETYPE_LONGLIST: case RG_VALUETYPE_LONGLIST:
case RG_VALUETYPE_STRINGLIST: case RG_VALUETYPE_STRINGLIST:
case RG_VALUETYPE_UNICODELIST: case RG_VALUETYPE_UNICODELIST:

View File

@ -43,7 +43,7 @@ namespace rptxml
{ {
sal_uInt16 nRet = report::KeepTogether::NO; sal_uInt16 nRet = report::KeepTogether::NO;
const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetKeepTogetherOptions(); const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetKeepTogetherOptions();
SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap ); (void)SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap );
return nRet; return nRet;
} }

View File

@ -182,7 +182,7 @@ void SAL_CALL ImportDocumentHandler::startElement(const OUString & _sName, const
{ {
sal_uInt16 nRet = static_cast<sal_uInt16>(sdb::CommandType::COMMAND); sal_uInt16 nRet = static_cast<sal_uInt16>(sdb::CommandType::COMMAND);
const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetCommandTypeOptions(); const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetCommandTypeOptions();
SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap ); (void)SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap );
m_xDatabaseDataProvider->setCommandType(nRet); m_xDatabaseDataProvider->setCommandType(nRet);
} }
break; break;

View File

@ -41,11 +41,11 @@ namespace rptxml
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax; 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; sal_uInt16 nRet = report::ReportPrintOption::ALL_PAGES;
const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetReportPrintOptions(); const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetReportPrintOptions();
SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap ); (void)SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap );
return nRet; return nRet;
} }

View File

@ -50,7 +50,7 @@ namespace rptxml
{ {
sal_uInt16 nRet = report::ForceNewPage::NONE; sal_uInt16 nRet = report::ForceNewPage::NONE;
const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetForceNewPageOptions(); const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetForceNewPageOptions();
SvXMLUnitConverter::convertEnum( nRet,_sValue,aXML_EnumMap ); (void)SvXMLUnitConverter::convertEnum( nRet,_sValue,aXML_EnumMap );
return nRet; return nRet;
} }

View File

@ -94,7 +94,10 @@ int main(int argc, char* argv[])
if (argc > 2) if (argc > 2)
{ {
if (0 == strcmp("-join", argv[1])) if (0 == strcmp("-join", argv[1]))
{
// coverity[tainted_data] - this is a build-time only test tool
wait_for_seconds(argv[2]); wait_for_seconds(argv[2]);
}
else if (0 == strcmp("-env", argv[1])) else if (0 == strcmp("-env", argv[1]))
dump_env(argv[2]); dump_env(argv[2]);
} }

View File

@ -309,6 +309,7 @@ rtl_arena_hash_rescale (
rtl_arena_segment_type * next = curr->m_fnext; rtl_arena_segment_type * next = curr->m_fnext;
rtl_arena_segment_type ** head; rtl_arena_segment_type ** head;
// coverity[negative_shift]
head = &(arena->m_hash_table[RTL_ARENA_HASH_INDEX(arena, curr->m_addr)]); head = &(arena->m_hash_table[RTL_ARENA_HASH_INDEX(arena, curr->m_addr)]);
curr->m_fnext = (*head); curr->m_fnext = (*head);
(*head) = curr; (*head) = curr;

View File

@ -138,6 +138,7 @@ rtl_cache_hash_rescale (
rtl_cache_bufctl_type * next = curr->m_next; rtl_cache_bufctl_type * next = curr->m_next;
rtl_cache_bufctl_type ** head; rtl_cache_bufctl_type ** head;
// coverity[negative_shift]
head = &(cache->m_hash_table[RTL_CACHE_HASH_INDEX(cache, curr->m_addr)]); head = &(cache->m_hash_table[RTL_CACHE_HASH_INDEX(cache, curr->m_addr)]);
curr->m_next = (*head); curr->m_next = (*head);
(*head) = curr; (*head) = curr;
@ -208,6 +209,7 @@ rtl_cache_hash_remove (
if (!(cache->m_features & RTL_CACHE_FEATURE_RESCALE)) if (!(cache->m_features & RTL_CACHE_FEATURE_RESCALE))
{ {
sal_Size ave = nbuf >> cache->m_hash_shift; sal_Size ave = nbuf >> cache->m_hash_shift;
// coverity[negative_shift]
sal_Size new_size = cache->m_hash_size << (highbit(ave) - 1); sal_Size new_size = cache->m_hash_size << (highbit(ave) - 1);
cache->m_features |= RTL_CACHE_FEATURE_RESCALE; cache->m_features |= RTL_CACHE_FEATURE_RESCALE;
@ -1438,6 +1440,7 @@ rtl_cache_depot_wsupdate (
RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock)); RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock));
} }
} }
// coverity[missing_unlock]
} }
/** rtl_cache_wsupdate() /** rtl_cache_wsupdate()

View File

@ -366,7 +366,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
nRow = sal::static_int_cast<SCROW>( nRow + nAddY ); nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
for (sal_uInt16 i=1; i<nCount && rListData; i++) for (sal_uInt16 i=1; i<nCount && rListData; i++)
{ {
GetString(nCol, nRow, aStr); (void)GetString(nCol, nRow, aStr);
if (!rListData->GetSubIndex(aStr, rListIndex)) if (!rListData->GetSubIndex(aStr, rListIndex))
rListData = NULL; rListData = NULL;
nCol = sal::static_int_cast<SCCOL>( nCol + nAddX ); nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );

View File

@ -328,7 +328,7 @@ void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVect
nSheetsLeft++; nSheetsLeft++;
} }
// coverity[infinite_loop] // coverity[loop_top] - this isn't an infinite loop where nSheetsLeft gets decremented by the above threads
while( nSheetsLeft > 0) while( nSheetsLeft > 0)
{ {
// This is a much more controlled re-enterancy hazard than // This is a much more controlled re-enterancy hazard than
@ -438,6 +438,7 @@ void WorkbookFragment::finalizeImport()
case SHEETTYPE_CHARTSHEET: case SHEETTYPE_CHARTSHEET:
xFragment.set( new ChartsheetFragment( *xSheetGlob, aFragmentPath ) ); xFragment.set( new ChartsheetFragment( *xSheetGlob, aFragmentPath ) );
break; break;
// coverity[dead_error_begin] - following conditions exist to avoid compiler warning
case SHEETTYPE_EMPTYSHEET: case SHEETTYPE_EMPTYSHEET:
case SHEETTYPE_MODULESHEET: case SHEETTYPE_MODULESHEET:
break; break;

View File

@ -598,7 +598,7 @@ double GetYearFrac( sal_Int32 nNullDate, sal_Int32 nStartDate, sal_Int32 nEndDat
case 3: // 3=exact/365 case 3: // 3=exact/365
nDaysInYear = 365; nDaysInYear = 365;
break; break;
//coverity[dead_error_begin] - condition exists to avoid compiler warning // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
default: default:
throw lang::IllegalArgumentException(); throw lang::IllegalArgumentException();
} }
@ -928,7 +928,7 @@ bool ParseDouble( const sal_Unicode*& rp, double& rRet )
else else
eS = S_End; eS = S_End;
break; 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: case S_End:
break; break;
} }

View File

@ -429,7 +429,8 @@ OUString SAL_CALL ScaDateAddIn::getProgrammaticCategoryName(
case ScaCat_Inf: aRet = STR_FROM_ANSI( "Information" ); break; case ScaCat_Inf: aRet = STR_FROM_ANSI( "Information" ); break;
case ScaCat_Math: aRet = STR_FROM_ANSI( "Mathematical" ); break; case ScaCat_Math: aRet = STR_FROM_ANSI( "Mathematical" ); break;
case ScaCat_Tech: aRet = STR_FROM_ANSI( "Technical" ); 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; break;
} }
} }

View File

@ -438,7 +438,8 @@ OUString SAL_CALL ScaPricingAddIn::getProgrammaticCategoryName(
case ScaCat_Inf: aRet = STR_FROM_ANSI( "Information" ); break; case ScaCat_Inf: aRet = STR_FROM_ANSI( "Information" ); break;
case ScaCat_Math: aRet = STR_FROM_ANSI( "Mathematical" ); break; case ScaCat_Math: aRet = STR_FROM_ANSI( "Mathematical" ); break;
case ScaCat_Tech: aRet = STR_FROM_ANSI( "Technical" ); 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; break;
} }
} }

View File

@ -80,6 +80,7 @@ void DeleteItemOnIdle(SfxPoolItem* pItem)
DBG_ASSERT( 0 == pItem->GetRefCount(), "deleting item in use" ); DBG_ASSERT( 0 == pItem->GetRefCount(), "deleting item in use" );
SfxItemDisruptor_Impl *pDesruptor = new SfxItemDisruptor_Impl(pItem); SfxItemDisruptor_Impl *pDesruptor = new SfxItemDisruptor_Impl(pItem);
pDesruptor->LaunchDeleteOnIdle(); pDesruptor->LaunchDeleteOnIdle();
// coverity[leaked_storage] pDesruptor takes care of its own destruction at idle time
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -26,18 +26,14 @@ SfxWhichIter::SfxWhichIter( const SfxItemSet& rSet, sal_uInt16 nFromWh, sal_uInt
pStart(rSet.GetRanges()), pStart(rSet.GetRanges()),
nOfst(0), nFrom(nFromWh), nTo(nToWh) nOfst(0), nFrom(nFromWh), nTo(nToWh)
{ {
if ( nFrom > 0 ) if (nFrom > 0)
FirstWhich(); (void)FirstWhich();
} }
SfxWhichIter::~SfxWhichIter() SfxWhichIter::~SfxWhichIter()
{ {
} }
sal_uInt16 SfxWhichIter::NextWhich() sal_uInt16 SfxWhichIter::NextWhich()
{ {
while ( 0 != *pRanges ) while ( 0 != *pRanges )
@ -56,8 +52,6 @@ sal_uInt16 SfxWhichIter::NextWhich()
return 0; return 0;
} }
sal_uInt16 SfxWhichIter::FirstWhich() sal_uInt16 SfxWhichIter::FirstWhich()
{ {
pRanges = pStart; pRanges = pStart;

View File

@ -945,6 +945,7 @@ bool SvDataPipe_Impl::removeMark(sal_uInt32 nPosition)
if (t == m_aMarks.end()) if (t == m_aMarks.end())
return false; return false;
m_aMarks.erase(t); m_aMarks.erase(t);
// coverity[pass_freed_arg] - remove frees m_pFirstPage but then sets m_pFirstPage to something else
while (remove(m_pFirstPage)) ; while (remove(m_pFirstPage)) ;
return true; return true;
} }

View File

@ -455,7 +455,7 @@ static OString lcl_ConvertCharToHTML( sal_Unicode c,
// If the character could not be converted to the destination // If the character could not be converted to the destination
// character set, the UNICODE character is exported as character // character set, the UNICODE character is exported as character
// entity. // entity.
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
nLen = rtl_convertUnicodeToText( nLen = rtl_convertUnicodeToText(
rContext.m_hConv, rContext.m_hContext, &c, 0, rContext.m_hConv, rContext.m_hContext, &c, 0,
cBuffer, TXTCONV_BUFFER_SIZE, cBuffer, TXTCONV_BUFFER_SIZE,

View File

@ -421,8 +421,6 @@ namespace drawinglayer
switch(eStyle) switch(eStyle)
{ {
case drawing::FillStyle_NONE : // for warnings
case drawing::FillStyle_SOLID :
default: default:
{ {
// nothing to do, color is defined // nothing to do, color is defined

View File

@ -243,6 +243,7 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
GetMap() ); GetMap() );
} }
break; break;
// coverity[dead_error_begin] - following conditions exist to avoid compiler warning
case Action::NONE: case Action::NONE:
break; break;
} }

View File

@ -1614,7 +1614,9 @@ const SfxPoolItem* SwCntntNode::GetNoCondAttr( sal_uInt16 nWhich,
{ {
if( !GetpSwAttrSet() || ( SfxItemState::SET != GetpSwAttrSet()->GetItemState( if( !GetpSwAttrSet() || ( SfxItemState::SET != GetpSwAttrSet()->GetItemState(
nWhich, false, &pFnd ) && bInParents )) nWhich, false, &pFnd ) && bInParents ))
((SwFmt*)GetRegisteredIn())->GetItemState( nWhich, bInParents, &pFnd ); {
(void)((SwFmt*)GetRegisteredIn())->GetItemState( nWhich, bInParents, &pFnd );
}
} }
// undo change of issue #i51029# // undo change of issue #i51029#
// Note: <GetSwAttrSet()> returns <mpAttrSet>, if set, otherwise it returns // Note: <GetSwAttrSet()> returns <mpAttrSet>, if set, otherwise it returns

View File

@ -965,7 +965,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames )
else if( FLY_AT_FLY == aAnchor.GetAnchorId() ) else if( FLY_AT_FLY == aAnchor.GetAnchorId() )
{ {
Point aPt; Point aPt;
lcl_SetAnchor( *PCURCRSR->GetPoint(), PCURCRSR->GetNode(), (void)lcl_SetAnchor( *PCURCRSR->GetPoint(), PCURCRSR->GetNode(),
0, aPt, *this, aAnchor, aPt, false ); 0, aPt, *this, aAnchor, aPt, false );
} }

View File

@ -1126,9 +1126,6 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
sal_Int16 nVertOri = text::VertOrientation::NONE; sal_Int16 nVertOri = text::VertOrientation::NONE;
switch( eVertOri ) switch( eVertOri )
{ {
case text::VertOrientation::NONE:
nVertOri = text::VertOrientation::NONE;
break;
case text::VertOrientation::TOP: case text::VertOrientation::TOP:
nVertOri = text::VertOrientation::TOP; nVertOri = text::VertOrientation::TOP;
break; break;
@ -1156,6 +1153,10 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
case text::VertOrientation::LINE_BOTTOM: case text::VertOrientation::LINE_BOTTOM:
nVertOri = text::VertOrientation::LINE_BOTTOM; nVertOri = text::VertOrientation::LINE_BOTTOM;
break; 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 ; aTmp <<= (sal_Int16)nVertOri ;
xShapePropSet->setPropertyValue("VertOrient", aTmp ); xShapePropSet->setPropertyValue("VertOrient", aTmp );

View File

@ -99,7 +99,7 @@ SwLabelConfig::SwLabelConfig() :
res == xmlreader::XmlReader::RESULT_BEGIN res == xmlreader::XmlReader::RESULT_BEGIN
&& name.equals("manufacturer")); && name.equals("manufacturer"));
// Get the name // Get the name
reader.nextAttribute(&nsId, &name); (void)reader.nextAttribute(&nsId, &name);
assert( assert(
nsId == xmlreader::XmlReader::NAMESPACE_NONE nsId == xmlreader::XmlReader::NAMESPACE_NONE
&& name.equals("name")); && name.equals("name"));

View File

@ -934,6 +934,7 @@ bool FTPDirectoryParser::parseUNIX (
else else
eMode = FOUND_NONE; eMode = FOUND_NONE;
break; break;
// coverity[dead_error_begin] - following conditions exist to avoid compiler warning
case FOUND_YEAR_TIME: case FOUND_YEAR_TIME:
break; break;
} }

View File

@ -81,7 +81,7 @@ void OfficeConnection::setUp() {
{ {
envs = &argEnv.pData; envs = &argEnv.pData;
} }
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
CPPUNIT_ASSERT_EQUAL( CPPUNIT_ASSERT_EQUAL(
osl_Process_E_None, osl_Process_E_None,
osl_executeProcess( osl_executeProcess(

View File

@ -776,8 +776,10 @@ bool SvtPathOptions::SearchFile( OUString& rIniFile, Paths ePath )
case PATH_WORK: aPath = GetWorkPath(); break; case PATH_WORK: aPath = GetWorkPath(); break;
case PATH_UICONFIG: aPath = GetUIConfigPath(); break; case PATH_UICONFIG: aPath = GetUIConfigPath(); break;
case PATH_FINGERPRINT: aPath = GetFingerprintPath(); break; case PATH_FINGERPRINT: aPath = GetFingerprintPath(); break;
case PATH_USERCONFIG:/*-Wall???*/ break; // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
case PATH_COUNT: /*-Wall???*/ break; case PATH_USERCONFIG:
case PATH_COUNT:
break;
} }
sal_Int32 nPathIndex = 0; sal_Int32 nPathIndex = 0;

View File

@ -638,7 +638,7 @@ bool PspFontLayout::LayoutText( ImplLayoutArgs& rArgs )
// update fallback_runs if needed // update fallback_runs if needed
psp::CharacterMetric aMetric; psp::CharacterMetric aMetric;
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
mrPrinterGfx.GetFontMgr().getMetrics( mnFontID, cChar, cChar, &aMetric, mbVertical ); mrPrinterGfx.GetFontMgr().getMetrics( mnFontID, cChar, cChar, &aMetric, mbVertical );
if( aMetric.width == -1 && aMetric.height == -1 ) if( aMetric.width == -1 && aMetric.height == -1 )
rArgs.NeedFallback( nCharPos, bRightToLeft ); rArgs.NeedFallback( nCharPos, bRightToLeft );

View File

@ -329,9 +329,9 @@ PrinterGfx::DrawText (
for( int n = 0; n < nLen; n++ ) for( int n = 0; n < nLen; n++ )
{ {
CharacterMetric aBBox; CharacterMetric aBBox;
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
pFontMap[n] = getCharMetric (aFont, pEffectiveStr[n], &aBBox); pFontMap[n] = getCharMetric(aFont, pEffectiveStr[n], &aBBox);
pCharWidth[n] = getCharWidth (mbTextVertical, pEffectiveStr[n], &aBBox); pCharWidth[n] = getCharWidth(mbTextVertical, pEffectiveStr[n], &aBBox);
} }
// setup a new delta array, use virtual resolution of 1000 // 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++ ) for( int n = 0; n < (nTo - nFrom + 1); n++ )
{ {
CharacterMetric aBBox; CharacterMetric aBBox;
// coverity[array_vs_singleton] // coverity[callee_ptr_arith]
getCharMetric (aFont, n + nFrom, &aBBox); getCharMetric(aFont, n + nFrom, &aBBox);
pWidthArray[n] = getCharWidth (mbTextVertical, n + nFrom, &aBBox); pWidthArray[n] = getCharWidth (mbTextVertical, n + nFrom, &aBBox);
} }

View File

@ -104,7 +104,7 @@ void TimerTest::testDurations()
{ {
bool bDone = false; bool bDone = false;
TimerBool aTimer( aDurations[i], bDone ); TimerBool aTimer( aDurations[i], bDone );
// coverity[infinite_loop] // coverity[loop_top] - Application::Yield allows the timer to fire and toggle bDone
while( !bDone ) while( !bDone )
{ {
Application::Yield(); Application::Yield();
@ -135,7 +135,6 @@ void TimerTest::testAutoTimer()
{ {
sal_Int32 nCount = 0; sal_Int32 nCount = 0;
AutoTimerCount aCount(1, nCount); AutoTimerCount aCount(1, nCount);
// coverity[infinite_loop]
while (nCount < 100) { while (nCount < 100) {
Application::Yield(); Application::Yield();
} }
@ -163,7 +162,7 @@ void TimerTest::testRecursiveTimer()
sal_Int32 nCount = 0; sal_Int32 nCount = 0;
YieldTimer aCount(5); YieldTimer aCount(5);
AutoTimerCount aCountUp( 3, nCount ); AutoTimerCount aCountUp( 3, nCount );
// coverity[infinite_loop] // coverity[loop_top] - Application::Yield allows the timer to fire and increment nCount
while (nCount < 20) while (nCount < 20)
Application::Yield(); Application::Yield();
} }
@ -197,10 +196,10 @@ void TimerTest::testSlowTimerCallback()
sal_Int32 nCount = 0; sal_Int32 nCount = 0;
AutoTimerCount aHighFreq(1, nCount); AutoTimerCount aHighFreq(1, nCount);
SlowCallbackTimer aSlow(250, bBeenSlow); SlowCallbackTimer aSlow(250, bBeenSlow);
// coverity[infinite_loop] // coverity[loop_top] - Application::Yield allows the timer to fire and toggle bBeenSlow
while (!bBeenSlow) while (!bBeenSlow)
Application::Yield(); Application::Yield();
// coverity[infinite_loop] // coverity[loop_top] - Application::Yield allows the timer to fire and increment nCount
while (nCount < 200) while (nCount < 200)
Application::Yield(); Application::Yield();
} }

View File

@ -122,6 +122,7 @@ void XMLChartOASISTransformerContext::StartElement(
OUString aAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey( OUString aAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey(
XML_NAMESPACE_CHART, XML_NAMESPACE_CHART,
GetXMLToken( XML_ADD_IN_NAME ) ) ); 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 ); pMutableAttrList->AddAttribute( aAttrQName, aAddInName );
} }

View File

@ -981,7 +981,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement(
aDrawMirrorAttrValue); aDrawMirrorAttrValue);
} }
if( bMoveProtect || bSizeProtect || !aProtectAttrValue.isEmpty() ) if (bMoveProtect || bSizeProtect || !aProtectAttrValue.isEmpty())
{ {
if( (bMoveProtect ||bSizeProtect) && IsXMLToken( aProtectAttrValue, XML_NONE ) ) if( (bMoveProtect ||bSizeProtect) && IsXMLToken( aProtectAttrValue, XML_NONE ) )
aProtectAttrValue = OUString(); aProtectAttrValue = OUString();
@ -1002,6 +1002,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement(
aProtectAttrValue += rSize; 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 ); pProtectContext->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_STYLE, GetXMLToken( XML_PROTECT ) ), aProtectAttrValue );
} }