Only use -Wv:18 in Visual Studio 2019

And fix the warnings discovered in Visual Studio 2022:

 C:/lo/core/cli_ure/source/uno_bridge/cli_proxy.cxx(714): warning C4456: declaration of 'numMethods' hides previous local declaration
 C:/lo/core/cli_ure/source/uno_bridge/cli_proxy.cxx(681): note: see declaration of 'numMethods'
 C:/lo/core/cli_ure/source/uno_bridge/cli_proxy.cxx(1032): warning C4457: declaration of 'pUnoI' hides function parameter
 C:/lo/core/cli_ure/source/uno_bridge/cli_proxy.cxx(918): note: see declaration of 'pUnoI'
 C:/lo/core/cli_ure/source/uno_bridge/cli_uno.cxx(109): warning C4456: declaration of 'param' hides previous local declaration
 C:/lo/core/cli_ure/source/uno_bridge/cli_uno.cxx(84): note: see declaration of 'param'
 C:/lo/core/cli_ure/source/uno_bridge/cli_uno.cxx(256): warning C4456: declaration of 'param' hides previous local declaration
 C:/lo/core/cli_ure/source/uno_bridge/cli_uno.cxx(240): note: see declaration of 'param'

Change-Id: I99abcf17c7c431a403a488c53b65ef34d66d0940
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169782
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Mike Kaganski 2024-07-01 12:38:03 +05:00
parent 263dc5c171
commit 7b428b1607
3 changed files with 11 additions and 11 deletions

View file

@ -711,7 +711,7 @@ void CliProxy::makeMethodInfos()
{
sr::InterfaceMapping mapInherited = objType->GetInterfaceMap(
arInheritedIfaces[nArLength - 1]);
int numMethods = mapInherited.TargetMethods->Length;
numMethods = mapInherited.TargetMethods->Length;
m_arInterfaceMethodCount[nArLength - 1] = numMethods;
for (int i = 0; i < numMethods; i++, index++)
{
@ -1029,11 +1029,11 @@ void SAL_CALL cli_proxy_dispatch(
OSL_ENSURE(usOid.equals( proxy->m_usOid ),
"### different oids!");
#endif
uno_Interface* pUnoI = bridge->map_cli2uno(
uno_Interface* pUnoI2 = bridge->map_cli2uno(
proxy->m_cliI, demanded_td.get() );
uno_any_construct(
(uno_Any *)uno_ret, &pUnoI, demanded_td.get(), 0 );
(*pUnoI->release)( pUnoI );
(uno_Any *)uno_ret, &pUnoI2, demanded_td.get(), 0 );
(*pUnoI2->release)( pUnoI2 );
}
else // object does not support demanded interface
{

View file

@ -106,10 +106,10 @@ System::Object^ Bridge::call_uno(uno_Interface * pUnoI,
// cleanup uno in args
for (sal_Int32 n = 0; n < nPos; ++n)
{
typelib_MethodParameter const & param = pParams[n];
if (param.bIn)
typelib_MethodParameter const & param2 = pParams[n];
if (param2.bIn)
{
uno_type_destructData(uno_args[n], param.pTypeRef, 0);
uno_type_destructData(uno_args[n], param2.pTypeRef, 0);
}
}
throw;
@ -253,9 +253,9 @@ void Bridge::call_cli(
// cleanup uno pure out
for ( sal_Int32 n = 0; n < nPos; ++n )
{
typelib_MethodParameter const & param = params[ n ];
if (! param.bIn)
uno_type_destructData( uno_args[ n ], param.pTypeRef, 0 );
typelib_MethodParameter const & param2 = params[ n ];
if (! param2.bIn)
uno_type_destructData( uno_args[ n ], param2.pTypeRef, 0 );
}
throw;
}

View file

@ -271,7 +271,7 @@ gb_CXXCLRFLAGS := \
-AI $(INSTDIR)/$(LIBO_URE_LIB_FOLDER) \
-EHa \
-clr \
-Wv:18 \
$(if $(filter 16.0,$(VCVER)),-Wv:18) \
-Zc:twoPhase- \
ifeq ($(COM_IS_CLANG),TRUE)