WaE: C6011 Dereferencing NULL pointer warnings

Change-Id: I2fddf8ae5803041344fe63c4375fe5a3ee46fed9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167520
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara
2024-05-12 12:49:33 +02:00
parent d4a110f8c2
commit 12099436f7
4 changed files with 14 additions and 13 deletions
+1 -1
View File
@@ -928,7 +928,7 @@ Assembly ^ TypeEmitter::type_resolve(
xReturnStruct->getTypeArguments();
if (seq_type_args.getLength() != 0)
{
//get th ctor of the attribute
//get the ctor of the attribute
array< ::System::Type^>^ arCtor = {::System::Type::GetType("System.Type[]")};
//Get the arguments for the attribute's ctor
int numTypes = seq_type_args.getLength();
+10 -10
View File
@@ -62,14 +62,14 @@ void SAL_CALL Mapping_cli2uno(
uno_Interface ** ppUnoI = (uno_Interface **)ppOut;
intptr_t cliI = (intptr_t)pIn;
OSL_ENSURE( ppUnoI && td, "### null ptr!" );
assert(ppUnoI && td && "### null ptr!");
if (0 != *ppUnoI)
{
uno_Interface * pUnoI = *(uno_Interface **)ppUnoI;
(*pUnoI->release)( pUnoI );
*ppUnoI = 0;
}
if (0 != *ppUnoI)
{
uno_Interface * pUnoI = *(uno_Interface **)ppUnoI;
(*pUnoI->release)( pUnoI );
*ppUnoI = 0;
}
try
{
Mapping const * that = static_cast< Mapping const * >( mapping );
@@ -95,7 +95,7 @@ void SAL_CALL Mapping_uno2cli(
{
try
{
OSL_ENSURE( td && ppOut, "### null ptr!" );
assert(td && ppOut && "### null ptr!");
OSL_ENSURE( (sizeof(System::Char) == sizeof(sal_Unicode))
&& (sizeof(System::Boolean) == sizeof(sal_Bool))
&& (sizeof(System::SByte) == sizeof(sal_Int8))
@@ -204,7 +204,7 @@ Bridge::Bridge(
m_uno_cli_env( uno_cli_env ),
m_registered_cli2uno( registered_cli2uno )
{
OSL_ASSERT( 0 != m_uno_cli_env && 0 != m_uno_env );
assert(m_uno_cli_env && m_uno_env);
(*((uno_Environment *)m_uno_env)->acquire)( (uno_Environment *)m_uno_env );
(*m_uno_cli_env->acquire)( m_uno_cli_env );
@@ -276,7 +276,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_ext_getMapping(
uno_Mapping ** ppMapping, uno_Environment * pFrom, uno_Environment * pTo )
SAL_THROW_EXTERN_C()
{
OSL_ASSERT( 0 != ppMapping && 0 != pFrom && 0 != pTo );
assert(ppMapping && pFrom && pTo);
if (*ppMapping)
{
(*(*ppMapping)->release)( *ppMapping );
+2 -1
View File
@@ -708,7 +708,7 @@ OUString mapCliTypeName(System::String^ typeName)
*/
inline System::String^ mapUnoString( rtl_uString const * data)
{
OSL_ASSERT(data);
assert(data);
return gcnew System::String((__wchar_t*) data->buffer, 0, data->length);
}
@@ -1593,6 +1593,7 @@ void Bridge::map_to_cli(
ctorInfo = arCtorInfo[i];
break;
}
assert(arParamInfo);
OSL_ASSERT(arParamInfo[0]->ParameterType->Equals(System::String::typeid)
&& arParamInfo[1]->ParameterType->Equals(System::Object::typeid)
&& arParamInfo[0]->Position == 0
+1 -1
View File
@@ -419,7 +419,7 @@ srrm::IMessage^ UnoInterfaceProxy::Invoke(srrm::IMessage^ callmsg)
System::Type^ typeBeingCalled = loadCliType(sTypeName);
UnoInterfaceInfo^ info = findInfo( typeBeingCalled );
OSL_ASSERT( nullptr != info );
assert(info);
// ToDo do without string conversion, an OUString is not needed here
// get the type description of the call