[Libreoffice-commits] core.git: bridges/source dbaccess/qa javaunohelper/test qadevOOo/runner qadevOOo/tests ridljar/com sfx2/qa solenv/gbuild wizards/com

2023-11-09 Thread Noel Grandin (via logerrit)
 bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java |  
  2 +-
 dbaccess/qa/complex/dbaccess/DatabaseDocument.java  |  
  1 +
 dbaccess/qa/complex/dbaccess/RowSet.java|  
  8 
 dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java |  
  2 +-
 dbaccess/qa/complex/dbaccess/TestCase.java  |  
  2 +-
 javaunohelper/test/com/sun/star/lib/uno/helper/InterfaceContainer_Test.java |  
  1 +
 qadevOOo/runner/util/ValueChanger.java  |  
  1 +
 qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java|  
  3 ++-
 qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java   |  
  1 +
 qadevOOo/tests/java/ifc/io/_XDataInputStream.java   |  
  4 ++--
 qadevOOo/tests/java/ifc/io/_XDataOutputStream.java  |  
  1 +
 qadevOOo/tests/java/ifc/sdbc/_XParameters.java  |  
  1 +
 qadevOOo/tests/java/ifc/sdbc/_XRow.java |  
  1 +
 qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java   |  
  1 +
 qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java  |  
  1 +
 qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java   |  
  1 +
 ridljar/com/sun/star/lib/util/WeakMap.java  |  
  4 
 sfx2/qa/complex/sfx2/UndoManager.java   |  
  1 +
 solenv/gbuild/JavaClassSet.mk   |  
  3 ++-
 wizards/com/sun/star/wizards/ui/ButtonList.java |  
  1 +
 20 files changed, 29 insertions(+), 11 deletions(-)

New commits:
commit eee1ff965143910eb52895af471b260564938db6
Author: Noel Grandin 
AuthorDate: Thu Nov 9 11:07:34 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 9 14:27:47 2023 +0100

enable unchecked lint for our java code

and annotate where necessary, mostly just suppressing the warnings

Change-Id: I8e39d797cde6c7c3f4e3e1bd93a128965ecec81d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159205
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git 
a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java 
b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java
index 12817e57eeda..200f664f32c3 100644
--- a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java
+++ b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java
@@ -139,7 +139,7 @@ public final class JNI_proxy implements 
java.lang.reflect.InvocationHandler
 public static java.lang.reflect.Constructor get_proxy_ctor( Class clazz )
 throws Throwable
 {
-Class proxy_class = java.lang.reflect.Proxy.getProxyClass(
+Class proxy_class = java.lang.reflect.Proxy.getProxyClass(
 s_classloader,
 new Class [] { clazz, IQueryInterface.class,
com.sun.star.lib.uno.Proxy.class } );
diff --git a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java 
b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
index 5bd28053b77c..3087ad6374c2 100644
--- a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
+++ b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
@@ -174,6 +174,7 @@ public class DatabaseDocument extends TestCase implements 
com.sun.star.document.
 };
 }
 
+@SuppressWarnings("unchecked")
 public void dispose()
 {
 final EventObject event = new EventObject(this);
diff --git a/dbaccess/qa/complex/dbaccess/RowSet.java 
b/dbaccess/qa/complex/dbaccess/RowSet.java
index 4c5fcc6da793..ed42a271b46f 100644
--- a/dbaccess/qa/complex/dbaccess/RowSet.java
+++ b/dbaccess/qa/complex/dbaccess/RowSet.java
@@ -365,7 +365,7 @@ public class RowSet extends TestCase
 m_rowSet.addRowSetListener(pRow);
 
 // do some movements to check if we got all notifications
-final Class cResSet = Class.forName("com.sun.star.sdbc.XResultSet");
+final Class cResSet = Class.forName("com.sun.star.sdbc.XResultSet");
 final boolean moves[] = new boolean[9];
 for (int i = 0; i < moves.length; ++i)
 {
@@ -399,7 +399,7 @@ public class RowSet extends TestCase
 testCursorMove(m_resultSet, cResSet.getMethod(NEXT, (Class[]) null), 
pRow, moves, null);
 
 moves[RowSetEventListener.IS_MODIFIED] = false;
-final Class cupd = Class.forName("com.sun.star.sdbc.XResultSetUpdate");
+final Class cupd = 
Class.forName("com.sun.star.sdbc.XResultSetUpdate");
 final XResultSetUpdate upd = UnoRuntime.queryInterface( 
XResultSetUpdate.class, m_resultSet );
 testCursorMove(upd, cupd.getMethod("moveToInsertRow", (Class[]) null), 
pRow, moves, null);
 
@@ -445,7 +445,7 @@ 

[Libreoffice-commits] core.git: bridges/source

2023-09-12 Thread Dan Horák (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx |   58 ++--
 1 file changed, 52 insertions(+), 6 deletions(-)

New commits:
commit 6d24e32d0278e1e71cbd1bfdc16899659e47b2a2
Author: Dan Horák 
AuthorDate: Tue Sep 12 10:20:51 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Sep 12 19:42:54 2023 +0200

bridge/powerpc64: fix integer ABI

The ABI document for PowerPC64 specifies that integer values shorter than
a doubleword are sign or zero extended as necessary. Until now the smaller
values were treated as unsigned values and only zero-extended. Handling of
signed values was incorrect.

Change-Id: Icbbe8fc8d4facfa6d1b3252c99ec2d8c2552d9f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156847
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
index 4bb4270806b8..37d75659fdb6 100644
--- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
@@ -256,6 +256,14 @@ static void callVirtualMethod(void * pThis, sal_uInt32 
nVtableIndex,
 *pDS++ = *reinterpret_cast( pSV ); // verbatim!
 
 #define INSERT_INT64( pSV, nr, pGPR, pDS, bOverflow ) \
+if ( nr < ppc64::MAX_GPR_REGS ) \
+pGPR[nr++] = *reinterpret_cast( pSV ); \
+else \
+bOverflow = true; \
+if (bOverflow) \
+*pDS++ = *reinterpret_cast( pSV );
+
+#define INSERT_UINT64( pSV, nr, pGPR, pDS, bOverflow ) \
 if ( nr < ppc64::MAX_GPR_REGS ) \
 pGPR[nr++] = *reinterpret_cast( pSV ); \
 else \
@@ -264,6 +272,14 @@ static void callVirtualMethod(void * pThis, sal_uInt32 
nVtableIndex,
 *pDS++ = *reinterpret_cast( pSV );
 
 #define INSERT_INT32( pSV, nr, pGPR, pDS, bOverflow ) \
+if ( nr < ppc64::MAX_GPR_REGS ) \
+pGPR[nr++] = *reinterpret_cast( pSV ); \
+else \
+bOverflow = true; \
+if (bOverflow) \
+*pDS++ = *reinterpret_cast( pSV );
+
+#define INSERT_UINT32( pSV, nr, pGPR, pDS, bOverflow ) \
 if ( nr < ppc64::MAX_GPR_REGS ) \
 pGPR[nr++] = *reinterpret_cast( pSV ); \
 else \
@@ -272,6 +288,14 @@ static void callVirtualMethod(void * pThis, sal_uInt32 
nVtableIndex,
 *pDS++ = *reinterpret_cast( pSV );
 
 #define INSERT_INT16( pSV, nr, pGPR, pDS, bOverflow ) \
+if ( nr < ppc64::MAX_GPR_REGS ) \
+pGPR[nr++] = *reinterpret_cast( pSV ); \
+else \
+bOverflow = true; \
+if (bOverflow) \
+*pDS++ = *reinterpret_cast( pSV );
+
+#define INSERT_UINT16( pSV, nr, pGPR, pDS, bOverflow ) \
 if ( nr < ppc64::MAX_GPR_REGS ) \
 pGPR[nr++] = *reinterpret_cast( pSV ); \
 else \
@@ -280,6 +304,14 @@ static void callVirtualMethod(void * pThis, sal_uInt32 
nVtableIndex,
 *pDS++ = *reinterpret_cast( pSV );
 
 #define INSERT_INT8( pSV, nr, pGPR, pDS, bOverflow ) \
+if ( nr < ppc64::MAX_GPR_REGS ) \
+pGPR[nr++] = *reinterpret_cast( pSV ); \
+else \
+bOverflow = true; \
+if (bOverflow) \
+*pDS++ = *reinterpret_cast( pSV );
+
+#define INSERT_UINT8( pSV, nr, pGPR, pDS, bOverflow ) \
 if ( nr < ppc64::MAX_GPR_REGS ) \
 pGPR[nr++] = *reinterpret_cast( pSV ); \
 else \
@@ -339,7 +371,7 @@ static void cpp_call(
 #if OSL_DEBUG_LEVEL > 2
 fprintf(stderr, "pCppReturn/pUnoReturn is %p/%p\n", pCppReturn, 
pUnoReturn);
 #endif
-INSERT_INT64( , nGPR, pGPR, pStack, bOverflow );
+INSERT_UINT64( , nGPR, pGPR, pStack, bOverflow );
 }
 }
 // push "this" pointer
@@ -347,7 +379,7 @@ static void cpp_call(
 #if OSL_DEBUG_LEVEL > 2
 fprintf(stderr, "this pointer is %p\n", pAdjustedThisPtr);
 #endif
-INSERT_INT64( , nGPR, pGPR, pStack, bOverflow );
+INSERT_UINT64( , nGPR, pGPR, pStack, bOverflow );
 
 // Args
 void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams );
@@ -380,26 +412,40 @@ static void cpp_call(
 switch (pParamTypeDescr->eTypeClass)
 {
 case typelib_TypeClass_HYPER:
-case typelib_TypeClass_UNSIGNED_HYPER:
 #if OSL_DEBUG_LEVEL > 2
 fprintf(stderr, "hyper is 0x%lx\n", 
*(sal_Int64 *)pCppArgs[nPos]);
 #endif
 INSERT_INT64( pCppArgs[nPos], nGPR, pGPR, 
pStack, bOverflow );
 break;
+case typelib_TypeClass_UNSIGNED_HYPER:
+#if OSL_DEBUG_LEVEL > 2
+fprintf(stderr, "uhyper is 0x%lx\n", 
*(sal_Int64 *)pCppArgs[nPos]);
+#endif
+

[Libreoffice-commits] core.git: bridges/source

2023-09-12 Thread Dan Horák (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx |   20 +---
 1 file changed, 12 insertions(+), 8 deletions(-)

New commits:
commit f171d5cb322ed99b3c4cd6c0b18abbf03882ec98
Author: Dan Horák 
AuthorDate: Tue Sep 12 10:04:47 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Sep 12 17:46:49 2023 +0200

bridge: modernize printf debugging in powerpc64

Use correct types and also typecasts to avoid compiler warnings.

Change-Id: I3b58ec6a4be54ecd8bc07a7febbaf721eba9b945
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156846
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
index 612495d83395..4bb4270806b8 100644
--- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
@@ -161,13 +161,13 @@ static void callVirtualMethod(void * pThis, sal_uInt32 
nVtableIndex,
 // Let's figure out what is really going on here
 {
 fprintf( stderr, "= callVirtualMethod() =\nGPR's (%d): ", nGPR 
);
-for ( int i = 0; i < nGPR; ++i )
+for ( sal_uInt32 i = 0; i < nGPR; ++i )
 fprintf( stderr, "0x%lx, ", pGPR[i] );
 fprintf( stderr, "\nFPR's (%d): ", nFPR );
-for ( int i = 0; i < nFPR; ++i )
-fprintf( stderr, "0x%lx (%f), ", pFPR[i], pFPR[i] );
+for ( sal_uInt32 i = 0; i < nFPR; ++i )
+fprintf( stderr, "0x%lx (%lf), ", (sal_Int64)pFPR[i], 
pFPR[i] );
 fprintf( stderr, "\nStack (%d): ", nStack );
-for ( int i = 0; i < nStack; ++i )
+for ( sal_uInt32 i = 0; i < nStack; ++i )
 fprintf( stderr, "0x%lx, ", pStack[i] );
 fprintf( stderr, "\n" );
 }
@@ -294,6 +294,10 @@ static void cpp_call(
 sal_Int32 nParams, typelib_MethodParameter * pParams,
 void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc )
 {
+#if OSL_DEBUG_LEVEL > 2
+fprintf( stderr, "= cpp_call() =\n" );
+#endif
+
   // max space for: [complex ret ptr], values|ptr ...
   sal_uInt64 * pStack = (sal_uInt64 *)alloca( (nParams+3) * 
sizeof(sal_Int64) );
   sal_uInt64 * pStackStart = pStack;
@@ -333,7 +337,7 @@ static void cpp_call(
 pCppReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( 
pReturnTypeDescr )
? alloca( pReturnTypeDescr->nSize ) : pUnoReturn);
 #if OSL_DEBUG_LEVEL > 2
-fprintf(stderr, "pCppReturn/pUnoReturn is %lx/%lx", pCppReturn, 
pUnoReturn);
+fprintf(stderr, "pCppReturn/pUnoReturn is %p/%p\n", pCppReturn, 
pUnoReturn);
 #endif
 INSERT_INT64( , nGPR, pGPR, pStack, bOverflow );
 }
@@ -378,7 +382,7 @@ static void cpp_call(
 case typelib_TypeClass_HYPER:
 case typelib_TypeClass_UNSIGNED_HYPER:
 #if OSL_DEBUG_LEVEL > 2
-fprintf(stderr, "hyper is %lx\n", 
pCppArgs[nPos]);
+fprintf(stderr, "hyper is 0x%lx\n", 
*(sal_Int64 *)pCppArgs[nPos]);
 #endif
 INSERT_INT64( pCppArgs[nPos], nGPR, pGPR, 
pStack, bOverflow );
 break;
@@ -386,7 +390,7 @@ static void cpp_call(
 case typelib_TypeClass_UNSIGNED_LONG:
 case typelib_TypeClass_ENUM:
 #if OSL_DEBUG_LEVEL > 2
-fprintf(stderr, "long is %x\n", 
pCppArgs[nPos]);
+fprintf(stderr, "long is 0x%x\n", *(sal_Int32 
*)pCppArgs[nPos]);
 #endif
 INSERT_INT32( pCppArgs[nPos], nGPR, pGPR, 
pStack, bOverflow );
 break;
@@ -448,7 +452,7 @@ static void cpp_call(
 else // direct way
 {
 #if OSL_DEBUG_LEVEL > 2
-fprintf(stderr, "that one, passing %lx through\n", 
pUnoArgs[nPos]);
+fprintf(stderr, "that one, passing %p through\n", 
pUnoArgs[nPos]);
 #endif
 pCppArgs[nPos] = pUnoArgs[nPos];
 // no longer needed


[Libreoffice-commits] core.git: bridges/source

2023-08-03 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 3bcc14b4e2b226f97e937ca7a152218f8276ee39
Author: Stephan Bergmann 
AuthorDate: Thu Aug 3 13:21:44 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Aug 3 14:48:33 2023 +0200

Fix handling of float vs. double values

...which had been broken ever since f424e55b4e66ffbee5b34f45ef5ea18d77c4d15c
"INTEGRATION: CWS sixtyfour11 (1.7.22); FILE MERGED" had merged the
typelib_TypeClass_FLOAT case into the typelib_TypeClass_DOUBLE case, and 
which
caused

> ==612573==ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on 
address 0x7fff4e6b0700 at pc 0x7f45a9d77d9e bp 0x7fff4e6af3f0 sp 0x7fff4e6af3e8
> WRITE of size 8 at 0x7fff4e6b0700 thread T0
>  #0 in gcc3::callVirtualMethod(void*, unsigned int, void*, 
_typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, 
unsigned long*, double*) at 
bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:155:51 
(instdir/program/libgcc3_uno.so +0x118d9d)
>  #1 in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, 
bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, 
_typelib_MethodParameter*, void*, void**, _uno_Any**) at 
bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233:13 
(instdir/program/libgcc3_uno.so +0x112c1e)
>  #2 in unoInterfaceProxyDispatch at 
bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:330:13 
(instdir/program/libgcc3_uno.so +0x10e333)
>  #3 in stoc_corefl::(anonymous 
namespace)::IdlAttributeFieldImpl::get(com::sun::star::uno::Any const&) at 
stoc/source/corereflection/criface.cxx:141:9 
(instdir/program/libreflectionlo.so +0x1f89e0)
>  #4 in non-virtual thunk to stoc_corefl::(anonymous 
namespace)::IdlAttributeFieldImpl::get(com::sun::star::uno::Any const&) at 
stoc/source/corereflection/criface.cxx (instdir/program/libreflectionlo.so 
+0x1fc5fb)
>  #5 in 
cppu::PropertySetMixinImpl::Impl::getProperty(com::sun::star::uno::Reference
 const&, rtl::OUString const&, com::sun::star::beans::PropertyState*) const at 
cppuhelper/source/propertysetmixin.cxx:563:24 
(instdir/program/libuno_cppuhelpergcc3.so.3 +0x7d5059)
>  #6 in cppu::PropertySetMixinImpl::getPropertyValue(rtl::OUString const&) 
at cppuhelper/source/propertysetmixin.cxx:994:20 
(instdir/program/libuno_cppuhelpergcc3.so.3 +0x7e462f)
>  #7 in reportdesign::OFixedText::getPropertyValue(rtl::OUString const&) 
at reportdesign/source/core/api/FixedText.cxx:143:34 
(instdir/program/../program/librptlo.so +0x7452ad)
>  #8 in non-virtual thunk to 
reportdesign::OFixedText::getPropertyValue(rtl::OUString const&) at 
reportdesign/source/core/api/FixedText.cxx 
(instdir/program/../program/librptlo.so +0x7452eb)
>  #9 in 
rptui::OPropertyMediator::OPropertyMediator(com::sun::star::uno::Reference
 const&, com::sun::star::uno::Reference 
const&, std::__debug::map>, std::less, 
std::allocator&&, bool) at 
reportdesign/source/core/sdr/PropertyForward.cxx:68:119 
(instdir/program/../program/librptlo.so +0xbbbdb7)
>  #10 in rptui::OUnoObject::CreateMediator(bool) at 
reportdesign/source/core/sdr/RptObject.cxx:878:31 
(instdir/program/../program/librptlo.so +0xc16451)
>
> Address 0x7fff4e6b0700 is located in stack of thread T0 at offset 4288 in 
frame
>  #0 in gcc3::callVirtualMethod(void*, unsigned int, void*, 
_typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, 
unsigned long*, double*) at 
bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:50 
(instdir/program/libgcc3_uno.so +0x1181d7)
>
>   This frame has 3 object(s):
> [32, 104) 'data' (line 53)
> [144, 160) 'longs' (line 162)
> [176, 192) 'doubles' (line 166) <== Memory access at offset 4288 
overflows this variable
> HINT: this may be a false positive if your program uses some custom stack 
unwind mechanism, swapcontext or vfork
>   (longjmp and C++ exceptions *are* supported)
> SUMMARY: AddressSanitizer: dynamic-stack-buffer-overflow 
bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:155:51 in 
gcc3::callVirtualMethod(void*, unsigned int, void*, 
_typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, 
unsigned long*, double*)
> Shadow bytes around the buggy address:
>   0x7fff4e6b0480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x7fff4e6b0500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x7fff4e6b0580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x7fff4e6b0600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x7fff4e6b0680: 00 00 00 00 00 00 00 00 00 00 00 00 ca ca ca ca
> =>0x7fff4e6b0700:[04]cb cb cb cb cb cb cb 00 00 00 00 00 00 00 00
>   0x7fff4e6b0780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x7fff4e6b0800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   

[Libreoffice-commits] core.git: bridges/source

2023-07-31 Thread Sakura286 (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx |   26 +++---
 1 file changed, 23 insertions(+), 3 deletions(-)

New commits:
commit 2c258079113eae993fdaff113ba082455c920f89
Author: Sakura286 
AuthorDate: Mon Jul 24 16:47:16 2023 +0800
Commit: Stephan Bergmann 
CommitDate: Mon Jul 31 12:59:19 2023 +0200

fix 32 bit int simple return of riscv64 bridge

Sometimes we need to return a 32 bit integer into a 64 bit integer.
For example, in pyuno.cxx:PyUNO_bool(), an int(32bit) is returned in
type Py_ssize_t(64bit). We assume that this 32bit int was put in low
32 bit of register a0. The bridge may return with high 32 bit
uncleaned and compiler might directly bind this register to 64 bit
variable in error.

This bug produces when build pyuno with gcc-12 with -O2.
https://bugs.documentfoundation.org/show_bug.cgi?id=155937
https://lists.debian.org/debian-riscv/2023/07/msg00011.html

So we need to clean the high 32 bit in bridge.

Change-Id: I37aafb03ba9523cfb90912871308921fbeaf5f0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154837
Tested-by: René Engelhard 
Reviewed-by: René Engelhard 
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx
index 16f6ba27c0f4..99965c570081 100644
--- a/bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx
@@ -357,8 +357,6 @@ cpp2uno_call(bridges::cpp_uno::shared::CppInterfaceProxy* 
pThis,
 {
 case typelib_TypeClass_HYPER:
 case typelib_TypeClass_UNSIGNED_HYPER:
-case typelib_TypeClass_LONG:
-case typelib_TypeClass_UNSIGNED_LONG:
 case typelib_TypeClass_ENUM:
 case typelib_TypeClass_CHAR:
 case typelib_TypeClass_SHORT:
@@ -367,6 +365,28 @@ cpp2uno_call(bridges::cpp_uno::shared::CppInterfaceProxy* 
pThis,
 case typelib_TypeClass_BYTE:
 std::memcpy(pReturn, pUnoReturn, 8);
 break;
+// Sometimes we need to return a 32 bit integer into a 64 
bit integer.
+// For example, in pyuno.cxx:PyUNO_bool(), an int(32bit) 
is returned
+// in type Py_ssize_t(64bit)
+// We assume that this 32bit int was put in low 32 bit of 
register a0.
+// The bridge may return with high 32 bit uncleaned and 
compiler might
+// directly bind this register to 64 bit variable.
+//
+// This bug occurs when build pyuno with gcc-12 with -O2.
+// 
https://bugs.documentfoundation.org/show_bug.cgi?id=155937
+//
+// So we need to clean the high 32 bit in bridge.
+case typelib_TypeClass_UNSIGNED_LONG:
+std::memset(pReturn + 4, 0x0, 4);
+std::memcpy(pReturn, pUnoReturn, 4);
+break;
+case typelib_TypeClass_LONG:
+if (*reinterpret_cast(pUnoReturn) & 
0x8000)
+std::memset(pReturn + 4, 0xFF, 4);
+else
+std::memset(pReturn + 4, 0x0, 4);
+std::memcpy(pReturn, pUnoReturn, 4);
+break;
 case typelib_TypeClass_FLOAT:
 std::memcpy(pReturn, pUnoReturn, 4);
 std::memset(pReturn + 4, 0xFF, 4);
@@ -628,7 +648,7 @@ unsigned char* codeSnippet(unsigned char* code, sal_Int32 
functionIndex, sal_Int
 
 /* generate this code */
 /*
-   It is complex to load a 64bit address because uou cannot load
+   It is complex to load a 64bit address because you cannot load
an unsigned number to register on RISC-V.
# load functionIndex to t4
  0eb7   lui  t4,0x0


[Libreoffice-commits] core.git: bridges/source

2023-04-20 Thread Tor Lillqvist (via logerrit)
 bridges/source/cpp_uno/gcc3_ios/unwind-cxx.h |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 153263957b22e2d5f76f951366d44c182c22c260
Author: Tor Lillqvist 
AuthorDate: Thu Apr 20 17:43:03 2023 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Apr 20 21:35:01 2023 +0200

Fix compilation with latest Xcode with iOS SDK 16.4

Alternatively we could just remove lots of stuff that we apparently
don't actually need from this file, including the problematic typedef
and its uses.

_Unwind_Exception_Class now gets typedeffed in  as
uint64_t which effectively is the same as the unsigned
__attribute__((__mode__(__DI__))) that is used here.

Change-Id: Id96d43eb481ee4ae97dd315aa2fd741e5f627916
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150702
Reviewed-by: Patrick Luby 
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/bridges/source/cpp_uno/gcc3_ios/unwind-cxx.h 
b/bridges/source/cpp_uno/gcc3_ios/unwind-cxx.h
index 83ed084860fd..aa35a5bc75e6 100644
--- a/bridges/source/cpp_uno/gcc3_ios/unwind-cxx.h
+++ b/bridges/source/cpp_uno/gcc3_ios/unwind-cxx.h
@@ -46,7 +46,9 @@ typedef unsigned _Unwind_Word 
__attribute__((__mode__(__word__)));
 typedef signed   _Unwind_Sword __attribute__((__mode__(__word__)));
 typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
 typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
+#if !defined __IPHONE_16_4 || __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_16_4
 typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
+#endif
 typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
 
 #pragma GCC visibility push(default)


[Libreoffice-commits] core.git: bridges/source

2023-04-19 Thread Christian Lohmaier (via logerrit)
 bridges/source/cpp_uno/msvc_win32_arm64/callvirtualfunction.S |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 1e273de12710eabf908495d341311da93701868f
Author: Christian Lohmaier 
AuthorDate: Tue Apr 18 15:17:36 2023 +0200
Commit: Christian Lohmaier 
CommitDate: Wed Apr 19 11:50:45 2023 +0200

win/aarch64: fix offset loading simple values into the registers

the stack variable doesn't point to the beginning of the array with the
values, instead the code creates a large general purpose register array 
(gpr)
with the floating point register (fpr) and stack just being offsets in
that one.
bridge isn't fully working with that fix yet, still some wrong pointers
ending up in the interface reference

Change-Id: I6f1e5f84f84aff34663090c20fe70d65e0a7a334
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150578
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/bridges/source/cpp_uno/msvc_win32_arm64/callvirtualfunction.S 
b/bridges/source/cpp_uno/msvc_win32_arm64/callvirtualfunction.S
index e03bff1d2d55..a058e47d0038 100644
--- a/bridges/source/cpp_uno/msvc_win32_arm64/callvirtualfunction.S
+++ b/bridges/source/cpp_uno/msvc_win32_arm64/callvirtualfunction.S
@@ -42,15 +42,15 @@
 str   x3, [x29, #16]  // save rvalue
 
 // load the core argument passing registers
-ldp   x0, x1, [sp, #0]
-ldp   x2, x3, [sp, #16]
-ldp   x4, x5, [sp, #32]
-ldp   x6, x7, [sp, #48]
-
-ldp   d0, d1, [sp, #64]
-ldp   d2, d3, [sp, #80]
-ldp   d4, d5, [sp, #96]
-ldp   d6, d7, [sp, #112]
+ldp   x0, x1, [sp, #-128]
+ldp   x2, x3, [sp, #-112]
+ldp   x4, x5, [sp, #-96]
+ldp   x6, x7, [sp, #-80]
+
+ldp   d0, d1, [sp, #-64]
+ldp   d2, d3, [sp, #-48]
+ldp   d4, d5, [sp, #-32]
+ldp   d6, d7, [sp, #-16]
 
 blr   x9  // call
 


[Libreoffice-commits] core.git: bridges/source

2023-04-17 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/msvc_shared/except.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 1f8c3839dfc7e633c74da905593821f7681e2e66
Author: Stephan Bergmann 
AuthorDate: Mon Apr 17 08:49:20 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Apr 17 11:42:23 2023 +0200

loplugin:stringadd

Change-Id: I10b450bccf27304530767cf80e0a6b04768cfc80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150468
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/msvc_shared/except.cxx 
b/bridges/source/cpp_uno/msvc_shared/except.cxx
index f76533fa160e..b68dd41d6bdc 100644
--- a/bridges/source/cpp_uno/msvc_shared/except.cxx
+++ b/bridges/source/cpp_uno/msvc_shared/except.cxx
@@ -75,8 +75,7 @@ static OUString toRTTIname(OUString const& rUNOname) noexcept
 while (nPos > 0)
 {
 sal_Int32 n = rUNOname.lastIndexOf('.', nPos);
-aRet.append(rUNOname.subView(n + 1, nPos - n - 1));
-aRet.append('@');
+aRet.append(OUString::Concat(rUNOname.subView(n + 1, nPos - n - 1)) + 
"@");
 nPos = n;
 }
 aRet.append('@');


[Libreoffice-commits] core.git: bridges/source

2023-04-11 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit fe0fbb166233b53d43e1eab61d110c37bac2fb5a
Author: Stephan Bergmann 
AuthorDate: Tue Apr 11 15:58:09 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Apr 11 20:44:42 2023 +0200

loplugin:stringadd

Change-Id: Ib35058e0e8d1708c29f4fe727eda05f5a6de4ab4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150232
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index ff50e62dd026..dcd27e95ae30 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -95,14 +95,12 @@ std::type_info * Rtti::getRtti(typelib_TypeDescription 
const & type) {
 osl::MutexGuard g(mutex_);
 Map::iterator i(map_.find(unoName));
 if (i == map_.end()) {
-OStringBuffer b;
-b.append("_ZTIN");
+OStringBuffer b("_ZTIN");
 for (sal_Int32 j = 0; j != -1;) {
 OString t(
 OUStringToOString(
 o3tl::getToken(unoName, 0, '.', j), 
RTL_TEXTENCODING_ASCII_US));
-b.append(t.getLength());
-b.append(t);
+b.append(OString::number(t.getLength()) + t);
 }
 b.append('E');
 OString sym(b.makeStringAndClear());


[Libreoffice-commits] core.git: bridges/source

2023-03-22 Thread Ilmari Lauhakangas (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 2252313a90b6561f2746e05dae99551701550201
Author: Ilmari Lauhakangas 
AuthorDate: Mon Mar 20 14:26:58 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Mar 22 19:28:23 2023 +

bridges: drop unnecessary debug message

Change-Id: I4c08ea2e464164351ba66a4c04ef2575e3f5f580
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149157
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx
index 11d60fdeab44..986be00c6fc5 100644
--- a/bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx
@@ -369,9 +369,6 @@ static typelib_TypeClass cpp_mediate(
 
 TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] );
 
-OString cstr( OUStringToOString( aMemberDescr.get()->pTypeName, 
RTL_TEXTENCODING_ASCII_US ) );
-SAL_WARN("bridges", "calling " << cstr.getStr() << ", nFunctionIndex=" << 
nFunctionIndex);
-
 typelib_TypeClass eRet;
 switch (aMemberDescr.get()->eTypeClass)
 {


[Libreoffice-commits] core.git: bridges/source

2023-03-22 Thread Yousef_Rabia (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_mips64/except.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit a76ef6e4cb345d6aa70f4808188fce0ceacb
Author: Yousef_Rabia 
AuthorDate: Sun Mar 19 12:03:31 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Mar 22 07:54:53 2023 +

tdf#130924 : replace debugging printf calls with SAL_INFO/SAL_WARN

Change-Id: I94686f820e264867643bb30c83367ee702d3118d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149088
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_mips64/except.cxx 
b/bridges/source/cpp_uno/gcc3_linux_mips64/except.cxx
index ca94243d06fe..4e8ab0f2e466 100644
--- a/bridges/source/cpp_uno/gcc3_linux_mips64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_mips64/except.cxx
@@ -154,9 +154,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription 
*pTypeDescr )
 // symbol and rtti-name is nearly identical,
 // the symbol is prefixed with _ZTI
 char const * rttiName = symName.getStr() +4;
-#if defined BRIDGES_DEBUG
-fprintf( stderr,"generated rtti for %s\n", rttiName );
-#endif
+SAL_INFO("bridges", "generated rtti for " << rttiName);
+
 if (pTypeDescr->pBaseTypeDescription)
 {
 // ensure availability of base


[Libreoffice-commits] core.git: bridges/source sc/source

2023-03-18 Thread ektagoel12 (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx |4 +---
 sc/source/filter/excel/xestream.cxx   |7 +++
 2 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 307b1cc494c51c802882ae23029e33a72d57f2a3
Author: ektagoel12 
AuthorDate: Mon Mar 13 19:51:25 2023 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Sat Mar 18 16:39:34 2023 +

tdf#130924 replace debugging fprintf calls with SAL_INFO/SAL_WARN

Change-Id: I1893e130af2584c1d57c3e37ee3f3ff18c07c077
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148792
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx
index f455be45dc88..11d60fdeab44 100644
--- a/bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx
@@ -369,10 +369,8 @@ static typelib_TypeClass cpp_mediate(
 
 TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] );
 
-#if defined BRIDGES_DEBUG
 OString cstr( OUStringToOString( aMemberDescr.get()->pTypeName, 
RTL_TEXTENCODING_ASCII_US ) );
-fprintf( stderr, "calling %s, nFunctionIndex=%d\n", cstr.getStr(), 
nFunctionIndex );
-#endif
+SAL_WARN("bridges", "calling " << cstr.getStr() << ", nFunctionIndex=" << 
nFunctionIndex);
 
 typelib_TypeClass eRet;
 switch (aMemberDescr.get()->eTypeClass)
diff --git a/sc/source/filter/excel/xestream.cxx 
b/sc/source/filter/excel/xestream.cxx
index 467dfefd278f..374743786212 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -593,10 +593,9 @@ void XclExpBiff8Encrypter::EncryptBytes( SvStream& rStrm, 
vector& aBy
 sal_uInt16 nBlockOffset = GetOffsetInBlock(nStrmPos);
 sal_uInt32 nBlockPos = GetBlockPos(nStrmPos);
 
-#if DEBUG_XL_ENCRYPTION
-fprintf(stdout, "XclExpBiff8Encrypter::EncryptBytes: stream pos = %ld  
offset in block = %d  block pos = %ld\n",
-nStrmPos, nBlockOffset, nBlockPos);
-#endif
+SAL_INFO("sc.filter", "XclExpBiff8Encrypter::EncryptBytes: stream pos = "
+  << nStrmPos << " offset in block = " << 
nBlockOffset
+  << " block pos = " << nBlockPos);
 
 sal_uInt16 nSize = static_cast< sal_uInt16 >( aBytes.size() );
 if (nSize == 0)


[Libreoffice-commits] core.git: bridges/source

2023-03-18 Thread Ilmari Lauhakangas (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3e6c9ff68fafadc3d445720df2438d4e370cc816
Author: Ilmari Lauhakangas 
AuthorDate: Sat Mar 18 12:25:23 2023 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Sat Mar 18 10:28:35 2023 +

bridges: add whitespace to SAL_INFO

Missed in 7a8ec6cddc9f37ba6ff1a98ad39702521c8fb36b

Change-Id: I70b73873f20814d25c34f326a6552e72f57b3e28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149081
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
index 9fa6810d44da..9bce77bc8468 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
@@ -156,7 +156,7 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription 
const & pTypeDescr)
 // the symbol is prefixed with _ZTI
 char const * rttiName = symName.getStr() +4;
 
-SAL_INFO("bridges", "Generated rtti for" << rttiName);
+SAL_INFO("bridges", "Generated rtti for " << rttiName);
 
 std::unique_ptr newRtti;
 switch (pTypeDescr.eTypeClass) {


[Libreoffice-commits] core.git: bridges/source

2023-03-02 Thread Arnaud Versini (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx |2 --
 bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx   |2 --
 bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx|4 
 3 files changed, 8 deletions(-)

New commits:
commit 4825d1f15585211a942ed711d1b372b77b718ce7
Author: Arnaud Versini 
AuthorDate: Sat Feb 25 04:50:21 2023 +0100
Commit: Noel Grandin 
CommitDate: Thu Mar 2 14:10:58 2023 +

bridge linux x86-64 : remove useless includes

Change-Id: Ibd3b9a76b700a5efbf7855454714646daf612d13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147675
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx
index 680e8da819f2..b0f699dba1c7 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx
@@ -19,8 +19,6 @@
 
 #include 
 
-#include 
-
 #include 
 #include 
 #include 
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
index 7466d0e225bc..bd6d9e61796d 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
@@ -18,8 +18,6 @@
  */
 
 
-#include 
-#include 
 #include 
 
 #include 
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
index 2a92dba37475..daee12731ef1 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
@@ -17,10 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
-#include 
-#include 
-
 #include 
 #include 
 


[Libreoffice-commits] core.git: bridges/source

2023-02-01 Thread Noel Grandin (via logerrit)
 bridges/source/jni_uno/jni_bridge.cxx|2 +-
 bridges/source/jni_uno/jni_java2uno.cxx  |2 +-
 bridges/source/jni_uno/jniunoenvironmentdata.hxx |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 5233bc74ea6c66795b5e5299e6ce554de877ef8a
Author: Noel Grandin 
AuthorDate: Wed Feb 1 15:56:51 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 2 06:59:36 2023 +

osl::Mutex->std::mutex in JniUnoEnvironmentData

Change-Id: Iab6d430af7afc0d21e118b05d64a15664fc2f677
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146469
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/jni_uno/jni_bridge.cxx 
b/bridges/source/jni_uno/jni_bridge.cxx
index be2e3d37ec12..5e09a8899690 100644
--- a/bridges/source/jni_uno/jni_bridge.cxx
+++ b/bridges/source/jni_uno/jni_bridge.cxx
@@ -428,7 +428,7 @@ static void java_env_dispose(uno_Environment * env) {
 
 jobject async;
 {
-osl::MutexGuard g(envData->mutex);
+std::unique_lock g(envData->mutex);
 async = envData->asynchronousFinalizer;
 envData->asynchronousFinalizer = nullptr;
 }
diff --git a/bridges/source/jni_uno/jni_java2uno.cxx 
b/bridges/source/jni_uno/jni_java2uno.cxx
index 5edb2b7b3453..53f761e82657 100644
--- a/bridges/source/jni_uno/jni_java2uno.cxx
+++ b/bridges/source/jni_uno/jni_java2uno.cxx
@@ -74,7 +74,7 @@ jobject Bridge::map_to_java(
 auto * envData = static_cast(
 m_java_env->pContext);
 {
-osl::MutexGuard g(envData->mutex);
+std::unique_lock g(envData->mutex);
 args2[ 7 ].l = envData->asynchronousFinalizer;
 }
 jo_iface = jni->CallStaticObjectMethodA(
diff --git a/bridges/source/jni_uno/jniunoenvironmentdata.hxx 
b/bridges/source/jni_uno/jniunoenvironmentdata.hxx
index 39ffdeea6ece..d1f3bab4b12d 100644
--- a/bridges/source/jni_uno/jniunoenvironmentdata.hxx
+++ b/bridges/source/jni_uno/jniunoenvironmentdata.hxx
@@ -24,10 +24,10 @@
 #include 
 
 #include 
-#include 
 #include 
 
 #include "jni_info.h"
+#include 
 
 namespace jni_uno {
 
@@ -45,7 +45,7 @@ struct JniUnoEnvironmentData {
 rtl::Reference const machine;
 JNI_info const * const info;
 
-osl::Mutex mutex;
+std::mutex mutex;
 jobject asynchronousFinalizer;
 };
 


[Libreoffice-commits] core.git: bridges/source testtools/source

2023-01-04 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx   |   11 +
 bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx   |   15 +
 bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx |   11 +
 bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx   |   11 +
 bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx |   11 +
 bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx|   11 +
 bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx|9 -
 bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx   |   14 +
 bridges/source/cpp_uno/gcc3_linux_loongarch64/cpp2uno.cxx |   14 +
 bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx|   11 +
 bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx|   11 +
 bridges/source/cpp_uno/gcc3_linux_mips64/cpp2uno.cxx  |   11 +
 bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx |   11 +
 bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx   |   11 +
 bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx |   14 +
 bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx|   11 +
 bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx   |   11 +
 bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx   |   14 +
 bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx |   14 +
 bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx  |   17 +-
 bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx |   11 +
 bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx |   11 +
 bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx |   14 +
 bridges/source/cpp_uno/msvc_win32_arm64/cpp2uno.cxx   |  113 --
 bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx   |   79 -
 bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx  |   89 +--
 testtools/source/bridgetest/bridgetest.cxx|4 
 27 files changed, 487 insertions(+), 77 deletions(-)

New commits:
commit ef533553559fe09b4afab651fc692885d1acf4ed
Author: Stephan Bergmann 
AuthorDate: Wed Jan 4 12:14:22 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Jan 4 13:49:58 2023 +

Rudimentary support for dynamic_cast on UNO proxy objects

 "New loplugin:unocast" had
argued that uses of dynamic_cast from a UNO interface type are broken in 
general
(because if the source object is a proxy from the C*+ UNO bridge, its 
vtable's
RTTI slot will normally not be set up, which can cause a crash), and should 
be
replaced with uses of XUnoTunnel.  Which the various recent 
"loplugin:unocast
(...)" commits started to do.  However, it became clear that that is not the
most ideal way forward:  For one, getting more and more implementations of
XUnoTunnel::getSomething into existing class hierarchies is error prone, as 
each
such implementation must manually delegate to all its base class
implementations.  For another, uses of comphelper::getFromUnoTunnel (which 
often
needs to do a queryInterface to XUnoTunnel first) are easily more expensive 
than
uses of dynamic_cast.

Thanks to Noel, the insight here is that for the use case of a dynamic_cast 
from
a UNO interface type to a local C++ class type, and if the source object is 
a
proxy, it is sufficient that the dynamic_cast will not crash.  It will
necessarily always return null (as the proxy will never be the 
implementation of
a local C++ class type), so it is sufficient to fill the RTTI slots of the
proxies' vtables with dummy values.  That avoids having to set up proper 
RTTI
for those potentially multiple-inheritance proxy types.  (And with this in
place, all those recent "loplugin:unocast (...)" commits can be reverted 
again
in a next step.)

I verified the changes for the gcc3_linux_aarch64 (on macOS), 
gcc3_linux_intel,
gcc3_linux_x86-64, gcc3_macosx_x86-64, msvc_win32_intel, and 
msvc_win32_x86-64
bridges.  The changes for all the other bridges were done blindly.

(For gcc3_linux_x86-64, which already conditionally supported proper RTTI 
for
UBSan, setting the offset-to-top slot to non-zero had to be made conditional
too, as the dummy ProxyRtti will always pretend to be a full class rather 
than a
potential base class that could have a non-zero offset-to-top value.  For
msvc_win32_*, it turned out that the existing code to set up dummy 
XInterface
RTTI (which was there for reasons lost to history) was broken.)

Change-Id: Iec4b8067d26b14b6fb02c2fdd15e1eee20919590
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145038
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx
index 2e6fdd11a820..92068152245c 100644
--- a/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx
@@ 

[Libreoffice-commits] core.git: bridges/source

2023-01-04 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 146eb1aa750a7612deb9d3e1825a7a2e1256bd4d
Author: Stephan Bergmann 
AuthorDate: Wed Jan 4 08:34:34 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Jan 4 09:46:00 2023 +

Fix Itanium vtable construction

Our use of bridges::cpp_uno::shared::VtableFactory::Slot to model all the
elements of a vtable is an abstraction that doesn't quite match the reality 
of
, as vtables are not
homogenous sequences of function pointers, but are rather a mix of offsets, 
data
pointers, and function pointers.

The data preceding the virtual table address point is the offset to top (an
offset) followed by the typeinfo pointer (a data pointer).  On other 
platforms
where offsets, data pointers, and function pointers are all of the same 
size, we
model those as two additional Slots at index -2 and -1, resp.  On Itanium, 
where
function pointers (and thus Slots) are twice the offset and data pointer 
size,
we should model those as one additional Slot at index -1.

The code has been this way ever since its introduction in
0c25631972809c752624b4883c71671c8e83e797 "INTEGRATION: CWS ia64port01_DEV300
(1.1.2); FILE ADDED".  It should never have caused any issues as the 
existence
of the excess Slot at index -2 should never have gotten in the way.  But it 
is
probably better to clean this up anyway.  (This is a blind fix, as I don't 
have
an Itanium build environment available.  And this Itanium bridge may well be
dead code by now, anyway.)

Change-Id: I98d58785c054e1cdc621e5968c41b06d8788998f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145035
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx
index 2cf39d998556..ddcd40818036 100644
--- a/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx
@@ -597,22 +597,20 @@ void 
bridges::cpp_uno::shared::VtableFactory::flushCode(unsigned char const *, u
 
 bridges::cpp_uno::shared::VtableFactory::Slot * 
bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block)
 {
-return static_cast< Slot * >(block) + 2;
+return static_cast< Slot * >(block) + 1;
 }
 
 
 std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize(
 sal_Int32 slotCount)
 {
-return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize;
+return (slotCount + 1) * sizeof (Slot) + slotCount * codeSnippetSize;
 }
 
 bridges::cpp_uno::shared::VtableFactory::Slot* 
bridges::cpp_uno::shared::VtableFactory::initializeBlock(void * block, 
sal_Int32 slotCount, sal_Int32, typelib_InterfaceTypeDescription *)
 {
 Slot * slots = mapBlockToVtable(block);
-Slot foo = {0,0};
-slots[-2] = foo;
-slots[-1] = foo;
+slots[-1] = {0,0};
 return slots + slotCount;
 }
 


[Libreoffice-commits] core.git: bridges/source chart2/qa chart2/source compilerplugins/clang configmgr/source connectivity/source cppu/source cui/source dbaccess/source desktop/source framework/source

2022-10-11 Thread Mike Kaganski (via logerrit)
 bridges/source/jni_uno/jni_info.cxx   |4 
 chart2/qa/extras/chart2dump/chart2dump.cxx|4 
 chart2/qa/extras/xshape/chart2xshape.cxx  |5 -
 chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx  |2 
 chart2/source/tools/PolynomialRegressionCurveCalculator.cxx   |2 
 compilerplugins/clang/stringview.cxx  |2 
 compilerplugins/clang/test/stringview.cxx |4 
 configmgr/source/winreg.cxx   |2 
 connectivity/source/drivers/firebird/PreparedStatement.cxx|2 
 connectivity/source/drivers/firebird/Util.cxx |2 
 connectivity/source/drivers/mysql_jdbc/YTables.cxx|2 
 connectivity/source/parse/sqlnode.cxx |2 
 cppu/source/uno/lbenv.cxx |2 
 cui/source/dialogs/scriptdlg.cxx  |4 
 cui/source/options/personalization.cxx|2 
 dbaccess/source/ui/dlg/dbwizsetup.cxx |4 
 dbaccess/source/ui/dlg/directsql.cxx  |   10 +-
 desktop/source/deployment/manager/dp_manager.cxx  |4 
 desktop/source/lib/init.cxx   |2 
 desktop/source/migration/migration.cxx|4 
 desktop/source/pkgchk/unopkg/unopkg_app.cxx   |6 -
 desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx|   16 +--
 desktop/source/pkgchk/unopkg/unopkg_misc.cxx  |4 
 desktop/source/splash/splash.cxx  |4 
 framework/source/uielement/subtoolbarcontroller.cxx   |2 
 i18nlangtag/source/languagetag/languagetag.cxx|2 
 i18npool/source/indexentry/indexentrysupplier.cxx |4 
 i18npool/source/localedata/LocaleNode.cxx |2 
 include/rtl/string.hxx|   10 +-
 include/rtl/stringconcat.hxx  |   42 
+++-
 include/rtl/ustring.hxx   |   10 +-
 l10ntools/source/po.cxx   |8 -
 lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx |4 
 linguistic/source/dicimp.cxx  |2 
 oox/source/core/xmlfilterbase.cxx |4 
 oox/source/export/drawingml.cxx   |   12 +-
 oox/source/export/shapes.cxx  |2 
 oox/source/ole/vbaexport.cxx  |   12 +-
 sal/qa/rtl/strings/test_oustring_compare.cxx  |4 
 sal/qa/rtl/textenc/rtl_textcvt.cxx|   34 
+++
 sc/qa/extras/vba-macro-test.cxx   |2 
 sc/source/filter/excel/xecontent.cxx  |2 
 sc/source/filter/excel/xelink.cxx |2 
 sd/qa/unit/import-tests.cxx   |2 
 sd/source/core/drawdoc3.cxx   |2 
 sd/source/filter/eppt/pptx-epptooxml.cxx  |   20 ++--
 sd/source/filter/html/htmlex.cxx  |4 
 sdext/source/presenter/PresenterHelpView.cxx  |2 
 sfx2/source/appl/newhelp.cxx  |4 
 sfx2/source/control/unoctitm.cxx  |2 
 sfx2/source/doc/guisaveas.cxx |2 
 sfx2/source/view/classificationhelper.cxx |2 
 shell/source/backends/desktopbe/desktopbackend.cxx|2 
 shell/source/win32/jumplist/JumpList.cxx  |   46 
-
 stoc/source/implementationregistration/implreg.cxx|   16 +--
 svl/source/misc/lockfilecommon.cxx|2 
 svl/source/misc/msodocumentlockfile.cxx   |2 
 svl/source/numbers/zforlist.cxx   |2 
 svl/source/numbers/zformat.cxx|4 
 svtools/source/dialogs/PlaceEditDialog.cxx|2 
 svtools/source/dialogs/ServerDetailsControls.cxx  |2 
 svtools/source/svhtml/HtmlWriter.cxx  |4 
 svx/source/gallery2/gallery1.cxx  |2 
 svx/source/gallery2/gallerybinaryengineentry.cxx  |2 
 svx/source/tbxctrls/PaletteManager.cxx|2 
 sw/qa/extras/globalfilter/globalfilter.cxx|2 

[Libreoffice-commits] core.git: bridges/source

2022-09-07 Thread Tor Lillqvist (via logerrit)
 bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx |   51 
 1 file changed, 22 insertions(+), 29 deletions(-)

New commits:
commit 0c05d4dc4810749e65e81e98f04805b251d61e5a
Author: Tor Lillqvist 
AuthorDate: Wed Sep 7 17:16:46 2022 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Sep 7 20:53:36 2022 +0200

Fix register clobber information and simplify in the C++/UNO bridge for iOS

Avoid the use of unnecessary local variables to temporarily keep
return values from a function called by the inline assembly. Instead
use the GPR and FPR arrays also to temporarily keep such return
values, like the Linux aarch64 code does.

This fixes https://github.com/CollaboraOnline/online/issues/5204

Change-Id: I11aac56e9c8cc8aff1a3653ced45bdf4844cbcca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139604
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx
index 07ec8501f0df..2614fd041ae9 100644
--- a/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx
@@ -77,13 +77,13 @@ namespace arm
 }
 }
 
-void MapReturn(sal_uInt64 x0, sal_uInt64 x1, double d0, 
typelib_TypeDescriptionReference *pReturnType, sal_uInt64 *pRegisterReturn)
+void MapReturn(sal_uInt64 *pGPR, double *pFPR, 
typelib_TypeDescriptionReference *pReturnType, sal_uInt64 *pRegisterReturn)
 {
 switch( pReturnType->eTypeClass )
 {
 case typelib_TypeClass_HYPER:
 case typelib_TypeClass_UNSIGNED_HYPER:
-pRegisterReturn[1] = x1;
+pRegisterReturn[1] = pGPR[1];
 [[fallthrough]];
 case typelib_TypeClass_LONG:
 case typelib_TypeClass_UNSIGNED_LONG:
@@ -93,20 +93,20 @@ void MapReturn(sal_uInt64 x0, sal_uInt64 x1, double d0, 
typelib_TypeDescriptionR
 case typelib_TypeClass_UNSIGNED_SHORT:
 case typelib_TypeClass_BOOLEAN:
 case typelib_TypeClass_BYTE:
-pRegisterReturn[0] = x0;
+pRegisterReturn[0] = pGPR[0];
 break;
 case typelib_TypeClass_FLOAT:
-*(float*)pRegisterReturn = *(float*)
+*(float*)pRegisterReturn = *(float*)[0];
 break;
 case typelib_TypeClass_DOUBLE:
-*(double*)pRegisterReturn = d0;
+*(double*)pRegisterReturn = pFPR[0];
 break;
 case typelib_TypeClass_STRUCT:
 case typelib_TypeClass_EXCEPTION:
 if (!arm::return_in_x8(pReturnType))
 {
-pRegisterReturn[0] = x0;
-pRegisterReturn[1] = x1;
+pRegisterReturn[0] = pGPR[0];
+pRegisterReturn[1] = pGPR[1];
 }
 break;
 default:
@@ -142,11 +142,6 @@ void callVirtualMethod(
 pMethod += 8 * nVtableIndex;
 pMethod = *((sal_uInt64 *)pMethod);
 
-// For value returned in registers
-sal_uInt64 x0;
-sal_uInt64 x1;
-double d0;
-
 __asm__ __volatile__
 (
  // Assembly string
@@ -160,27 +155,25 @@ void callVirtualMethod(
  "  ldp d4, d5, %[pfpr_4]\n"
  "  ldp d6, d7, %[pfpr_6]\n"
  "  blr %[pmethod]\n"
- "  str x0, %[x0]\n"
- "  str x1, %[x1]\n"
- "  str d0, %[d0]\n"
- // Output operands
- : [x0]"=m" (x0), [x1]"=m" (x1), [d0]"=m" (d0)
+ "  stp x0, x1, %[pgpr_0]\n"
+ "  str d0, %[pfpr_0]\n"
  // Input operands
- : [pgpr_0]"m" (pGPR[0]),
-   [pgpr_2]"m" (pGPR[2]),
-   [pgpr_4]"m" (pGPR[4]),
-   [pgpr_6]"m" (pGPR[6]),
-   [pregisterreturn]"m" (pRegisterReturn),
-   [pfpr_0]"m" (pFPR[0]),
-   [pfpr_2]"m" (pFPR[2]),
-   [pfpr_4]"m" (pFPR[4]),
-   [pfpr_6]"m" (pFPR[6]),
-   [pmethod]"r" (pMethod)
+ :: [pgpr_0]"m" (pGPR[0]),
+[pgpr_2]"m" (pGPR[2]),
+[pgpr_4]"m" (pGPR[4]),
+[pgpr_6]"m" (pGPR[6]),
+[pregisterreturn]"m" (pRegisterReturn),
+[pfpr_0]"m" (pFPR[0]),
+[pfpr_2]"m" (pFPR[2]),
+[pfpr_4]"m" (pFPR[4]),
+[pfpr_6]"m" (pFPR[6]),
+[pmethod]"r" (pMethod)
  // Clobbers
- : "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "d0", "d1", "d2", 
"d3", "d4", "d5", "d6", "d7"
+ : "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", 
"x11", "x12", "x13", "x14", "x15", "x16", "x17",
+   "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"
  );
 
-MapReturn(x0, x1, d0, pReturnType, (sal_uInt64 *) pRegisterReturn);
+MapReturn(pGPR, pFPR, pReturnType, (sal_uInt64 *) pRegisterReturn);
 }
 }
 


[Libreoffice-commits] core.git: bridges/source

2022-08-22 Thread Caolán McNamara (via logerrit)
 bridges/source/jni_uno/jni_helper.h |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d18f649938806cd17383b2edd8994c5a66382771
Author: Caolán McNamara 
AuthorDate: Mon Aug 22 09:52:20 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 22 16:18:23 2022 +0200

cid#1500671 silence Resource leak

Change-Id: I295d7877100b49a867a0f67e2edcc923d943401b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138664
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/bridges/source/jni_uno/jni_helper.h 
b/bridges/source/jni_uno/jni_helper.h
index 4cc145b26435..6e82e12f4081 100644
--- a/bridges/source/jni_uno/jni_helper.h
+++ b/bridges/source/jni_uno/jni_helper.h
@@ -49,6 +49,7 @@ inline void jstring_to_ustring(
 ustr->refCount = 1;
 ustr->length = len;
 ustr->buffer[ len ] = '\0';
+// coverity[leaked_storage : FALSE] - transfer ownership to *out_ustr
 mem.release();
 if (nullptr != *out_ustr)
 rtl_uString_release( *out_ustr );


[Libreoffice-commits] core.git: bridges/source

2022-08-22 Thread Caolán McNamara (via logerrit)
 bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ce891da19769f2c80e8f7517f85d67d2de5ba34e
Author: Caolán McNamara 
AuthorDate: Mon Aug 22 09:43:56 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 22 12:17:44 2022 +0200

cid#1500470 silence Resource leak

Change-Id: I846746a351c619a4de7abce7a6443f510dc41690
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138661
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx 
b/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx
index dad1ad8f7ac6..189b3c2a4ef9 100644
--- a/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx
+++ b/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx
@@ -74,6 +74,7 @@ com::sun::star::uno::XInterface * CppInterfaceProxy::create(
 pProxy->vtables[i] = VtableFactory::mapBlockToVtable(
 rVtables.blocks[i].start);
 }
+// coverity[leaked_storage : FALSE] - see freeCppInterfaceProxy
 return castProxyToInterface(pProxy);
 }
 


[Libreoffice-commits] core.git: bridges/source

2022-08-17 Thread Caolán McNamara (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit a86dd4df616227ed7e7be911653dac06973d8e25
Author: Caolán McNamara 
AuthorDate: Tue Aug 16 11:25:53 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 17 09:55:17 2022 +0200

cid#1500585 Dereference before null check

Change-Id: I9374a580d3dce7c7851881ff8193946d46ed2bec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138384
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
index f36ca6431c8e..9fa6810d44da 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
@@ -253,11 +253,9 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription 
const & pTypeDescr)
 assert(false); // cannot happen
 }
 rtti = newRtti->get();
-if (newRtti) {
-auto insertion (
-m_generatedRttis.emplace(unoName, std::move(newRtti)));
-SAL_WARN_IF( !insertion.second, "bridges", "key " << unoName << " 
already in generated rtti map" );
-}
+
+auto insertion(m_generatedRttis.emplace(unoName, std::move(newRtti)));
+SAL_WARN_IF( !insertion.second, "bridges", "key " << unoName << " already 
in generated rtti map" );
 
 return rtti;
 }


[Libreoffice-commits] core.git: bridges/source

2022-08-13 Thread Arnaud VERSINI (via logerrit)
 bridges/source/jni_uno/jni_bridge.cxx   |1 -
 bridges/source/jni_uno/jni_info.cxx |5 +
 bridges/source/jni_uno/jni_java2uno.cxx |2 +-
 bridges/source/jni_uno/jni_uno2java.cxx |   24 
 4 files changed, 14 insertions(+), 18 deletions(-)

New commits:
commit 642017c88a303cf10d291d94836564edea9df0d8
Author: Arnaud VERSINI 
AuthorDate: Sun Jul 31 17:42:53 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 13 09:11:58 2022 +0200

bridges/jni : remove useless using and use css instead of com::sun::star

Change-Id: I1b73d68b007ba0dfa54f99ff8f8fea55e94a1ed2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137651
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/jni_uno/jni_bridge.cxx 
b/bridges/source/jni_uno/jni_bridge.cxx
index 341c466aa90c..be2e3d37ec12 100644
--- a/bridges/source/jni_uno/jni_bridge.cxx
+++ b/bridges/source/jni_uno/jni_bridge.cxx
@@ -31,7 +31,6 @@
 #include 
 #include 
 
-using namespace ::osl;
 using namespace ::jni_uno;
 
 namespace
diff --git a/bridges/source/jni_uno/jni_info.cxx 
b/bridges/source/jni_uno/jni_info.cxx
index 434322f3003c..4fd935987463 100644
--- a/bridges/source/jni_uno/jni_info.cxx
+++ b/bridges/source/jni_uno/jni_info.cxx
@@ -33,9 +33,6 @@
 #include 
 
 
-using namespace ::std;
-using namespace ::osl;
-
 namespace jni_uno
 {
 
@@ -942,7 +939,7 @@ JNI_info const * JNI_info::get_jni_info(
 jni_env, static_cast< jobject >(uno_vm->getClassLoader()), 
jo_class,
 jo_forName );
 
-ClearableMutexGuard g( Mutex::getGlobalMutex() );
+osl::ClearableMutexGuard g( osl::Mutex::getGlobalMutex() );
 jni_info =
 reinterpret_cast< JNI_info const * >(
 jni->GetStaticLongField(
diff --git a/bridges/source/jni_uno/jni_java2uno.cxx 
b/bridges/source/jni_uno/jni_java2uno.cxx
index b6c4c6ea9b35..5edb2b7b3453 100644
--- a/bridges/source/jni_uno/jni_java2uno.cxx
+++ b/bridges/source/jni_uno/jni_java2uno.cxx
@@ -94,7 +94,7 @@ void Bridge::handle_uno_exc( JNI_context const & jni, uno_Any 
* uno_exc ) const
 {
 #if OSL_DEBUG_LEVEL > 0
 // append java stack trace to Message member
-static_cast< ::com::sun::star::uno::Exception * >(
+static_cast< css::uno::Exception * >(
 uno_exc->pData )->Message += jni.get_stack_trace();
 #endif
 SAL_INFO(
diff --git a/bridges/source/jni_uno/jni_uno2java.cxx 
b/bridges/source/jni_uno/jni_uno2java.cxx
index 8fd38ec31b15..bc908fc5db98 100644
--- a/bridges/source/jni_uno/jni_uno2java.cxx
+++ b/bridges/source/jni_uno/jni_uno2java.cxx
@@ -84,7 +84,7 @@ void Bridge::handle_java_exc(
 OUString exc_name(
 jstring_to_oustring( jni, static_cast(jo_class_name.get()) ) 
);
 
-::com::sun::star::uno::TypeDescription td( exc_name.pData );
+css::uno::TypeDescription td( exc_name.pData );
 if (!td.is() || (td.get()->eTypeClass != typelib_TypeClass_EXCEPTION))
 {
 // call toString()
@@ -107,7 +107,7 @@ void Bridge::handle_java_exc(
 
 #if OSL_DEBUG_LEVEL > 0
 // patch Message, append stack trace
-reinterpret_cast< ::com::sun::star::uno::Exception * >(
+reinterpret_cast< css::uno::Exception * >(
 uno_data.get() )->Message += jni.get_stack_trace( jo_exc.get() );
 #endif
 
@@ -137,9 +137,9 @@ void Bridge::call_java(
 static_cast(m_java_env->pContext)->machine);
 
 // assure fully initialized iface_td:
-::com::sun::star::uno::TypeDescription iface_holder;
+css::uno::TypeDescription iface_holder;
 if (! iface_td->aBase.bComplete) {
-iface_holder = ::com::sun::star::uno::TypeDescription(
+iface_holder = css::uno::TypeDescription(
 reinterpret_cast(iface_td) );
 iface_holder.makeComplete();
 if (! iface_holder.get()->bComplete) {
@@ -778,22 +778,22 @@ void UNO_proxy_dispatch(
 buf.append( ": " );
 buf.append( err.m_message );
 // binary identical struct
-::com::sun::star::uno::RuntimeException exc(
+css::uno::RuntimeException exc(
 buf.makeStringAndClear(),
-::com::sun::star::uno::Reference<
-  ::com::sun::star::uno::XInterface >() );
-::com::sun::star::uno::Type const & exc_type = 
cppu::UnoType::get();
+css::uno::Reference<
+  css::uno::XInterface >() );
+css::uno::Type const & exc_type = cppu::UnoType::get();
 uno_type_any_construct( *uno_exc, , exc_type.getTypeLibType(), 
nullptr );
 SAL_INFO("bridges", exc.Message);
 }
 catch (::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
 {
 // binary identical struct
-::com::sun::star::uno::RuntimeException exc(
+css::uno::RuntimeException exc(
 "[jni_uno bridge error] attaching current thread to java failed!",
-::com::sun::star::uno::Reference<
-  ::com::sun::star::uno::XInterface >() 

[Libreoffice-commits] core.git: bridges/source

2022-07-10 Thread am.faraji (via logerrit)
 bridges/source/cpp_uno/gcc3_ios/rtti.h |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 5aad816758652e5a4112527cf477d84e72a724ba
Author: am.faraji 
AuthorDate: Sat Jul 9 22:21:55 2022 +0430
Commit: Hossein 
CommitDate: Sun Jul 10 21:52:47 2022 +0200

tdf#143148 Use pragma once instead of include guards

Change-Id: I7bd02dba44a8bc62da660bcb7500960ef14172a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136939
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git a/bridges/source/cpp_uno/gcc3_ios/rtti.h 
b/bridges/source/cpp_uno/gcc3_ios/rtti.h
index fd8ef3715082..88413ea27a18 100644
--- a/bridges/source/cpp_uno/gcc3_ios/rtti.h
+++ b/bridges/source/cpp_uno/gcc3_ios/rtti.h
@@ -25,8 +25,8 @@
 // the GNU General Public License.
 //
 // Written by Nathan Sidwell, Codesourcery LLC, 
-#ifndef __RTTI_H
-#define __RTTI_H
+
+#pragma once
 
 #include 
 
@@ -405,6 +405,3 @@ namespace __cxxabiv1
 
 // User programs should use the alias `abi'.
 namespace abi = __cxxabiv1;
-
-
-#endif // __RTTI_H


[Libreoffice-commits] core.git: bridges/source

2022-04-25 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 67d8c245daf7c6ee33e908255f2bbd0ea8d08206
Author: Stephan Bergmann 
AuthorDate: Mon Apr 25 17:01:04 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Apr 25 23:58:46 2022 +0200

loplugin:stringview

Change-Id: I4bd3efe67217a4c4418cf308cc8e7a55cf4a604a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133390
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index 8db8c37140e5..ff50e62dd026 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -29,6 +29,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -99,7 +100,7 @@ std::type_info * Rtti::getRtti(typelib_TypeDescription const 
& type) {
 for (sal_Int32 j = 0; j != -1;) {
 OString t(
 OUStringToOString(
-unoName.getToken(0, '.', j), RTL_TEXTENCODING_ASCII_US));
+o3tl::getToken(unoName, 0, '.', j), 
RTL_TEXTENCODING_ASCII_US));
 b.append(t.getLength());
 b.append(t);
 }


[Libreoffice-commits] core.git: bridges/source

2022-04-22 Thread Noel Grandin (via logerrit)
 bridges/source/jni_uno/jni_info.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fa856bdd2757745f71d2ae1e31e90006a9cdaa4e
Author: Noel Grandin 
AuthorDate: Thu Apr 21 15:30:51 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 22 13:29:02 2022 +0200

use more string_view in bridges

Change-Id: I842668655dec102e1595dcbac6413fe2b49d8515
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133268
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/jni_uno/jni_info.cxx 
b/bridges/source/jni_uno/jni_info.cxx
index 16a5a1ac4d5c..81ad9323de48 100644
--- a/bridges/source/jni_uno/jni_info.cxx
+++ b/bridges/source/jni_uno/jni_info.cxx
@@ -243,12 +243,12 @@ JNI_compound_type_info::JNI_compound_type_info(
 OUString::unacquired( >aBase.pTypeName );
 
 // Erase type arguments of instantiated polymorphic struct types:
-OUString nucleus;
+std::u16string_view nucleus;
 sal_Int32 i = uno_name.indexOf( '<' );
 if ( i < 0 ) {
 nucleus = uno_name;
 } else {
-nucleus = uno_name.copy( 0, i );
+nucleus = uno_name.subView( 0, i );
 }
 JLocalAutoRef jo_class(
 jni,


[Libreoffice-commits] core.git: bridges/source

2022-03-25 Thread Arnaud Versini (via logerrit)
 bridges/source/jni_uno/jni_info.cxx |   18 +-
 bridges/source/jni_uno/jni_info.h   |4 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 370b5dbe0d5e62c71b90c795f936dd7c9c240f36
Author: Arnaud Versini 
AuthorDate: Fri Mar 25 10:29:37 2022 +0100
Commit: Noel Grandin 
CommitDate: Fri Mar 25 12:35:12 2022 +0100

bridges : use std::mutex in java brige

Change-Id: I07b215067b1cefc87919680fad3299d702ff6d1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132100
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/jni_uno/jni_info.cxx 
b/bridges/source/jni_uno/jni_info.cxx
index 70839e168eb2..16a5a1ac4d5c 100644
--- a/bridges/source/jni_uno/jni_info.cxx
+++ b/bridges/source/jni_uno/jni_info.cxx
@@ -369,18 +369,18 @@ JNI_type_info const * JNI_info::create_type_info(
 
 // look up
 JNI_type_info * info;
-ClearableMutexGuard guard( m_mutex );
+std::unique_lock guard( m_mutex );
 JNI_type_info_holder & holder = m_type_map[ uno_name ];
 if (holder.m_info == nullptr) // new insertion
 {
 holder.m_info = new_info;
-guard.clear();
+guard.unlock();
 info = new_info;
 }
 else // inserted in the meantime
 {
 info = holder.m_info;
-guard.clear();
+guard.unlock();
 new_info->destroy( jni.get_jni_env() );
 }
 return info;
@@ -397,12 +397,12 @@ JNI_type_info const * JNI_info::get_type_info(
 
 OUString const & uno_name = OUString::unacquired( >pTypeName );
 JNI_type_info const * info;
-ClearableMutexGuard guard( m_mutex );
+std::unique_lock guard( m_mutex );
 
 t_str2type::const_iterator iFind( m_type_map.find( uno_name ) );
 if (iFind == m_type_map.end())
 {
-guard.clear();
+guard.unlock();
 info = create_type_info( jni, td );
 }
 else
@@ -424,11 +424,11 @@ JNI_type_info const * JNI_info::get_type_info(
 
 OUString const & uno_name = OUString::unacquired( >pTypeName );
 JNI_type_info const * info;
-ClearableMutexGuard guard( m_mutex );
+std::unique_lock guard( m_mutex );
 t_str2type::const_iterator iFind( m_type_map.find( uno_name ) );
 if (iFind == m_type_map.end())
 {
-guard.clear();
+guard.unlock();
 TypeDescr td( type );
 info = create_type_info( jni, td.get() );
 }
@@ -450,11 +450,11 @@ JNI_type_info const * JNI_info::get_type_info(
 }
 
 JNI_type_info const * info;
-ClearableMutexGuard guard( m_mutex );
+std::unique_lock guard( m_mutex );
 t_str2type::const_iterator iFind( m_type_map.find( uno_name ) );
 if (iFind == m_type_map.end())
 {
-guard.clear();
+guard.unlock();
 css::uno::TypeDescription td( uno_name );
 if (! td.is())
 {
diff --git a/bridges/source/jni_uno/jni_info.h 
b/bridges/source/jni_uno/jni_info.h
index ede5f1718316..7a18e553e400 100644
--- a/bridges/source/jni_uno/jni_info.h
+++ b/bridges/source/jni_uno/jni_info.h
@@ -25,7 +25,7 @@
 
 #include "jni_base.h"
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -122,7 +122,7 @@ typedef std::unordered_map<
 
 class JNI_info
 {
-mutable ::osl::Mutexm_mutex;
+mutable std::mutex  m_mutex;
 mutable t_str2type  m_type_map;
 
 public:


[Libreoffice-commits] core.git: bridges/source include/sal

2022-03-08 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx |3 ---
 include/sal/log-areas.dox|1 -
 2 files changed, 4 deletions(-)

New commits:
commit 42b37ba1d19a0543b7edda2c9d8bbb9b80507a7c
Author: Stephan Bergmann 
AuthorDate: Tue Mar 8 09:25:52 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Mar 8 13:57:22 2022 +0100

Drop some debug code

...that had been introduced with 7e8e85adbee73346403c364326544487677cd5c6 
"Add
codeSnippet debugging output when dbglevel>1" and reinforced with
6f121860d0537060084278da11842732a748d6b7 "tdf#130924 replace debugging 
printf
calls with SAL_INFO/SAL_WARN"

Change-Id: I9529bfdedd3d1a3dd623fdb28e01d6bd96c92d97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131169
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
index 48d8d174fb6a..f400c766a2e6 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
@@ -442,9 +442,6 @@ static unsigned char * codeSnippet( unsigned char * code,
 // jmpq *%r11
 *reinterpret_cast( code + 20 ) = 0x00e3ff49;
 
-SAL_INFO("bridges.debug", "==> codeSnippet, functionIndex=" << 
nFunctionIndex
-<< (bHasHiddenParam ? "|0x8000":"") << ", vtableOffset=" << 
nVtableOffset);
-
 return code + codeSnippetSize;
 }
 
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index b0e10c48fa2d..7d61cfd3d3cd 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -47,7 +47,6 @@ certain functionality.
 @li @c bridges
 @li @c bridges.ios
 @li @c bridges.osx
-@li @c bridges.debug
 
 @section canvas
 


[Libreoffice-commits] core.git: bridges/source include/sal

2022-03-04 Thread pragat-pandya (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx |7 ++-
 include/sal/log-areas.dox|1 +
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 6f121860d0537060084278da11842732a748d6b7
Author: pragat-pandya 
AuthorDate: Tue Mar 1 16:56:06 2022 +0530
Commit: Luboš Luňák 
CommitDate: Sat Mar 5 08:35:23 2022 +0100

tdf#130924 replace debugging printf calls with SAL_INFO/SAL_WARN

Change-Id: Iaef5eec6508d031ab711a71c0d8ecebb18112ef6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130764
Tested-by: Luboš Luňák 
Reviewed-by: Luboš Luňák 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
index de393582f99a..48d8d174fb6a 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
@@ -442,11 +442,8 @@ static unsigned char * codeSnippet( unsigned char * code,
 // jmpq *%r11
 *reinterpret_cast( code + 20 ) = 0x00e3ff49;
 
-#if OSL_DEBUG_LEVEL > 1
-fprintf(stderr,
-"==> codeSnippet, functionIndex=%d%s, vtableOffset=%d\n",
-nFunctionIndex, (bHasHiddenParam ? "|0x8000":""), 
nVtableOffset);
-#endif
+SAL_INFO("bridges.debug", "==> codeSnippet, functionIndex=" << 
nFunctionIndex
+<< (bHasHiddenParam ? "|0x8000":"") << ", vtableOffset=" << 
nVtableOffset);
 
 return code + codeSnippetSize;
 }
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 7d61cfd3d3cd..b0e10c48fa2d 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -47,6 +47,7 @@ certain functionality.
 @li @c bridges
 @li @c bridges.ios
 @li @c bridges.osx
+@li @c bridges.debug
 
 @section canvas
 


[Libreoffice-commits] core.git: bridges/source

2022-03-03 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a459e6e7984bb3f88f95b587b0cde4a6f8095242
Author: Stephan Bergmann 
AuthorDate: Thu Mar 3 12:36:00 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Mar 3 17:37:54 2022 +0100

Avoid loplugin:noexcept

...when building on Linux with Clang -stdlib=libc++,

> In file included from 
bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:41:
> bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx:156:51: error: Replace 
legacy dynamic 'throw ()' exception specification with 'noexcept' 
[loplugin:noexcept]
> extern "C" __cxa_eh_globals * __cxa_get_globals() throw();
>   ^~~

(The situation with respect to these exception specifications is a bit 
unclear,
recent 
doesn't mention any exception specifications for those effectively extern 
"C"
functions, and recent


doesn't have an exception specification for __cxa_get_globals and recent

doesn't have one for __cxa_current_exception_type though it has `throw()` 
for
__cxa_allocate_exception.  On the other hand, recent


and


have _GLIBCXX_NOTHROW exception specifications for all three functions, 
which
expands to `noexcept` for C++11 and beyond.)

Change-Id: I1582c9d3b42977af011d4dc49674fdf12d5ea5ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130926
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
index edcb46d0da2a..d7657bcc04be 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
@@ -153,19 +153,19 @@ struct __cxa_eh_globals {
 
 #if !HAVE_CXXABI_H_CXA_GET_GLOBALS
 namespace __cxxabiv1 {
-extern "C" __cxa_eh_globals * __cxa_get_globals() throw();
+extern "C" __cxa_eh_globals * __cxa_get_globals() noexcept;
 }
 #endif
 
 #if !HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE
 namespace __cxxabiv1 {
-extern "C" std::type_info *__cxa_current_exception_type() throw();
+extern "C" std::type_info *__cxa_current_exception_type() noexcept;
 }
 #endif
 
 #if !HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION
 namespace __cxxabiv1 {
-extern "C" void * __cxa_allocate_exception(std::size_t thrown_size) throw();
+extern "C" void * __cxa_allocate_exception(std::size_t thrown_size) noexcept;
 }
 #endif
 


[Libreoffice-commits] core.git: bridges/source compilerplugins/clang forms/source include/com include/comphelper include/cppu include/cppuhelper include/oox include/registry lotuswordpro/source oox/so

2022-01-15 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/shared/vtables.cxx |2 +-
 compilerplugins/clang/nullptr.cxx |5 -
 forms/source/xforms/propertysetbase.hxx   |2 +-
 include/com/sun/star/uno/Any.hxx  |2 +-
 include/com/sun/star/uno/Sequence.hxx |6 +++---
 include/comphelper/newarray.hxx   |2 +-
 include/cppu/unotype.hxx  |4 ++--
 include/cppuhelper/interfacecontainer.hxx |2 +-
 include/oox/drawingml/chart/modelbase.hxx |2 +-
 include/oox/helper/containerhelper.hxx|6 +++---
 include/oox/helper/refmap.hxx |2 +-
 include/oox/helper/refvector.hxx  |2 +-
 include/registry/registry.hxx |2 +-
 lotuswordpro/source/filter/clone.hxx  |4 ++--
 oox/source/drawingml/theme.cxx|2 +-
 stoc/source/security/lru_cache.h  |2 +-
 store/source/storbase.hxx |6 +++---
 store/source/store.cxx|2 +-
 sw/source/filter/ww8/sortedarray.hxx  |2 +-
 sw/source/filter/ww8/writerwordglue.cxx   |8 
 ucb/source/inc/regexpmap.hxx  |8 
 21 files changed, 38 insertions(+), 35 deletions(-)

New commits:
commit 29bc12777ceffd00ed0ae103b8f2affa26897b4e
Author: Stephan Bergmann 
AuthorDate: Sat Jan 15 13:50:26 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Sat Jan 15 15:58:07 2022 +0100

Let loplugin:nullptr look into template instantiations

It missed some occurrences of 0 when only looking into uninstantiated 
template
code, as Clang doesn't model them with an ImplicitCastExpr, even if the 
target
is known to be a (dependent) pointer type.

Looking into all template instantiations of course carries the risk that a 
given
use of 0 is meant to be interpreted as a pointer in some and as an integer 
in
other instantiations.  But the only case where that happened in the current 
code
base is RegistryValueList::getElement (include/registry/registry.hxx), 
where {}
is arguably a better choice anyway.  (And which would presumably also hold 
for
any future such cases.)

Change-Id: I708bcfc8bedc0a49c9282d7814eb325afa29905c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128462
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/shared/vtables.cxx 
b/bridges/source/cpp_uno/shared/vtables.cxx
index beda5ad29d44..9a7d7b376882 100644
--- a/bridges/source/cpp_uno/shared/vtables.cxx
+++ b/bridges/source/cpp_uno/shared/vtables.cxx
@@ -82,7 +82,7 @@ template< typename T > bridges::cpp_uno::shared::VtableSlot 
doGetVtableSlot(
 bridges::cpp_uno::shared::VtableSlot slot;
 slot.offset = 0;
 T * member = const_cast< T * >(ifcMember);
-while (member->pBaseRef != 0) {
+while (member->pBaseRef != nullptr) {
 assert(member->nIndex < member->pInterface->nBaseTypes);
 for (sal_Int32 i = 0; i < member->nIndex; ++i) {
 slot.offset += getVtableCount(member->pInterface->ppBaseTypes[i]);
diff --git a/compilerplugins/clang/nullptr.cxx 
b/compilerplugins/clang/nullptr.cxx
index b4a40b408a6c..1ac09292 100644
--- a/compilerplugins/clang/nullptr.cxx
+++ b/compilerplugins/clang/nullptr.cxx
@@ -75,7 +75,7 @@ public:
 
 bool TraverseInitListExpr(InitListExpr * expr, DataRecursionQueue * queue 
= nullptr);
 
-// bool shouldVisitTemplateInstantiations() const { return true; }
+bool shouldVisitTemplateInstantiations() const { return true; }
 
 private:
 bool isInLokIncludeFile(SourceLocation spellingLocation) const;
@@ -209,6 +209,9 @@ bool Nullptr::VisitParmVarDecl(ParmVarDecl const * decl) {
 if (!isAnyKindOfPointerType(decl->getType())) {
 return true;
 }
+if (decl->hasUninstantiatedDefaultArg()) {
+return true; //TODO
+}
 auto e = decl->getDefaultArg();
 if (e == nullptr) {
 return true;
diff --git a/forms/source/xforms/propertysetbase.hxx 
b/forms/source/xforms/propertysetbase.hxx
index d4b4212c45c7..2ad685c66322 100644
--- a/forms/source/xforms/propertysetbase.hxx
+++ b/forms/source/xforms/propertysetbase.hxx
@@ -93,7 +93,7 @@ public:
 
 virtual bool isWriteable() const override
 {
-return m_pWriter != 0;
+return m_pWriter != nullptr;
 }
 };
 
diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index 28d45f1ec21d..f1e5f86c8af2 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -202,7 +202,7 @@ inline bool Any::isExtractableTo( const Type & rType ) const
 template 
 inline bool Any::has() const
 {
-Type const & rType = ::cppu::getTypeFavourUnsigned(static_cast< T * >(0));
+Type const & rType = ::cppu::getTypeFavourUnsigned(static_cast< T * 
>(NULL));
 return ::uno_type_isAssignableFromData(
 rType.getTypeLibType(), pData, pType,
 cpp_queryInterface,
diff --git a/include/com/sun/star/uno/Sequence.hxx 

[Libreoffice-commits] core.git: bridges/source config_host.mk.in configure.ac solenv/gbuild

2022-01-06 Thread Caolán McNamara (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_intel/call.s  |   16 
 bridges/source/cpp_uno/gcc3_linux_x86-64/call.s |   19 +++
 config_host.mk.in   |1 +
 configure.ac|   14 ++
 solenv/gbuild/platform/com_GCC_class.mk |1 +
 5 files changed, 51 insertions(+)

New commits:
commit af55dc3891f7950d392175004b2090cb0e54828e
Author: Caolán McNamara 
AuthorDate: Wed Dec 15 12:46:24 2021 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 6 14:56:27 2022 +0100

annocheck warning about missing .note.gnu.property section

copy and paste recommendation from:
https://sourceware.org/annobin/annobin.html/Test-cf-protection.html

and adapt like:

https://github.com/openssl/openssl/commit/51994e505dbb1cd0dd76869ec962e2948b77b585
where https://bugs.ruby-lang.org/attachments/8962 is similar

Intel docs have "The ENDBR32 and ENDBR64 (collectively ENDBRANCH) are
two new instructions that are used to mark valid indirect CALL/JMP
target locations in the program."

Change-Id: Ie867c263a888763db4478720ba189c9ec6cc974d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126859
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/call.s 
b/bridges/source/cpp_uno/gcc3_linux_intel/call.s
index 6be583247733..0a5870defcf3 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/call.s
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/call.s
@@ -290,3 +290,19 @@ privateSnippetExecutorClass:
 .align 4
 .LEFDEc:
 .section .note.GNU-stack,"",@progbits
+.section .note.gnu.property,"a"
+.p2align 2
+.long 1f - 0f
+.long 4f - 1f
+.long 5
+0:
+.string "GNU"
+1:
+.p2align 2
+.long 0xc002
+.long 3f - 2f
+2:
+.long 0x3
+3:
+.p2align 2
+4:
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
index 53bfea8b254f..e7ff106244a8 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
@@ -22,6 +22,9 @@
.type   privateSnippetExecutor, @function
 privateSnippetExecutor:
 .LFB3:
+#if defined(END_BRANCH_INS_SUPPORT)
+   endbr64
+#endif
pushq   %rbp
 .LCFI0:
movq%rsp, %rbp
@@ -121,3 +124,19 @@ privateSnippetExecutor:
.align 8
 .LEFDE1:
.section.note.GNU-stack,"",@progbits
+   .section.note.gnu.property,"a"
+   .p2align 3
+   .long1f - 0f
+   .long4f - 1f
+   .long5
+0:
+   .string  "GNU"
+1:
+   .p2align 3
+   .long0xc002
+   .long3f - 2f
+2:
+   .long0x3
+3:
+   .p2align 3
+4:
diff --git a/config_host.mk.in b/config_host.mk.in
index f787994bd840..8b4f723399ab 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -266,6 +266,7 @@ export GTK4_CFLAGS=$(gb_SPACE)@GTK4_CFLAGS@
 export GTK4_LIBS=$(gb_SPACE)@GTK4_LIBS@
 export USING_X11=@USING_X11@
 export HAMCREST_JAR=@HAMCREST_JAR@
+export HAVE_ASM_END_BRANCH_INS_SUPPORT=@HAVE_ASM_END_BRANCH_INS_SUPPORT@
 export 
HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=@HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED@
 export HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW=@HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW@
 export 
HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=@HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR@
diff --git a/configure.ac b/configure.ac
index 9ef7dbe9c7b6..0d3dec0eeaf1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8040,6 +8040,20 @@ _ACEOF
 
 CPPFLAGS="$save_CPPFLAGS"
 
+AC_MSG_CHECKING([if CET endbranch is recognized])
+cat > endbr.s <<_ACEOF
+endbr32
+_ACEOF
+HAVE_ASM_END_BRANCH_INS_SUPPORT=
+if $CXX -c endbr.s -o endbr.o >/dev/null 2>&5; then
+AC_MSG_RESULT([yes])
+HAVE_ASM_END_BRANCH_INS_SUPPORT=TRUE
+else
+AC_MSG_RESULT([no])
+fi
+rm -f endbr.s endbr.o
+AC_SUBST(HAVE_ASM_END_BRANCH_INS_SUPPORT)
+
 AC_LANG_POP([C++])
 fi
 
diff --git a/solenv/gbuild/platform/com_GCC_class.mk 
b/solenv/gbuild/platform/com_GCC_class.mk
index 74f744658e15..d34464030d5e 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -44,6 +44,7 @@ $(call gb_Helper_abbreviate_dirs,\
-x assembler-with-cpp \
$(T_LTOFLAGS) \
$(gb_AFLAGS) \
+   $(if 
$(HAVE_ASM_END_BRANCH_INS_SUPPORT),-DEND_BRANCH_INS_SUPPORT) \
-c $(3) \
-o $(1)) \
$(INCLUDE) && \


[Libreoffice-commits] core.git: bridges/source

2021-12-24 Thread Arnaud VERSINI (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 82807f810b3300111820e9b2fa9a82e3e35a313a
Author: Arnaud VERSINI 
AuthorDate: Sun Dec 19 12:34:40 2021 +0100
Commit: Noel Grandin 
CommitDate: Fri Dec 24 14:53:13 2021 +0100

bridges : remove redundant public

Change-Id: I836412674448acb2a047d3d8b4711fa8d0b67257
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127410
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
index 242e2a476e23..206446a81d0c 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
@@ -57,7 +57,6 @@ private:
 };
 
 class GeneratedPad: public Generated {
-public:
 public:
 GeneratedPad(std::unique_ptr && pad): pad_(std::move(pad)) {};
 


[Libreoffice-commits] core.git: bridges/source

2021-12-20 Thread Arnaud VERSINI (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 587c530d13a5427ea6610d68d3db3fde27f50725
Author: Arnaud VERSINI 
AuthorDate: Sun Dec 19 12:34:40 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 20 14:14:44 2021 +0100

bridges : use std mutex instead of osl::Mutex.

The lock_guard moved from RTTI::GetRTTI to x86_64::getRtti to avoid 
recursive lock.

Change-Id: I0e71581dd57a4fb2655d4b9040fb9d943f73ab9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127095
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
index 6e022515b2d7..242e2a476e23 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -28,7 +29,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -74,7 +74,6 @@ class RTTI
 {
 typedef std::unordered_map< OUString, std::type_info * > t_rtti_map;
 
-osl::Mutex m_mutex;
 t_rtti_map m_rttis;
 std::vector m_rttiNames;
 std::unordered_map> m_generatedRttis;
@@ -108,7 +107,6 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription 
const & pTypeDescr)
 {
 OUString const & unoName = OUString::unacquired();
 
-osl::MutexGuard guard( m_mutex );
 t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) );
 if (iFind != m_rttis.end())
 return iFind->second;
@@ -268,6 +266,8 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription 
const & pTypeDescr)
 
 std::type_info * x86_64::getRtti(typelib_TypeDescription const & type) {
 static RTTI theRttiFactory;
+static std::mutex theMutex;
+std::lock_guard aGuard(theMutex);
 return theRttiFactory.getRTTI(type);
 }
 


[Libreoffice-commits] core.git: bridges/source

2021-10-28 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/shared/vtablefactory.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 601d0577245e5d85211da96736609a48146c847e
Author: Stephan Bergmann 
AuthorDate: Thu Oct 28 11:37:07 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 28 14:35:26 2021 +0200

Revert broken optimization attempt

This partially reverts 1a5b12aa5da2c718848d3cc5d9bce7bfcdeacf54 "optimise
find/insert pattern", which caused

> ~/llvm/inst/bin/../include/c++/v1/unordered_map:1134: _LIBCPP_ASSERT 
'__get_const_db()->__find_c_from_i(&__p) == this' failed. 
unordered_map::insert(const_iterator, const value_type&) called with an 
iterator not referring to this unordered_map

during CustomTarget_testtools/uno_test in an experimental build with
-D_LIBCPP_DEBUG=1 on macOS.

Change-Id: Id40e5eab7c3fb1f8e1bb2599c7fb84649e870ba2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124319
Reviewed-by: Noel Grandin 
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins

diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx 
b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index a8aa7a9c2bfa..53b516cded5a 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -188,12 +188,11 @@ sal_Int32 VtableFactory::BaseOffset::calculate(
 typelib_InterfaceTypeDescription * type, sal_Int32 offset)
 {
 OUString name(type->aBase.pTypeName);
-auto it = m_map.find(name);
-if (it == m_map.end()) {
+if (m_map.find(name) == m_map.end()) {
 for (sal_Int32 i = 0; i < type->nBaseTypes; ++i) {
 offset = calculate(type->ppBaseTypes[i], offset);
 }
-m_map.insert(it, {name, offset});
+m_map.insert({name, offset});
 typelib_typedescription_complete(
 reinterpret_cast< typelib_TypeDescription ** >());
 offset += bridges::cpp_uno::shared::getLocalFunctions(type);


[Libreoffice-commits] core.git: bridges/source

2021-10-13 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx |   30 +-
 1 file changed, 29 insertions(+), 1 deletion(-)

New commits:
commit 239cc612b478d82d3dd73e3a8d5be310b781a5f0
Author: Stephan Bergmann 
AuthorDate: Wed Oct 13 11:28:34 2021 +0200
Commit: Christian Lohmaier 
CommitDate: Wed Oct 13 13:43:09 2021 +0200

Extend return values < 32-bit on macOS ARM64



only mentions function arguments, not return values in "The caller of a 
function
is responsible for signing or zero-extending any argument with fewer than
32 bits.  The standard ABI expects the callee to sign or zero-extend those
arguments."  But this appears to also be relevant for return values, where 
the
callee apparently has to provide properly extended values:  Without this 
change,
in an --enable-optimized build, e.g. selecting "Tools - Macros - Organize 
Macros
- BeanShell... - LibreOffice Macros - Capitalize - capitalize.bsh" would not
enable the "Run" button, as in SvxScriptOrgDialog::CheckButtons
(cui/source/dialogs/scriptdlg.cxx) node->getType() (which returns a 
sal_Int16
value, and which calls DefaultBrowseNode::getType,
scripting/source/provider/BrowseNodeFactoryImpl.cxx, which in turn calls
m_xWrappedBrowseNode->getType() on a proxied Java object via the UNO bridge)
would return a value in r0 with bits > 16 left with random values, while the
calling code assumes them to be zero (and exploits that violated assumption 
with
--enable-optimized).

Change-Id: Ic99dd9e62b49b44e13cdde6158bef7e2296547f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123550
Reviewed-by: Tor Lillqvist 
Reviewed-by: Christian Lohmaier 
Tested-by: Christian Lohmaier 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
index b31d87655d0c..775a4aff6962 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
@@ -291,15 +291,43 @@ void call(
 switch (rtd == nullptr ? typelib_TypeClass_VOID : rtd->eTypeClass) {
 case typelib_TypeClass_VOID:
 break;
+#if defined MACOSX
 case typelib_TypeClass_BOOLEAN:
+assert(rtd->nSize == sizeof (bool));
+*gpr = static_cast(*static_cast(retin));
+assert(!retConv);
+break;
 case typelib_TypeClass_BYTE:
+assert(rtd->nSize == sizeof (sal_Int8));
+*gpr = *static_cast(retin);
+assert(!retConv);
+break;
 case typelib_TypeClass_SHORT:
+assert(rtd->nSize == sizeof (sal_Int16));
+*gpr = *static_cast(retin);
+assert(!retConv);
+break;
 case typelib_TypeClass_UNSIGNED_SHORT:
+assert(rtd->nSize == sizeof (sal_uInt16));
+*gpr = *static_cast(retin);
+assert(!retConv);
+break;
+case typelib_TypeClass_CHAR:
+assert(rtd->nSize == sizeof (sal_Unicode));
+*gpr = *static_cast(retin);
+assert(!retConv);
+break;
+#else
+case typelib_TypeClass_BOOLEAN:
+case typelib_TypeClass_BYTE:
+case typelib_TypeClass_SHORT:
+case typelib_TypeClass_UNSIGNED_SHORT:
+case typelib_TypeClass_CHAR:
+#endif
 case typelib_TypeClass_LONG:
 case typelib_TypeClass_UNSIGNED_LONG:
 case typelib_TypeClass_HYPER:
 case typelib_TypeClass_UNSIGNED_HYPER:
-case typelib_TypeClass_CHAR:
 case typelib_TypeClass_ENUM:
 std::memcpy(gpr, retin, rtd->nSize);
 assert(!retConv);


[Libreoffice-commits] core.git: bridges/source

2021-09-06 Thread Emircan Agac (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 7a8ec6cddc9f37ba6ff1a98ad39702521c8fb36b
Author: Emircan Agac 
AuthorDate: Thu Aug 19 23:58:53 2021 +0300
Commit: Ilmari Lauhakangas 
CommitDate: Mon Sep 6 15:37:48 2021 +0200

tdf#130924 : replace debugging printf calls with SAL_INFO/SAL_WARN

Change-Id: Ifede38f3b19d1e5226e18dba1aa21d478a430d9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120763
Tested-by: Jenkins
Reviewed-by: Hossein 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
index d72295039282..6e022515b2d7 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
@@ -157,9 +157,9 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription 
const & pTypeDescr)
 // symbol and rtti-name is nearly identical,
 // the symbol is prefixed with _ZTI
 char const * rttiName = symName.getStr() +4;
-#if OSL_DEBUG_LEVEL > 1
-fprintf( stderr,"generated rtti for %s\n", rttiName );
-#endif
+
+SAL_INFO("bridges", "Generated rtti for" << rttiName);
+
 std::unique_ptr newRtti;
 switch (pTypeDescr.eTypeClass) {
 case typelib_TypeClass_EXCEPTION:


[Libreoffice-commits] core.git: bridges/source

2021-08-22 Thread Caolán McNamara (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 8ff57504f75ddd35c3f585cf2224c6fcc3863ca3
Author: Caolán McNamara 
AuthorDate: Sat Aug 21 21:38:46 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 22 13:10:05 2021 +0200

WaE: protect clang diagnostic push/pop with if defined __clang__

Change-Id: I8360aa96097a13b6bad1283edddc7c2fd1ed510d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120832
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
index a22ac393b5f7..001384e005fc 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
@@ -187,11 +187,15 @@ static void MapReturn(sal_uInt32 r0, sal_uInt32 r1, 
typelib_TypeDescriptionRefer
 #if !defined(__ARM_PCS_VFP) && (defined(__ARM_EABI__) || defined(__SOFTFP__))
 pRegisterReturn[0] = r0;
 #else
+#if defined __clang__
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wuninitialized"
+#endif
 register float fret asm("s0");
 *reinterpret_cast(pRegisterReturn) = fret;
+#if defined __clang__
 #pragma clang diagnostic pop
+#endif
 #endif
 break;
 case typelib_TypeClass_DOUBLE:
@@ -199,11 +203,15 @@ static void MapReturn(sal_uInt32 r0, sal_uInt32 r1, 
typelib_TypeDescriptionRefer
 pRegisterReturn[1] = r1;
 pRegisterReturn[0] = r0;
 #else
+#if defined __clang__
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wuninitialized"
+#endif
 register double dret asm("d0");
 *reinterpret_cast(pRegisterReturn) = dret;
+#if defined __clang__
 #pragma clang diagnostic pop
+#endif
 #endif
 break;
 case typelib_TypeClass_STRUCT:


[Libreoffice-commits] core.git: bridges/source

2021-08-21 Thread Caolán McNamara (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 10c742afd5f04c2c3a3e1f881fd6a8c61d364c03
Author: Caolán McNamara 
AuthorDate: Sat Aug 21 21:05:48 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sat Aug 21 22:08:18 2021 +0200

arm: fix bridge

which went a little wrong in

commit dd91d3389c26645459d3b80649941d65efa4f63f
Date:   Sat Jan 2 14:36:44 2021 +0100

Fix some warnings for Raspberry pi 4 (part3)

Change-Id: Ief7e1146b7480a1c16ec0810f991296710214332
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120830
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
index 7a8adad90ead..a22ac393b5f7 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
@@ -298,9 +298,9 @@ void callVirtualMethod(
 
 #define INSERT_INT32( pSV, nr, pGPR, pDS ) \
 if ( nr < arm::MAX_GPR_REGS ) \
-pGPR[nr++] = reinterpret_cast( pSV ); \
+pGPR[nr++] = *reinterpret_cast( pSV ); \
 else \
-*pDS++ = reinterpret_cast( pSV );
+*pDS++ = *reinterpret_cast( pSV );
 
 #ifdef __ARM_EABI__
 #define INSERT_INT64( pSV, nr, pGPR, pDS, pStart ) \
@@ -310,8 +310,8 @@ void callVirtualMethod(
 } \
 if ( nr < arm::MAX_GPR_REGS ) \
 { \
-*reinterpret_cast(pGPR[nr++]) = 
*static_cast( pSV ); \
-*reinterpret_cast(pGPR[nr++]) = 
*(static_cast( pSV ) + 1); \
+pGPR[nr++] = *static_cast( pSV ); \
+pGPR[nr++] = *(static_cast( pSV ) + 1); \
 } \
 else \
 { \
@@ -319,8 +319,8 @@ void callVirtualMethod(
 { \
 ++pDS; \
 } \
-*reinterpret_cast(*pDS++) = 
static_cast( pSV )[0]; \
-*reinterpret_cast(*pDS++) = 
static_cast( pSV )[1]; \
+*pDS++ = static_cast( pSV )[0]; \
+*pDS++ = static_cast( pSV )[1]; \
 }
 #else
 #define INSERT_INT64( pSV, nr, pGPR, pDS, pStart ) \


[Libreoffice-commits] core.git: bridges/source

2021-08-21 Thread Caolán McNamara (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cd99b9fe6cec1fa14aba1d94228b17163cddd906
Author: Caolán McNamara 
AuthorDate: Thu Aug 19 16:15:13 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sat Aug 21 22:02:43 2021 +0200

arm: nStackBytes was already the right amount of bytes

possible regression from...

commit 6e3424ca1131fe371f63e456267de476b5eb0eae
Date:   Sat Jan 2 11:03:12 2021 +0100

Fix some warnings for Raspberry pi 4 (part2)

which changed that

Change-Id: I9a19d7d6bc1e4115be32d8d62be5d275d500
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120747
Tested-by: Caolán McNamara 
Reviewed-by: René Engelhard 
Reviewed-by: Caolán McNamara 

diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
index 8533415ed087..7a8adad90ead 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
@@ -251,7 +251,7 @@ void callVirtualMethod(
 {
 // 8-bytes aligned
 sal_uInt32 nStackBytes = ( ( nStack + 1 ) >> 1 ) * 8;
-sal_uInt32 *stack = static_cast(__builtin_alloca( 
nStackBytes * sizeof(sal_uInt32)));
+sal_uInt32 *stack = static_cast(__builtin_alloca( 
nStackBytes ));
 memcpy( stack, pStack, nStackBytes );
 }
 


[Libreoffice-commits] core.git: bridges/source testtools/com testtools/source

2021-08-02 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx  |7 ++-
 bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx  |3 ++-
 bridges/source/cpp_uno/gcc3_linux_x86-64/call.s   |   11 ---
 bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx  |   18 +-
 bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx |7 ++-
 bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.hxx |3 ++-
 bridges/source/cpp_uno/gcc3_macosx_x86-64/call.cxx|   12 +---
 bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx |   18 +-
 testtools/com/sun/star/comp/bridge/TestComponent.java |5 +
 testtools/source/bridgetest/bridgetest.cxx|6 ++
 testtools/source/bridgetest/cli/cli_cs_testobj.cs |2 ++
 testtools/source/bridgetest/cppobj.cxx|1 +
 testtools/source/bridgetest/idl/bridgetest.idl|6 ++
 13 files changed, 79 insertions(+), 20 deletions(-)

New commits:
commit d5a100f59467d94945656b54563e5ecdde2ca724
Author: Stephan Bergmann 
AuthorDate: Mon Aug 2 15:57:32 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Aug 2 18:21:30 2021 +0200

tdf#143450: Special integre+fp struct return case needs a fix too, of course

...similar to ca344be7aabf88e38841e6af6292ece6829b "tdf#143450: Fix 
special
fp+integer struct return case for gcc_*_x86-64"

Change-Id: Ia8110d632a1c5f328822c434efc5b09bd53ec9e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119883
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
index f36678ed3695..243e42d057e8 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
@@ -269,7 +269,12 @@ x86_64::ReturnKind 
x86_64::getReturnKind(typelib_TypeDescriptionReference * type
 if (n == 2 && (classes[0] == X86_64_SSE_CLASS || classes[0] == 
X86_64_SSESF_CLASS)
 && (classes[1] == X86_64_INTEGER_CLASS || classes[1] == 
X86_64_INTEGERSI_CLASS))
 {
-return ReturnKind::RegistersSpecial;
+return ReturnKind::RegistersFpInt;
+}
+if (n == 2 && (classes[0] == X86_64_INTEGER_CLASS || classes[0] == 
X86_64_INTEGERSI_CLASS)
+&& (classes[1] == X86_64_SSE_CLASS || classes[1] == 
X86_64_SSESF_CLASS))
+{
+return ReturnKind::RegistersIntFp;
 }
 return ReturnKind::RegistersGeneral;
 }
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx
index db1ed75aa243..3ef80543ac76 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx
@@ -54,7 +54,8 @@ bool return_in_hidden_param( typelib_TypeDescriptionReference 
*pTypeRef ) noexce
 enum class ReturnKind {
 Memory,
 RegistersGeneral,
-RegistersSpecial
+RegistersFpInt,
+RegistersIntFp
 };
 
 ReturnKind getReturnKind(typelib_TypeDescriptionReference * type) noexcept;
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
index ee8403ab7180..53bfea8b254f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
@@ -55,17 +55,22 @@ privateSnippetExecutor:

callcpp_vtable_call
 
-   cmp $1, %rax
-   je  .Lspecial
+   testl   %eax, %eax
+   je  .Lfpint
+   jg  .Lintfp
 
movq-144(%rbp), %rax# Potential return value 
(general case)
movq-136(%rbp), %rdx# Potential return value 
(general case)
movq-144(%rbp), %xmm0   # Potential return value 
(general case)
movq-136(%rbp), %xmm1   # Potential return value 
(general case)
jmp .Lfinish
-.Lspecial:
+.Lfpint:
movq-144(%rbp), %xmm0   # Return value (special fp and 
integer case)
movq-136(%rbp), %rax# Return value (special fp and 
integer case)
+   jmp .Lfinish
+.Lintfp:
+   movq-144(%rbp), %rax# Return value (special integer 
and fp case)
+   movq-136(%rbp), %xmm0   # Return value (special integer 
and fp case)
 
 .Lfinish:
leave
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
index 4bf5061a472f..de393582f99a 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
@@ -246,16 +246,24 @@ static int cpp2uno_call(
 {
 TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
 }
-return returnKind == x86_64::ReturnKind::RegistersSpecial ? 1 : 0;
+switch (returnKind) {
+case x86_64::ReturnKind::RegistersFpInt:
+return 0;
+ 

[Libreoffice-commits] core.git: bridges/source

2021-07-30 Thread Caolán McNamara (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit d4d8fb12e81152ad75d1ab4cabfa300aa982e589
Author: Caolán McNamara 
AuthorDate: Thu Jul 29 12:42:17 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 30 16:39:21 2021 +0200

cid#1489551 silence Uninitialized scalar variable

and

cid#1489552 Uninitialized scalar variable

Change-Id: I056cfd95d34f2163e68b83cce21bce70ccf5fc8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119701
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
index 355a0a7500d7..f36678ed3695 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
@@ -224,9 +224,8 @@ classify_argument( typelib_TypeDescriptionReference 
*pTypeRef, enum x86_64_reg_c
 bool x86_64::examine_argument( typelib_TypeDescriptionReference *pTypeRef, int 
, int  ) noexcept
 {
 enum x86_64_reg_class classes[MAX_CLASSES];
-int n;
-
-n = classify_argument( pTypeRef, classes, 0 );
+// coverity[uninit_use_in_call : FALSE]
+int n = classify_argument( pTypeRef, classes, 0 );
 
 if ( n == 0 )
 return false;
@@ -255,12 +254,14 @@ bool x86_64::return_in_hidden_param( 
typelib_TypeDescriptionReference *pTypeRef
 if (pTypeRef->eTypeClass == typelib_TypeClass_VOID) {
 return false;
 }
-x86_64_reg_class classes[MAX_CLASSES];
+enum x86_64_reg_class classes[MAX_CLASSES];
+// coverity[uninit_use_in_call : FALSE]
 return classify_argument(pTypeRef, classes, 0) == 0;
 }
 
 x86_64::ReturnKind x86_64::getReturnKind(typelib_TypeDescriptionReference * 
type) noexcept {
 x86_64_reg_class classes[MAX_CLASSES];
+// coverity[uninit_use_in_call : FALSE]
 auto const n = classify_argument(type, classes, 0);
 if (n == 0) {
 return ReturnKind::Memory;
@@ -276,9 +277,8 @@ x86_64::ReturnKind 
x86_64::getReturnKind(typelib_TypeDescriptionReference * type
 void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, const 
sal_uInt64 *pGPR, const double *pSSE, void *pStruct ) noexcept
 {
 enum x86_64_reg_class classes[MAX_CLASSES];
-int n;
-
-n = classify_argument( pTypeRef, classes, 0 );
+// coverity[uninit_use_in_call : FALSE]
+int n = classify_argument( pTypeRef, classes, 0 );
 
 sal_uInt64 *pStructAlign = static_cast( pStruct );
 for ( int i = 0; i != n; ++i )


[Libreoffice-commits] core.git: bridges/source

2021-07-28 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/call.s |   44 
 1 file changed, 23 insertions(+), 21 deletions(-)

New commits:
commit 99fa607245332d687d494d8d4404cf067ca21fb3
Author: Stephan Bergmann 
AuthorDate: Wed Jul 28 15:10:20 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jul 28 22:59:08 2021 +0200

Annotate the .eh_frame data

...to convince myself that it is only about the initial %rsp/%rbp fiddling, 
and
is not affected by the ca344be7aabf88e38841e6af6292ece6829b 
"tdf#143450: Fix
special fp+integer struct return case for gcc_*_x86-64" changes to later 
parts
of privateSnippetExecutor

Change-Id: I7bfad4cb5e1c2208e29c73a70874b6e9eff29eb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119610
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
index 00909188a7b6..ee8403ab7180 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
@@ -77,39 +77,41 @@ privateSnippetExecutor:
# and http://mentorembedded.github.io/cxx-abi/exceptions.pdf for more 
info
.section.eh_frame,"a",@unwind
 .Lframe1:
-   .long   .LECIE1-.LSCIE1
+   .long   .LECIE1-.LSCIE1 # CIE Length
 .LSCIE1:
-   .long   0x0
-   .byte   0x1
-   .string "zR"
-   .uleb128 0x1
-   .sleb128 -8
-   .byte   0x10
-   .uleb128 0x1
-   .byte   0x1b
-   .byte   0xc
+   .long   0x0 # CIE ID
+   .byte   0x1 # CIE Version
+   .string "zR"# CIE Augmentation String
+   .uleb128 0x1# CIE Code Alignment Factor
+   .sleb128 -8 # CIE Data Alignment Factor
+   .byte   0x10# CIE Return Address Register: pseudo 
"Return Address RA"
+   .uleb128 0x1# CIE Augmentation Data Length
+   .byte   0x1b# CIE Augmentation Data
+   # CIE Initial Instructions:
+   .byte   0xc #  DW_CFA_def_cfa %rsp +8
.uleb128 0x7
.uleb128 0x8
-   .byte   0x90
+   .byte   0x90#  DW_CFA_offset (pseudo "Return 
Address RA") +1 (i.e., -8)
.uleb128 0x1
.align 8
 .LECIE1:
 .LSFDE1:
-   .long   .LEFDE1-.LASFDE1
+   .long   .LEFDE1-.LASFDE1# FDE Length
 .LASFDE1:
-   .long   .LASFDE1-.Lframe1
-   .long   .LFB3-.
-   .long   .LFE3-.LFB3
-   .uleb128 0x0
-   .byte   0x4
+   .long   .LASFDE1-.Lframe1   # FDE CIE Pointer
+   .long   .LFB3-. # FDE PC Begin
+   .long   .LFE3-.LFB3 # FDE PC Range
+   .uleb128 0x0# FDE Augmentation Data Length
+   # FDE Call Frame Instructions:
+   .byte   0x4 #  DW_CFA_advance_loc4 .LCFI0
.long   .LCFI0-.LFB3
-   .byte   0xe
+   .byte   0xe #  DW_CFA_def_cfa_offset +16
.uleb128 0x10
-   .byte   0x86
+   .byte   0x86#  DW_CFA_offset %rbp +2 (i.e., -16)
.uleb128 0x2
-   .byte   0x4
+   .byte   0x4 #  DW_CFA_advance_loc4 .LCFI1
.long   .LCFI1-.LCFI0
-   .byte   0xd
+   .byte   0xd #  DW_CFA_def_cfa_register %rbp
.uleb128 0x6
.align 8
 .LEFDE1:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source testtools/com testtools/source

2021-07-28 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx  |   18 -
 bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx  |8 
 bridges/source/cpp_uno/gcc3_linux_x86-64/call.hxx |2 -
 bridges/source/cpp_uno/gcc3_linux_x86-64/call.s   |   19 --
 bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx  |   33 ++
 bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx |   18 -
 bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.hxx |8 
 bridges/source/cpp_uno/gcc3_macosx_x86-64/call.cxx|   19 --
 bridges/source/cpp_uno/gcc3_macosx_x86-64/call.hxx|3 -
 bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx |   32 ++---
 testtools/com/sun/star/comp/bridge/TestComponent.java |   12 ++
 testtools/source/bridgetest/bridgetest.cxx|   14 +++
 testtools/source/bridgetest/cli/cli_cs_testobj.cs |4 ++
 testtools/source/bridgetest/cppobj.cxx|4 ++
 testtools/source/bridgetest/idl/bridgetest.idl|   14 +++
 15 files changed, 156 insertions(+), 52 deletions(-)

New commits:
commit ca344be7aabf88e38841e6af6292ece6829b
Author: Stephan Bergmann 
AuthorDate: Tue Jul 27 23:45:19 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jul 28 13:08:07 2021 +0200

tdf#143450: Fix special fp+integer struct return case for gcc_*_x86-64

For one, the loop in x86_64::fill_struct was backwards.

And for another, privateSnippedExecutor does not need special handling of 
FLOAT
and DOUBLE return values (they can simply be moved to %xmm0, as covered by 
the
general case), but rather for those small structs where floating-point 
member(s)
in a first eightbyte (targeting %xmm0) are followed by integer member(s) in 
a
second eightbyte (targeting %rax).  Extended testtools to cover two such 
cases.

Change-Id: I8e775a1d1ce2312610f265bcc8e40b09bdac56df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119576
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
index 0f75b0616a37..355a0a7500d7 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
@@ -259,6 +259,20 @@ bool x86_64::return_in_hidden_param( 
typelib_TypeDescriptionReference *pTypeRef
 return classify_argument(pTypeRef, classes, 0) == 0;
 }
 
+x86_64::ReturnKind x86_64::getReturnKind(typelib_TypeDescriptionReference * 
type) noexcept {
+x86_64_reg_class classes[MAX_CLASSES];
+auto const n = classify_argument(type, classes, 0);
+if (n == 0) {
+return ReturnKind::Memory;
+}
+if (n == 2 && (classes[0] == X86_64_SSE_CLASS || classes[0] == 
X86_64_SSESF_CLASS)
+&& (classes[1] == X86_64_INTEGER_CLASS || classes[1] == 
X86_64_INTEGERSI_CLASS))
+{
+return ReturnKind::RegistersSpecial;
+}
+return ReturnKind::RegistersGeneral;
+}
+
 void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, const 
sal_uInt64 *pGPR, const double *pSSE, void *pStruct ) noexcept
 {
 enum x86_64_reg_class classes[MAX_CLASSES];
@@ -267,8 +281,8 @@ void x86_64::fill_struct( typelib_TypeDescriptionReference 
*pTypeRef, const sal_
 n = classify_argument( pTypeRef, classes, 0 );
 
 sal_uInt64 *pStructAlign = static_cast( pStruct );
-for ( n--; n >= 0; n-- )
-switch ( classes[n] )
+for ( int i = 0; i != n; ++i )
+switch ( classes[i] )
 {
 case X86_64_INTEGER_CLASS:
 case X86_64_INTEGERSI_CLASS:
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx
index 962801f9da17..db1ed75aa243 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx
@@ -51,6 +51,14 @@ bool examine_argument( typelib_TypeDescriptionReference 
*pTypeRef, int 
 */
 bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ) 
noexcept;
 
+enum class ReturnKind {
+Memory,
+RegistersGeneral,
+RegistersSpecial
+};
+
+ReturnKind getReturnKind(typelib_TypeDescriptionReference * type) noexcept;
+
 void fill_struct( typelib_TypeDescriptionReference *pTypeRef, const 
sal_uInt64* pGPR, const double* pSSE, void *pStruct ) noexcept;
 
 } // namespace x86_64
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.hxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.hxx
index c381aa8a9668..08b19f06 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.hxx
@@ -23,7 +23,7 @@
 
 #include 
 
-extern "C" typelib_TypeClass cpp_vtable_call(
+extern "C" int cpp_vtable_call(
 sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset,
 void ** gpreg, void ** fpreg, void ** ovrflw,
 sal_uInt64 * pRegisterReturn /* space for register return */ 

[Libreoffice-commits] core.git: bridges/source

2021-07-28 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx |   81 --
 bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.hxx |2 
 bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx |   15 +--
 3 files changed, 27 insertions(+), 71 deletions(-)

New commits:
commit 8112bcae289fcc2210c7286d7b4bc141d8f6a1c0
Author: Stephan Bergmann 
AuthorDate: Wed Jul 28 08:31:26 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jul 28 10:52:20 2021 +0200

Clean up bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx

same as 5411aafbfd8656f043bcf30588bc41b061f1b60b "Clean up
bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx"

Change-Id: I25ba66f2d666ef108265d308b7cc9badba60ae2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119579
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx
index 584197c1a226..0f75b0616a37 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx
@@ -54,6 +54,7 @@
 
 #include "abi.hxx"
 
+#include 
 #include 
 
 using namespace x86_64;
@@ -75,10 +76,6 @@ enum x86_64_reg_class
 X86_64_INTEGERSI_CLASS,
 X86_64_SSE_CLASS,
 X86_64_SSESF_CLASS,
-X86_64_SSEDF_CLASS,
-X86_64_SSEUP_CLASS,
-X86_64_X87_CLASS,
-X86_64_X87UP_CLASS,
 X86_64_MEMORY_CLASS
 };
 
@@ -120,20 +117,14 @@ merge_classes (enum x86_64_reg_class class1, enum 
x86_64_reg_class class2)
 || class2 == X86_64_INTEGER_CLASS || class2 == 
X86_64_INTEGERSI_CLASS)
 return X86_64_INTEGER_CLASS;
 
-/* Rule #5: If one of the classes is X87 or X87UP class, MEMORY is used.  
*/
-if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS
-|| class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS)
-return X86_64_MEMORY_CLASS;
-
 /* Rule #6: Otherwise class SSE is used.  */
 return X86_64_SSE_CLASS;
 }
 
-/* Classify the argument of type TYPE and mode MODE.
+/* Classify a parameter/return type.
CLASSES will be filled by the register class used to pass each word
-   of the operand.  The number of words is returned.  In case the parameter
-   should be passed in memory, 0 is returned. As a special case for zero
-   sized containers, classes[0] will be NO_CLASS and 1 is returned.
+   of the operand.  The number of words is returned.  In case the operand
+   should be passed in memory, 0 is returned.
 
See the x86-64 PS ABI for details.
 */
@@ -142,9 +133,6 @@ classify_argument( typelib_TypeDescriptionReference 
*pTypeRef, enum x86_64_reg_c
 {
 switch ( pTypeRef->eTypeClass )
 {
-case typelib_TypeClass_VOID:
-classes[0] = X86_64_NO_CLASS;
-return 1;
 case typelib_TypeClass_CHAR:
 case typelib_TypeClass_BOOLEAN:
 case typelib_TypeClass_BYTE:
@@ -167,21 +155,15 @@ classify_argument( typelib_TypeDescriptionReference 
*pTypeRef, enum x86_64_reg_c
 classes[0] = X86_64_SSE_CLASS;
 return 1;
 case typelib_TypeClass_DOUBLE:
-classes[0] = X86_64_SSEDF_CLASS;
+classes[0] = X86_64_SSE_CLASS;
 return 1;
-/*case LONGDOUBLE:
-classes[0] = X86_64_X87_CLASS;
-classes[1] = X86_64_X87UP_CLASS;
-return 2;*/
 case typelib_TypeClass_STRING:
 case typelib_TypeClass_TYPE:
 case typelib_TypeClass_ANY:
-case typelib_TypeClass_TYPEDEF:
 case typelib_TypeClass_SEQUENCE:
 case typelib_TypeClass_INTERFACE:
 return 0;
 case typelib_TypeClass_STRUCT:
-case typelib_TypeClass_EXCEPTION:
 {
 typelib_TypeDescription * pTypeDescr = nullptr;
 TYPELIB_DANGER_GET( , pTypeRef );
@@ -220,44 +202,26 @@ classify_argument( typelib_TypeDescriptionReference 
*pTypeRef, enum x86_64_reg_c
 {
 int pos = offset / 8;
 classes[i + pos] = merge_classes( subclasses[i], 
classes[i + pos] );
+if (classes[i + pos] == X86_64_MEMORY_CLASS) {
+TYPELIB_DANGER_RELEASE( pTypeDescr );
+return 0;
+}
 }
 }
 
 TYPELIB_DANGER_RELEASE( pTypeDescr );
 
-/* Final merger cleanup.  */
-for ( int i = 0; i < words; i++ )
-{
-/* If one class is MEMORY, everything should be passed in
-   memory.  */
-if ( classes[i] == X86_64_MEMORY_CLASS )
-return 0;
-
-/* The X86_64_SSEUP_CLASS should be always preceded by
-   X86_64_SSE_CLASS.  */
-if ( classes[i] == X86_64_SSEUP_CLASS
- 

[Libreoffice-commits] core.git: bridges/source

2021-07-27 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx |   81 ---
 bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx |2 
 bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx |9 +-
 3 files changed, 24 insertions(+), 68 deletions(-)

New commits:
commit 5411aafbfd8656f043bcf30588bc41b061f1b60b
Author: Stephan Bergmann 
AuthorDate: Tue Jul 27 16:16:16 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jul 27 22:57:51 2021 +0200

Clean up bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx

...without any intended functional changes, in preparation for actual fixes 
for
tdf#143450 "Data corruption when returning small structs containing a double
from C++ via IPC".

Much of the code (apparently originally copied from some other project,
according to the comments) was too generic for our specific needs here.

Change-Id: Iddcb58fa0999d10dcf716dd2af7dab1620839bce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119570
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
index 584197c1a226..0f75b0616a37 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
@@ -54,6 +54,7 @@
 
 #include "abi.hxx"
 
+#include 
 #include 
 
 using namespace x86_64;
@@ -75,10 +76,6 @@ enum x86_64_reg_class
 X86_64_INTEGERSI_CLASS,
 X86_64_SSE_CLASS,
 X86_64_SSESF_CLASS,
-X86_64_SSEDF_CLASS,
-X86_64_SSEUP_CLASS,
-X86_64_X87_CLASS,
-X86_64_X87UP_CLASS,
 X86_64_MEMORY_CLASS
 };
 
@@ -120,20 +117,14 @@ merge_classes (enum x86_64_reg_class class1, enum 
x86_64_reg_class class2)
 || class2 == X86_64_INTEGER_CLASS || class2 == 
X86_64_INTEGERSI_CLASS)
 return X86_64_INTEGER_CLASS;
 
-/* Rule #5: If one of the classes is X87 or X87UP class, MEMORY is used.  
*/
-if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS
-|| class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS)
-return X86_64_MEMORY_CLASS;
-
 /* Rule #6: Otherwise class SSE is used.  */
 return X86_64_SSE_CLASS;
 }
 
-/* Classify the argument of type TYPE and mode MODE.
+/* Classify a parameter/return type.
CLASSES will be filled by the register class used to pass each word
-   of the operand.  The number of words is returned.  In case the parameter
-   should be passed in memory, 0 is returned. As a special case for zero
-   sized containers, classes[0] will be NO_CLASS and 1 is returned.
+   of the operand.  The number of words is returned.  In case the operand
+   should be passed in memory, 0 is returned.
 
See the x86-64 PS ABI for details.
 */
@@ -142,9 +133,6 @@ classify_argument( typelib_TypeDescriptionReference 
*pTypeRef, enum x86_64_reg_c
 {
 switch ( pTypeRef->eTypeClass )
 {
-case typelib_TypeClass_VOID:
-classes[0] = X86_64_NO_CLASS;
-return 1;
 case typelib_TypeClass_CHAR:
 case typelib_TypeClass_BOOLEAN:
 case typelib_TypeClass_BYTE:
@@ -167,21 +155,15 @@ classify_argument( typelib_TypeDescriptionReference 
*pTypeRef, enum x86_64_reg_c
 classes[0] = X86_64_SSE_CLASS;
 return 1;
 case typelib_TypeClass_DOUBLE:
-classes[0] = X86_64_SSEDF_CLASS;
+classes[0] = X86_64_SSE_CLASS;
 return 1;
-/*case LONGDOUBLE:
-classes[0] = X86_64_X87_CLASS;
-classes[1] = X86_64_X87UP_CLASS;
-return 2;*/
 case typelib_TypeClass_STRING:
 case typelib_TypeClass_TYPE:
 case typelib_TypeClass_ANY:
-case typelib_TypeClass_TYPEDEF:
 case typelib_TypeClass_SEQUENCE:
 case typelib_TypeClass_INTERFACE:
 return 0;
 case typelib_TypeClass_STRUCT:
-case typelib_TypeClass_EXCEPTION:
 {
 typelib_TypeDescription * pTypeDescr = nullptr;
 TYPELIB_DANGER_GET( , pTypeRef );
@@ -220,44 +202,26 @@ classify_argument( typelib_TypeDescriptionReference 
*pTypeRef, enum x86_64_reg_c
 {
 int pos = offset / 8;
 classes[i + pos] = merge_classes( subclasses[i], 
classes[i + pos] );
+if (classes[i + pos] == X86_64_MEMORY_CLASS) {
+TYPELIB_DANGER_RELEASE( pTypeDescr );
+return 0;
+}
 }
 }
 
 TYPELIB_DANGER_RELEASE( pTypeDescr );
 
-/* Final merger cleanup.  */
-for ( int i = 0; i < words; i++ )
-{
-/* If one class is MEMORY, everything should be passed in
-   memory.  */
-if ( classes[i] == X86_64_MEMORY_CLASS )
-  

[Libreoffice-commits] core.git: bridges/source

2021-07-27 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx |8 
 bridges/source/cpp_uno/gcc3_ios/except.cxx |6 +++---
 bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx |6 +++---
 bridges/source/cpp_uno/gcc3_linux_arm/except.cxx   |6 +++---
 bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx  |6 +++---
 bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx  |6 +++---
 bridges/source/cpp_uno/gcc3_linux_intel/except.cxx |6 +++---
 bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx  |6 +++---
 bridges/source/cpp_uno/gcc3_linux_mips/except.cxx  |6 +++---
 bridges/source/cpp_uno/gcc3_linux_mips64/except.cxx|6 +++---
 bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx   |6 +++---
 bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx |6 +++---
 bridges/source/cpp_uno/gcc3_linux_s390/except.cxx  |6 +++---
 bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx |6 +++---
 bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx |6 +++---
 bridges/source/cpp_uno/gcc3_linux_sparc64/except.cxx   |6 +++---
 bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx  |   17 -
 bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx   |6 +++---
 bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx   |6 +++---
 bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx   |6 +++---
 20 files changed, 62 insertions(+), 71 deletions(-)

New commits:
commit b4a46b47b6c1eab5c293648f5d89e61dd4639213
Author: Stephan Bergmann 
AuthorDate: Tue Jul 27 09:57:16 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jul 27 13:38:40 2021 +0200

Revert "osl::Mutex->std::mutex in bridges/except"

This reverts commit 739aaf02db3353fac8490272cab0c9486570f76d.  At least in
bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx, getRTTI can call 
itself
recursively, causing a deadlock on RTTI::m_mutex.  In
bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx that has been addressed 
with
RTTI::getRTTI_NoLock, but other implementations have not been modified.  
Avoid
regressions, esp. on more esoteric platforms, by reverting the change.

Conflicts:
bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx

Change-Id: I08b57b0561923bdbe191c8e93f8f400e0e4df337
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119442
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx 
b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx
index 591a5c94742d..e87590592888 100644
--- a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx
@@ -24,11 +24,11 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include "share.hxx"
 #include 
@@ -90,8 +90,8 @@ class RTTI
 {
 typedef std::unordered_map< OUString, type_info * > t_rtti_map;
 
-std::mutex m_mutex;
-t_rtti_map m_rttis;
+Mutex m_mutex;
+t_rtti_map m_rttis;
 t_rtti_map m_generatedRttis;
 
 void * m_hApp;
@@ -120,7 +120,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription 
*pTypeDescr )
 
 OUString const & unoName = *(OUString const *)>aBase.pTypeName;
 
-std::lock_guard guard( m_mutex );
+MutexGuard guard( m_mutex );
 t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) );
 if (iFind == m_rttis.end())
 {
diff --git a/bridges/source/cpp_uno/gcc3_ios/except.cxx 
b/bridges/source/cpp_uno/gcc3_ios/except.cxx
index 30658b708e1a..d5c49859db27 100644
--- a/bridges/source/cpp_uno/gcc3_ios/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios/except.cxx
@@ -31,11 +31,11 @@
 #include "com/sun/star/uno/RuntimeException.hpp"
 #include "com/sun/star/uno/genfunc.hxx"
 #include 
+#include "osl/mutex.hxx"
 #include "rtl/strbuf.hxx"
 #include "rtl/ustrbuf.hxx"
 #include "typelib/typedescription.h"
 #include "uno/any2.h"
-#include 
 #include 
 #include "share.hxx"
 
@@ -145,7 +145,7 @@ class RTTI
 {
 typedef std::unordered_map< OUString, std::type_info *, OUStringHash > 
t_rtti_map;
 
-std::mutex m_mutex;
+Mutex m_mutex;
 t_rtti_map m_rttis;
 t_rtti_map m_generatedRttis;
 
@@ -175,7 +175,7 @@ std::type_info * RTTI::getRTTI( 
typelib_CompoundTypeDescription *pTypeDescr )
 
 OUString const & unoName = 
OUString::unacquired(>aBase.pTypeName);
 
-std::lock_guard guard( m_mutex );
+MutexGuard guard( m_mutex );
 t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) );
 if (iFind == m_rttis.end())
 {
diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx 
b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx
index 762d6036c7e9..9331665fab7f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx
@@ -24,11 +24,11 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 

[Libreoffice-commits] core.git: bridges/source

2021-07-19 Thread Noel Grandin (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx |  273 ++
 1 file changed, 134 insertions(+), 139 deletions(-)

New commits:
commit bda0ea24f83ab5c8a6215f594d99ea680af55e5b
Author: Noel Grandin 
AuthorDate: Mon Jul 19 10:56:03 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 19 17:52:15 2021 +0200

flatten RTTI code

Change-Id: If56de2708254348b6b759ecdd2b1fb259562af69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119169
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
index 839c25755098..30201a1739e3 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
@@ -117,163 +117,158 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription 
const & pTypeDescr)
 
 std::type_info * RTTI::getRTTI_NoLock(typelib_TypeDescription const & 
pTypeDescr)
 {
-std::type_info * rtti;
-
 OUString const & unoName = OUString::unacquired();
 
 t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) );
-if (iFind == m_rttis.end())
+if (iFind != m_rttis.end())
+return iFind->second;
+
+std::type_info * rtti;
+
+// RTTI symbol
+OStringBuffer buf( 64 );
+buf.append( "_ZTIN" );
+sal_Int32 index = 0;
+do
 {
-// RTTI symbol
-OStringBuffer buf( 64 );
-buf.append( "_ZTIN" );
-sal_Int32 index = 0;
-do
-{
-OUString token( unoName.getToken( 0, '.', index ) );
-buf.append( token.getLength() );
-OString c_token( OUStringToOString( token, 
RTL_TEXTENCODING_ASCII_US ) );
-buf.append( c_token );
-}
-while (index >= 0);
-buf.append( 'E' );
+OUString token( unoName.getToken( 0, '.', index ) );
+buf.append( token.getLength() );
+OString c_token( OUStringToOString( token, RTL_TEXTENCODING_ASCII_US ) 
);
+buf.append( c_token );
+}
+while (index >= 0);
+buf.append( 'E' );
 
-OString symName( buf.makeStringAndClear() );
+OString symName( buf.makeStringAndClear() );
 #if !defined ANDROID
-rtti = static_cast(dlsym( m_hApp, symName.getStr() 
));
+rtti = static_cast(dlsym( m_hApp, symName.getStr() ));
 #else
-rtti = static_cast(dlsym( RTLD_DEFAULT, 
symName.getStr() ));
+rtti = static_cast(dlsym( RTLD_DEFAULT, symName.getStr() 
));
 #endif
 
-if (rtti)
+if (rtti)
+{
+std::pair< t_rtti_map::iterator, bool > insertion (
+m_rttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
+SAL_WARN_IF( !insertion.second, "bridges", "key " << unoName << " 
already in rtti map" );
+return rtti;
+}
+
+// try to lookup the symbol in the generated rtti map
+auto iFind2( m_generatedRttis.find( unoName ) );
+if (iFind2 != m_generatedRttis.end())
+{
+// taking already generated rtti
+rtti = iFind2->second->get();
+return rtti;
+}
+
+// we must generate it !
+// symbol and rtti-name is nearly identical,
+// the symbol is prefixed with _ZTI
+char const * rttiName = symName.getStr() +4;
+#if OSL_DEBUG_LEVEL > 1
+fprintf( stderr,"generated rtti for %s\n", rttiName );
+#endif
+std::unique_ptr newRtti;
+switch (pTypeDescr.eTypeClass) {
+case typelib_TypeClass_EXCEPTION:
 {
-std::pair< t_rtti_map::iterator, bool > insertion (
-m_rttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
-SAL_WARN_IF( !insertion.second, "bridges", "key " << unoName << " 
already in rtti map" );
+typelib_CompoundTypeDescription const & ctd
+= reinterpret_cast<
+typelib_CompoundTypeDescription const &>(
+pTypeDescr);
+if (ctd.pBaseTypeDescription)
+{
+// ensure availability of base
+std::type_info * base_rtti = getRTTI_NoLock(
+ctd.pBaseTypeDescription->aBase);
+m_rttiNames.emplace_back(OString(rttiName));
+std::unique_ptr info(
+new __cxxabiv1::__si_class_type_info(
+   m_rttiNames.back().getStr(), 
static_cast<__cxxabiv1::__class_type_info *>(base_rtti) ));
+newRtti.reset(new GeneratedPlain(std::move(info)));
+}
+else
+{
+// this class has no base class
+m_rttiNames.emplace_back(OString(rttiName));
+std::unique_ptr info(
+new 
__cxxabiv1::__class_type_info(m_rttiNames.back().getStr()));
+newRtti.reset(new GeneratedPlain(std::move(info)));
+}
+break;
 }
-else
+case typelib_TypeClass_INTERFACE:
 {
-// try to lookup the 

[Libreoffice-commits] core.git: bridges/source

2021-07-19 Thread Noel Grandin (via logerrit)
 bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx |8 
 bridges/source/cpp_uno/gcc3_ios/except.cxx |6 +++---
 bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx |6 +++---
 bridges/source/cpp_uno/gcc3_linux_arm/except.cxx   |6 +++---
 bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx  |6 +++---
 bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx  |6 +++---
 bridges/source/cpp_uno/gcc3_linux_intel/except.cxx |6 +++---
 bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx  |6 +++---
 bridges/source/cpp_uno/gcc3_linux_mips/except.cxx  |6 +++---
 bridges/source/cpp_uno/gcc3_linux_mips64/except.cxx|6 +++---
 bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx   |6 +++---
 bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx |6 +++---
 bridges/source/cpp_uno/gcc3_linux_s390/except.cxx  |6 +++---
 bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx |6 +++---
 bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx |6 +++---
 bridges/source/cpp_uno/gcc3_linux_sparc64/except.cxx   |6 +++---
 bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx  |   17 +
 bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx   |6 +++---
 bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx   |6 +++---
 bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx   |6 +++---
 20 files changed, 71 insertions(+), 62 deletions(-)

New commits:
commit 739aaf02db3353fac8490272cab0c9486570f76d
Author: Noel Grandin 
AuthorDate: Sun Jul 18 14:46:09 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 19 12:38:02 2021 +0200

osl::Mutex->std::mutex in bridges/except

I changed all the bridges to keep them in sync, but only
tested on the LibreOffice CI machines.

Change-Id: Id8fef017cc6c99c60d64b8f849220d5336abc5d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119140
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx 
b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx
index e87590592888..591a5c94742d 100644
--- a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx
@@ -24,11 +24,11 @@
 
 #include 
 #include 
-#include 
 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "share.hxx"
 #include 
@@ -90,8 +90,8 @@ class RTTI
 {
 typedef std::unordered_map< OUString, type_info * > t_rtti_map;
 
-Mutex m_mutex;
-t_rtti_map m_rttis;
+std::mutex m_mutex;
+t_rtti_map m_rttis;
 t_rtti_map m_generatedRttis;
 
 void * m_hApp;
@@ -120,7 +120,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription 
*pTypeDescr )
 
 OUString const & unoName = *(OUString const *)>aBase.pTypeName;
 
-MutexGuard guard( m_mutex );
+std::lock_guard guard( m_mutex );
 t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) );
 if (iFind == m_rttis.end())
 {
diff --git a/bridges/source/cpp_uno/gcc3_ios/except.cxx 
b/bridges/source/cpp_uno/gcc3_ios/except.cxx
index d5c49859db27..30658b708e1a 100644
--- a/bridges/source/cpp_uno/gcc3_ios/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios/except.cxx
@@ -31,11 +31,11 @@
 #include "com/sun/star/uno/RuntimeException.hpp"
 #include "com/sun/star/uno/genfunc.hxx"
 #include 
-#include "osl/mutex.hxx"
 #include "rtl/strbuf.hxx"
 #include "rtl/ustrbuf.hxx"
 #include "typelib/typedescription.h"
 #include "uno/any2.h"
+#include 
 #include 
 #include "share.hxx"
 
@@ -145,7 +145,7 @@ class RTTI
 {
 typedef std::unordered_map< OUString, std::type_info *, OUStringHash > 
t_rtti_map;
 
-Mutex m_mutex;
+std::mutex m_mutex;
 t_rtti_map m_rttis;
 t_rtti_map m_generatedRttis;
 
@@ -175,7 +175,7 @@ std::type_info * RTTI::getRTTI( 
typelib_CompoundTypeDescription *pTypeDescr )
 
 OUString const & unoName = 
OUString::unacquired(>aBase.pTypeName);
 
-MutexGuard guard( m_mutex );
+std::lock_guard guard( m_mutex );
 t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) );
 if (iFind == m_rttis.end())
 {
diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx 
b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx
index 9331665fab7f..762d6036c7e9 100644
--- a/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx
@@ -24,11 +24,11 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "share.hxx"
 
@@ -87,7 +87,7 @@ class RTTI
 {
 typedef std::unordered_map< OUString, type_info * > t_rtti_map;
 
-Mutex m_mutex;
+std::mutex m_mutex;
 t_rtti_map m_rttis;
 t_rtti_map m_generatedRttis;
 
@@ -117,7 +117,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription 
*pTypeDescr )
 
 OUString const & unoName = *(OUString const *)>aBase.pTypeName;
 
-MutexGuard guard( m_mutex );
+

[Libreoffice-commits] core.git: bridges/source

2021-05-07 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx   |   10 +-
 bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.hxx   |6 +++---
 bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx |2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 37dd4cb99bf44e57cca0272ed6de8c8156f35efa
Author: Stephan Bergmann 
AuthorDate: Fri May 7 09:09:27 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri May 7 11:12:15 2021 +0200

loplugin:noexcept (macOS)

Change-Id: I7eede75da6b81777661e0e5b76c8877e122f941b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115224
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx
index ceed901f9e11..584197c1a226 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx
@@ -95,7 +95,7 @@ enum x86_64_reg_class
 
 static enum x86_64_reg_class
 merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2)
-throw ()
+noexcept
 {
 /* Rule #1: If both classes are equal, this is the resulting class.  */
 if (class1 == class2)
@@ -138,7 +138,7 @@ merge_classes (enum x86_64_reg_class class1, enum 
x86_64_reg_class class2)
See the x86-64 PS ABI for details.
 */
 static int
-classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum 
x86_64_reg_class classes[], int byteOffset ) throw ()
+classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum 
x86_64_reg_class classes[], int byteOffset ) noexcept
 {
 switch ( pTypeRef->eTypeClass )
 {
@@ -257,7 +257,7 @@ classify_argument( typelib_TypeDescriptionReference 
*pTypeRef, enum x86_64_reg_c
 
 /* Examine the argument and return set number of register required in each
class.  Return 0 iff parameter should be passed in memory.  */
-bool x86_64::examine_argument( typelib_TypeDescriptionReference *pTypeRef, 
bool bInReturn, int , int  ) throw ()
+bool x86_64::examine_argument( typelib_TypeDescriptionReference *pTypeRef, 
bool bInReturn, int , int  ) noexcept
 {
 enum x86_64_reg_class classes[MAX_CLASSES];
 int n;
@@ -296,14 +296,14 @@ bool x86_64::examine_argument( 
typelib_TypeDescriptionReference *pTypeRef, bool
 return true;
 }
 
-bool x86_64::return_in_hidden_param( typelib_TypeDescriptionReference 
*pTypeRef ) throw ()
+bool x86_64::return_in_hidden_param( typelib_TypeDescriptionReference 
*pTypeRef ) noexcept
 {
 int g, s;
 
 return !examine_argument( pTypeRef, true, g, s );
 }
 
-void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, const 
sal_uInt64 *pGPR, const double *pSSE, void *pStruct ) throw ()
+void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, const 
sal_uInt64 *pGPR, const double *pSSE, void *pStruct ) noexcept
 {
 enum x86_64_reg_class classes[MAX_CLASSES];
 int n;
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.hxx 
b/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.hxx
index e8f8785c4a60..20bfc7286b4d 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.hxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.hxx
@@ -41,7 +41,7 @@ const sal_uInt32 MAX_SSE_REGS = 8;
 
  Return false iff parameter should be passed in memory.
 */
-bool examine_argument( typelib_TypeDescriptionReference *pTypeRef, bool 
bInReturn, int , int  ) throw ();
+bool examine_argument( typelib_TypeDescriptionReference *pTypeRef, bool 
bInReturn, int , int  ) noexcept;
 
 /** Does function that returns this type use a hidden parameter, or registers?
 
@@ -49,9 +49,9 @@ bool examine_argument( typelib_TypeDescriptionReference 
*pTypeRef, bool bInRetur
  pointer to a structure allocated by the caller), or in registers (rax, rdx
  for the integers, xmm0, xmm1 for the floating point numbers).
 */
-bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ) 
throw ();
+bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ) 
noexcept;
 
-void fill_struct( typelib_TypeDescriptionReference *pTypeRef, const 
sal_uInt64* pGPR, const double* pSSE, void *pStruct ) throw ();
+void fill_struct( typelib_TypeDescriptionReference *pTypeRef, const 
sal_uInt64* pGPR, const double* pSSE, void *pStruct ) noexcept;
 
 } // namespace x86_64
 
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx 
b/bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx
index deada0c17ac3..6b09d99a56c1 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx
@@ -142,7 +142,7 @@ struct __cxa_eh_globals
 
 }
 
-extern "C" CPPU_CURRENT_NAMESPACE::__cxa_eh_globals *__cxa_get_globals () 
throw();
+extern "C" CPPU_CURRENT_NAMESPACE::__cxa_eh_globals *__cxa_get_globals () 
noexcept;
 
 namespace CPPU_CURRENT_NAMESPACE
 {
___
Libreoffice-commits mailing list

[Libreoffice-commits] core.git: bridges/source connectivity/source

2021-05-03 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx|2 +-
 connectivity/source/drivers/macab/MacabResultSet.cxx |4 ++--
 connectivity/source/drivers/macab/MacabResultSet.hxx |4 ++--
 connectivity/source/drivers/macab/MacabResultSetMetaData.hxx |2 +-
 connectivity/source/drivers/macab/MacabStatement.cxx |4 ++--
 connectivity/source/drivers/macab/MacabStatement.hxx |4 ++--
 6 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 0d913b281d3b59b7411b2bd0d348be2d15539569
Author: Stephan Bergmann 
AuthorDate: Mon May 3 17:13:31 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 4 07:44:27 2021 +0200

loplugin:noexcept (macOS)

Change-Id: Ib8951e9590d70ffecf8fd6af3070ef9c6d4ae151
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115044
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx
index d83ecb2ae91f..10495582dcc0 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx
@@ -115,7 +115,7 @@ struct __cxa_eh_globals {
 
 #if !HAVE_CXXABI_H_CXA_GET_GLOBALS
 namespace __cxxabiv1 {
-extern "C" __cxa_eh_globals * __cxa_get_globals() throw();
+extern "C" __cxa_eh_globals * __cxa_get_globals() noexcept;
 }
 #endif
 
diff --git a/connectivity/source/drivers/macab/MacabResultSet.cxx 
b/connectivity/source/drivers/macab/MacabResultSet.cxx
index 090620af49d0..ecb4ea79e417 100644
--- a/connectivity/source/drivers/macab/MacabResultSet.cxx
+++ b/connectivity/source/drivers/macab/MacabResultSet.cxx
@@ -157,12 +157,12 @@ Any SAL_CALL MacabResultSet::queryInterface(const Type & 
rType)
 return aRet;
 }
 
-void SAL_CALL MacabResultSet::acquire() throw()
+void SAL_CALL MacabResultSet::acquire() noexcept
 {
 MacabResultSet_BASE::acquire();
 }
 
-void SAL_CALL MacabResultSet::release() throw()
+void SAL_CALL MacabResultSet::release() noexcept
 {
 MacabResultSet_BASE::release();
 }
diff --git a/connectivity/source/drivers/macab/MacabResultSet.hxx 
b/connectivity/source/drivers/macab/MacabResultSet.hxx
index d0d8061f417c..306ef562d3b4 100644
--- a/connectivity/source/drivers/macab/MacabResultSet.hxx
+++ b/connectivity/source/drivers/macab/MacabResultSet.hxx
@@ -104,8 +104,8 @@ namespace connectivity::macab
 
 // XInterface
 virtual css::uno::Any SAL_CALL queryInterface( const 
css::uno::Type & rType ) override;
-virtual void SAL_CALL acquire() throw() override;
-virtual void SAL_CALL release() throw() override;
+virtual void SAL_CALL acquire() noexcept override;
+virtual void SAL_CALL release() noexcept override;
 
 // XTypeProvider
 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) 
override;
diff --git a/connectivity/source/drivers/macab/MacabResultSetMetaData.hxx 
b/connectivity/source/drivers/macab/MacabResultSetMetaData.hxx
index 6db5f240ac24..a7afdf4a094a 100644
--- a/connectivity/source/drivers/macab/MacabResultSetMetaData.hxx
+++ b/connectivity/source/drivers/macab/MacabResultSetMetaData.hxx
@@ -45,7 +45,7 @@ namespace connectivity::macab
 MacabResultSetMetaData(MacabConnection* _pConnection, OUString 
const & _sTableName);
 
 // avoid ambiguous cast error from the compiler
-operator css::uno::Reference< css::sdbc::XResultSetMetaData > () 
throw()
+operator css::uno::Reference< css::sdbc::XResultSetMetaData > () 
noexcept
 { return this; }
 
 /// @throws css::sdbc::SQLException
diff --git a/connectivity/source/drivers/macab/MacabStatement.cxx 
b/connectivity/source/drivers/macab/MacabStatement.cxx
index 450213f7cca5..1f317150d249 100644
--- a/connectivity/source/drivers/macab/MacabStatement.cxx
+++ b/connectivity/source/drivers/macab/MacabStatement.cxx
@@ -568,12 +568,12 @@ void 
MacabCommonStatement::getFastPropertyValue(Any&,sal_Int32 nHandle) const
 }
 }
 
-void SAL_CALL MacabCommonStatement::acquire() throw()
+void SAL_CALL MacabCommonStatement::acquire() noexcept
 {
 MacabCommonStatement_BASE::acquire();
 }
 
-void SAL_CALL MacabCommonStatement::release() throw()
+void SAL_CALL MacabCommonStatement::release() noexcept
 {
 MacabCommonStatement_BASE::release();
 }
diff --git a/connectivity/source/drivers/macab/MacabStatement.hxx 
b/connectivity/source/drivers/macab/MacabStatement.hxx
index 83142fc56618..6b0c53c234ad 100644
--- a/connectivity/source/drivers/macab/MacabStatement.hxx
+++ b/connectivity/source/drivers/macab/MacabStatement.hxx
@@ -106,8 +106,8 @@ namespace connectivity::macab
 using MacabCommonStatement_BASE::disposing;
 
 // XInterface
-virtual void SAL_CALL release() throw() override;
-virtual void SAL_CALL acquire() throw() override;
+virtual 

[Libreoffice-commits] core.git: bridges/source chart2/source connectivity/source dbaccess/source desktop/source extensions/source filter/source forms/source framework/source idlc/source idl/source io/

2021-04-29 Thread Noel Grandin (via logerrit)
 bridges/source/cpp_uno/shared/component.cxx |   21 -
 chart2/source/tools/ObjectIdentifier.cxx|   54 ---
 connectivity/source/commontools/dbconversion.cxx|5 
 connectivity/source/drivers/hsqldb/HView.cxx|   11 
 connectivity/source/drivers/mysqlc/mysqlc_resultsetmetadata.cxx |6 
 dbaccess/source/core/dataaccess/documentdefinition.cxx  |6 
 dbaccess/source/core/misc/sdbcoretools.cxx  |9 
 dbaccess/source/filter/hsqldb/parseschema.cxx   |5 
 dbaccess/source/ui/app/AppDetailPageHelper.cxx  |7 
 dbaccess/source/ui/app/DocumentInfoPreview.cxx  |8 
 dbaccess/source/ui/misc/WCopyTable.cxx  |8 
 dbaccess/source/ui/querydesign/QueryDesignView.cxx  |9 
 desktop/source/app/dispatchwatcher.cxx  |   17 -
 desktop/source/deployment/gui/dp_gui_dialog2.cxx|7 
 desktop/source/deployment/manager/dp_properties.cxx |9 
 desktop/source/deployment/registry/package/dp_package.cxx   |   15 
 extensions/source/logging/simpletextformatter.cxx   |   13 
 filter/source/xsltdialog/typedetectionexport.cxx|   37 +-
 forms/source/component/ComboBox.cxx |   12 
 framework/source/accelerators/presethandler.cxx |   12 
 framework/source/fwe/classes/addonsoptions.cxx  |  152 
--
 framework/source/xml/acceleratorconfigurationreader.cxx |   12 
 framework/source/xml/imagesdocumenthandler.cxx  |7 
 idl/source/prj/database.cxx |4 
 idlc/source/options.cxx |5 
 io/source/acceptor/acc_socket.cxx   |   17 -
 io/source/connector/ctr_socket.cxx  |   17 -
 linguistic/source/dicimp.cxx|   12 
 lotuswordpro/source/filter/lwptblformula.cxx|   10 
 oox/source/core/xmlfilterbase.cxx   |4 
 oox/source/drawingml/chart/objectformatter.cxx  |4 
 oox/source/export/vmlexport.cxx |   17 -
 oox/source/ppt/presentationfragmenthandler.cxx  |5 
 oox/source/vml/vmlformatting.cxx|4 
 reportdesign/source/core/api/ReportEngineJFree.cxx  |8 
 reportdesign/source/core/misc/reportformula.cxx |5 
 sc/inc/dputil.hxx   |2 
 sc/source/core/data/dpcache.cxx |6 
 sc/source/core/data/dputil.cxx  |   16 -
 sc/source/core/data/funcdesc.cxx|   10 
 sc/source/core/tool/chartarr.cxx|9 
 sc/source/filter/xml/XMLExportDatabaseRanges.cxx|6 
 sc/source/filter/xml/xmlimprt.cxx   |   16 -
 sc/source/ui/app/inputhdl.cxx   |   12 
 sc/source/ui/formdlg/dwfunctr.cxx   |   12 
 sc/source/ui/view/gridwin.cxx   |   34 +-
 scripting/source/provider/MasterScriptProvider.cxx  |   13 
 scripting/source/provider/URIHelper.cxx |   26 -
 sd/source/ui/remotecontrol/ImagePreparer.cxx|   14 
 sdext/source/pdfimport/misc/pdfihelper.cxx  |   12 
 sfx2/source/appl/appserv.cxx|   19 -
 sfx2/source/appl/macroloader.cxx|   11 
 sfx2/source/view/viewsh.cxx |9 
 stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx|9 
 svx/source/engine3d/cube3d.cxx  |9 
 svx/source/engine3d/extrud3d.cxx|9 
 svx/source/engine3d/lathe3d.cxx |9 
 svx/source/engine3d/obj3d.cxx   |9 
 svx/source/engine3d/scene3d.cxx |   11 
 svx/source/engine3d/sphere3d.cxx|9 
 svx/source/form/fmshimp.cxx |8 
 svx/source/svdraw/svdoashp.cxx  |   11 
 svx/source/svdraw/svdobj.cxx|   11 
 svx/source/svdraw/svdocapt.cxx  |   11 
 svx/source/svdraw/svdocirc.cxx  |   21 -
 svx/source/svdraw/svdoedge.cxx  |   11 
 svx/source/svdraw/svdogrp.cxx   |   15 
 svx/source/svdraw/svdomeas.cxx  |   11 
 

[Libreoffice-commits] core.git: bridges/source

2021-03-02 Thread Tor Lillqvist (via logerrit)
 bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx |   24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

New commits:
commit ad85bf85c3879c9aa5c98f1d03e3e14aaea7fe2c
Author: Tor Lillqvist 
AuthorDate: Tue Mar 2 14:30:03 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Mar 2 15:52:12 2021 +0100

Handle floating-point return values correctly on iOS

The code did not work at all. The contents of register d0 that we
tried to access in MapReturn() was not what the called function had
stored there. Probably the clobber list in the __asm__ statement is
wrong? Anyway, simpler to fix it by explicitly storing d0, too, into a
variable after the call, like we do for x0 and x1, and then pass that
variable, too, to MapReturn().

Fixes https://github.com/CollaboraOnline/online/issues/1519 .

Change-Id: Id05c8c57209eb9ade4d67035830b2dec601bc046
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111826
Tested-by: Michael Meeks 
Tested-by: Tor Lillqvist 
Reviewed-by: Michael Meeks 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111835

diff --git a/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx
index eacd01332900..07ec8501f0df 100644
--- a/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx
@@ -77,7 +77,7 @@ namespace arm
 }
 }
 
-void MapReturn(sal_uInt64 x0, sal_uInt64 x1, typelib_TypeDescriptionReference 
*pReturnType, sal_uInt64 *pRegisterReturn)
+void MapReturn(sal_uInt64 x0, sal_uInt64 x1, double d0, 
typelib_TypeDescriptionReference *pReturnType, sal_uInt64 *pRegisterReturn)
 {
 switch( pReturnType->eTypeClass )
 {
@@ -96,18 +96,10 @@ void MapReturn(sal_uInt64 x0, sal_uInt64 x1, 
typelib_TypeDescriptionReference *p
 pRegisterReturn[0] = x0;
 break;
 case typelib_TypeClass_FLOAT:
-register float fret asm("s0");
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wuninitialized"
-*(float*)pRegisterReturn = fret;
-#pragma GCC diagnostic pop
+*(float*)pRegisterReturn = *(float*)
 break;
 case typelib_TypeClass_DOUBLE:
-register double dret asm("d0");
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wuninitialized"
-*(double*)pRegisterReturn = dret;
-#pragma GCC diagnostic pop
+*(double*)pRegisterReturn = d0;
 break;
 case typelib_TypeClass_STRUCT:
 case typelib_TypeClass_EXCEPTION:
@@ -153,9 +145,11 @@ void callVirtualMethod(
 // For value returned in registers
 sal_uInt64 x0;
 sal_uInt64 x1;
+double d0;
 
 __asm__ __volatile__
 (
+ // Assembly string
  "  ldp x0, x1, %[pgpr_0]\n"
  "  ldp x2, x3, %[pgpr_2]\n"
  "  ldp x4, x5, %[pgpr_4]\n"
@@ -168,7 +162,10 @@ void callVirtualMethod(
  "  blr %[pmethod]\n"
  "  str x0, %[x0]\n"
  "  str x1, %[x1]\n"
- : [x0]"=m" (x0), [x1]"=m" (x1)
+ "  str d0, %[d0]\n"
+ // Output operands
+ : [x0]"=m" (x0), [x1]"=m" (x1), [d0]"=m" (d0)
+ // Input operands
  : [pgpr_0]"m" (pGPR[0]),
[pgpr_2]"m" (pGPR[2]),
[pgpr_4]"m" (pGPR[4]),
@@ -179,10 +176,11 @@ void callVirtualMethod(
[pfpr_4]"m" (pFPR[4]),
[pfpr_6]"m" (pFPR[6]),
[pmethod]"r" (pMethod)
+ // Clobbers
  : "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "d0", "d1", "d2", 
"d3", "d4", "d5", "d6", "d7"
  );
 
-  MapReturn(x0, x1, pReturnType, (sal_uInt64 *) pRegisterReturn);
+MapReturn(x0, x1, d0, pReturnType, (sal_uInt64 *) pRegisterReturn);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source chart2/source comphelper/source connectivity/source cui/source dbaccess/source editeng/source filter/source i18nlangtag/source lotuswordpro/source winacc

2021-02-09 Thread Andrea Gelmini (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_mips64/uno2cpp.cxx|1 
 chart2/source/controller/main/ChartController.cxx   |1 
 comphelper/source/misc/anycompare.cxx   |   14 
 connectivity/source/drivers/flat/ETable.cxx |1 
 cui/source/customize/CustomNotebookbarGenerator.cxx |   10 ---
 dbaccess/source/filter/xml/xmlStyleImport.cxx   |1 
 dbaccess/source/filter/xml/xmlfilter.cxx|5 -
 editeng/source/items/frmitems.cxx   |1 
 filter/source/graphicfilter/icgm/bitmap.cxx |1 
 filter/source/msfilter/escherex.cxx |1 
 i18nlangtag/source/languagetag/languagetag.cxx  |6 -
 lotuswordpro/source/filter/xfilter/xfutil.cxx   |   52 
 winaccessibility/source/service/AccObjectWinManager.cxx |2 
 13 files changed, 96 deletions(-)

New commits:
commit 974dc88a06603f2f119f603c2581870e4e7ea7bc
Author: Andrea Gelmini 
AuthorDate: Sun Feb 7 21:47:10 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Feb 10 08:52:11 2021 +0100

Remove unneeded breaks

Extending this:
https://gerrit.libreoffice.org/c/core/+/110512

Change-Id: If7e6f9c4079c2e0b48e642aa0b140fb4e03996bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110520
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_mips64/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_linux_mips64/uno2cpp.cxx
index e33969ae789c..cb0661e7fd6a 100644
--- a/bridges/source/cpp_uno/gcc3_linux_mips64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_mips64/uno2cpp.cxx
@@ -113,7 +113,6 @@ namespace
   break;
   default:
   return false;
-  break;
   }
   }
   return true;
diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index be8dffbaee44..d19f3b97ef32 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -291,7 +291,6 @@ OUString ChartController::GetContextName()
 {
 case OBJECTTYPE_DATA_SERIES:
 return "Series";
-break;
 case OBJECTTYPE_DATA_ERRORS_X:
 case OBJECTTYPE_DATA_ERRORS_Y:
 case OBJECTTYPE_DATA_ERRORS_Z:
diff --git a/comphelper/source/misc/anycompare.cxx 
b/comphelper/source/misc/anycompare.cxx
index 106892400c7c..d802024e7502 100644
--- a/comphelper/source/misc/anycompare.cxx
+++ b/comphelper/source/misc/anycompare.cxx
@@ -242,46 +242,32 @@ namespace comphelper
 return ScalarPredicateLess< sal_Unicode >().isLess(lhs, rhs);
 case TypeClass_BOOLEAN:
 return ScalarPredicateLess< bool >().isLess(lhs, rhs);
-break;
 case TypeClass_BYTE:
 return ScalarPredicateLess< sal_Int8 >().isLess(lhs, rhs);
-break;
 case TypeClass_SHORT:
 return ScalarPredicateLess< sal_Int16 >().isLess(lhs, rhs);
-break;
 case TypeClass_UNSIGNED_SHORT:
 return ScalarPredicateLess< sal_uInt16 >().isLess(lhs, rhs);
-break;
 case TypeClass_LONG:
 return ScalarPredicateLess< sal_Int32 >().isLess(lhs, rhs);
-break;
 case TypeClass_UNSIGNED_LONG:
 return ScalarPredicateLess< sal_uInt32 >().isLess(lhs, rhs);
-break;
 case TypeClass_HYPER:
 return ScalarPredicateLess< sal_Int64 >().isLess(lhs, rhs);
-break;
 case TypeClass_UNSIGNED_HYPER:
 return ScalarPredicateLess< sal_uInt64 >().isLess(lhs, rhs);
-break;
 case TypeClass_FLOAT:
 return ScalarPredicateLess< float >().isLess(lhs, rhs);
-break;
 case TypeClass_DOUBLE:
 return ScalarPredicateLess< double >().isLess(lhs, rhs);
-break;
 case TypeClass_STRING:
 return StringPredicateLess().isLess(lhs, rhs);
-break;
 case TypeClass_TYPE:
 return TypePredicateLess().isLess(lhs, rhs);
-break;
 case TypeClass_ENUM:
 return EnumPredicateLess( lhs.getValueType() ).isLess(lhs, rhs);
-break;
 case TypeClass_INTERFACE:
 return InterfacePredicateLess().isLess(lhs, rhs);
-break;
 case TypeClass_STRUCT:
 if ( lhs.getValueType().equals( ::cppu::UnoType< Date >::get() ) )
 return DatePredicateLess().isLess(lhs, rhs);
diff --git a/connectivity/source/drivers/flat/ETable.cxx 
b/connectivity/source/drivers/flat/ETable.cxx
index 0dceba05b641..fa4305e991a4 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -784,7 +784,6 @@ bool OFlatTable::seekRow(IResultSetHelper::Movement 
eCursorPosition, sal_Int32 n
 }
 // 

[Libreoffice-commits] core.git: bridges/source

2021-02-09 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/msvc_shared/except.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 19ca93a8c09bf657fa44d9d26ea6f697afe5
Author: Stephan Bergmann 
AuthorDate: Tue Feb 9 16:21:30 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Feb 9 19:42:26 2021 +0100

loplugin:stringview (clang-cl)

Change-Id: I5c2420d5fb886926540bb3502c130404786f1698
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110641
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/msvc_shared/except.cxx 
b/bridges/source/cpp_uno/msvc_shared/except.cxx
index c9432af4e67b..4b3d2ae3da0d 100644
--- a/bridges/source/cpp_uno/msvc_shared/except.cxx
+++ b/bridges/source/cpp_uno/msvc_shared/except.cxx
@@ -59,7 +59,7 @@ static OUString toUNOname(OUString const& rRTTIname) throw()
 while (nPos > 0)
 {
 sal_Int32 n = aStr.lastIndexOf('@', nPos);
-aRet.append(aStr.copy(n + 1, nPos - n - 1));
+aRet.append(aStr.subView(n + 1, nPos - n - 1));
 if (n >= 0)
 aRet.append('.');
 nPos = n;
@@ -75,7 +75,7 @@ static OUString toRTTIname(OUString const& rUNOname) throw()
 while (nPos > 0)
 {
 sal_Int32 n = rUNOname.lastIndexOf('.', nPos);
-aRet.append(rUNOname.copy(n + 1, nPos - n - 1));
+aRet.append(rUNOname.subView(n + 1, nPos - n - 1));
 aRet.append('@');
 nPos = n;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2021-01-02 Thread Julien Nabet (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx |   11 +++
 bridges/source/cpp_uno/gcc3_linux_arm/except.cxx  |   32 ++---
 bridges/source/cpp_uno/gcc3_linux_arm/rtti.hxx|   33 --
 3 files changed, 21 insertions(+), 55 deletions(-)

New commits:
commit 610ceb05025c9c7a9a34dddcb0dac506b8eab441
Author: Julien Nabet 
AuthorDate: Sat Jan 2 15:15:38 2021 +0100
Commit: Julien Nabet 
CommitDate: Sat Jan 2 15:20:39 2021 +0100

Fix some warnings for Raspberry pi 4 (part4)

Fix similar pbs as previous commits

Change-Id: Ib2964329f75402cd5457e4bf3362076c0d4f4ea2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108572
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
index aaba8ffb7b6d..103f2b492e3a 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
@@ -272,8 +272,7 @@ namespace
 }
 if (pReturnTypeDescr)
 {
-typelib_TypeClass eRet =
-
static_cast(pReturnTypeDescr->eTypeClass);
+typelib_TypeClass eRet = pReturnTypeDescr->eTypeClass;
 TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
 return eRet;
 }
@@ -381,7 +380,7 @@ namespace
 {
 typelib_TypeDescription * pTD = nullptr;
 TYPELIB_DANGER_GET(,
-reinterpret_cast(pCallStack[2])->getTypeLibType());
+static_cast(pCallStack[2])->getTypeLibType());
 if (pTD)
 {
 XInterface * pInterface = nullptr;
@@ -393,7 +392,7 @@ namespace
 if (pInterface)
 {
 ::uno_any_construct(
-reinterpret_cast< uno_Any * >( pCallStack[0] ),
+static_cast< uno_Any * >( pCallStack[0] ),
 , pTD, cpp_acquire );
 pInterface->release();
 TYPELIB_DANGER_RELEASE( pTD );
@@ -576,8 +575,8 @@ void bridges::cpp_uno::shared::VtableFactory::flushCode(
 {
 #ifndef ANDROID
static void (*clear_cache)(unsigned char const*, unsigned char const*)
-   = (void (*)(unsigned char const*, unsigned char const*))
-   dlsym(RTLD_DEFAULT, "__clear_cache");
+   = reinterpret_cast
+   (dlsym(RTLD_DEFAULT, "__clear_cache"));
(*clear_cache)(beg, end);
 #else
cacheflush((long) beg, (long) end, 0);
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx 
b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
index 367604f3ed11..14bffa75ad7f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
@@ -31,7 +31,6 @@
 #include 
 #include 
 #include 
-#include "rtti.hxx"
 #include "share.hxx"
 
 
@@ -86,6 +85,7 @@ namespace CPPU_CURRENT_NAMESPACE
 #endif
 }
 
+namespace {
 class RTTI
 {
 typedef std::unordered_map< OUString, type_info * > t_rtti_map;
@@ -104,10 +104,11 @@ namespace CPPU_CURRENT_NAMESPACE
 
 type_info * getRTTI(typelib_CompoundTypeDescription *);
 };
+}
 
 RTTI::RTTI()
 #ifndef ANDROID
-: m_hApp( dlopen( 0, RTLD_LAZY ) )
+: m_hApp( dlopen( nullptr, RTLD_LAZY ) )
 #endif
 {
 }
@@ -124,7 +125,7 @@ namespace CPPU_CURRENT_NAMESPACE
 {
 type_info * rtti;
 
-OUString const & unoName = *(OUString const 
*)>aBase.pTypeName;
+OUString const & unoName = *reinterpret_cast(>aBase.pTypeName);
 
 MutexGuard guard( m_mutex );
 t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) );
@@ -146,7 +147,7 @@ namespace CPPU_CURRENT_NAMESPACE
 
 OString symName( buf.makeStringAndClear() );
 #ifndef ANDROID
-rtti = (type_info *)dlsym( m_hApp, symName.getStr() );
+rtti = static_cast(dlsym( m_hApp, symName.getStr() ));
 #else
 rtti = (type_info *)dlsym( RTLD_DEFAULT, symName.getStr() );
 #endif
@@ -185,10 +186,9 @@ namespace CPPU_CURRENT_NAMESPACE
 if (pTypeDescr->pBaseTypeDescription)
 {
 // ensure availability of base
-type_info * base_rtti = getRTTI(
-(typelib_CompoundTypeDescription 
*)pTypeDescr->pBaseTypeDescription );
+type_info * base_rtti = getRTTI( 
pTypeDescr->pBaseTypeDescription );
 rtti = new __si_class_type_info(
-strdup( rttiName ), (__class_type_info *)base_rtti 
);
+strdup( rttiName ), static_cast<__class_type_info 
*>(base_rtti) );
 }
 else
 {
@@ -218,8 +218,8 @@ namespace 

[Libreoffice-commits] core.git: bridges/source

2021-01-02 Thread Julien Nabet (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_arm/call.hxx|   28 ++
 bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx |   95 +++---
 bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx |   82 +-
 3 files changed, 117 insertions(+), 88 deletions(-)

New commits:
commit dd91d3389c26645459d3b80649941d65efa4f63f
Author: Julien Nabet 
AuthorDate: Sat Jan 2 14:36:44 2021 +0100
Commit: Julien Nabet 
CommitDate: Sat Jan 2 14:47:03 2021 +0100

Fix some warnings for Raspberry pi 4 (part3)

fix for these kinds of things:

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:494:17:
 error:
C-style cast from 'sal_uInt32 *' (aka 'unsigned long *') to 'double *' 
(BitCast) [loplugin:cstylecast]
INSERT_DOUBLE( pCppArgs[nPos], nGPR, pGPR, pStack, 
pStackStart );

^~~~

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:365:14:
 note: expanded from macro 'INSERT_DOUBLE'
*(double *)pDS = *reinterpret_cast( pSV );\
 ^

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:645:18:
 error:
C-style cast from 'const typelib_TypeDescription *' (aka 'const 
_typelib_TypeDescription *') to 'typelib_InterfaceAttributeTypeDescription *' 
(aka '_typelib_InterfaceAttributeTypeDescription *') (BitCast) 
[loplugin:cstylecast]
((typelib_InterfaceAttributeTypeDescription 
*)pMemberDescr)->pAttributeTypeRef,
 ^

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:655:31:
 error: use 'true' instead of 'sal_True' [loplugin:fakebool]
aParam.bIn  = sal_True;
  ^~~~

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:656:31:
 error: use 'false' instead of 'sal_False' [loplugin:fakebool]
aParam.bOut = sal_False;


/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:112:47:
 error: NullToPointer ValueDependentIsNotNull ZeroLiteral -> nullptr 
[loplugin:nullptr]
typelib_TypeDescription * t = 0;
  ^

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:123:40:
 error: NullToPointer ValueDependentIsNotNull ZeroLiteral -> nullptr 
[loplugin:nullptr]
if (p->pBaseTypeDescription != 0)
   ^

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:148:52:
 error: NullToPointer ValueDependentIsNotNull ZeroLiteral -> nullptr 
[loplugin:nullptr]
typelib_TypeDescription * pTypeDescr = 0;
   ^

Change-Id: Ibca65077131277380ddeefa994b52c7c1193c1f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108570
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/call.hxx 
b/bridges/source/cpp_uno/gcc3_linux_arm/call.hxx
new file mode 100644
index ..dde56f6f59f0
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/call.hxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include 
+
+#include 
+
+extern "C" sal_Int64 cpp_vtable_call(long* pFunctionAndOffset, void** 
pCallStack);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
index 7abaed395488..aaba8ffb7b6d 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
@@ -33,6 +33,7 @@
 #include 
 
 #include "share.hxx"
+#include "call.hxx"
 
 #include 
 
@@ -46,7 +47,7 @@ using namespace ::com::sun::star::uno;
 namespace
 {
 
-static typelib_TypeClass cpp2uno_call(
+typelib_TypeClass cpp2uno_call(
 

[Libreoffice-commits] core.git: bridges/source

2021-01-01 Thread Julien Nabet (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_arm/rtti.hxx |   33 +
 1 file changed, 33 insertions(+)

New commits:
commit f014efeb2e715d2f52be882c59cd981816d0821a
Author: Julien Nabet 
AuthorDate: Fri Jan 1 14:11:09 2021 +0100
Commit: Julien Nabet 
CommitDate: Fri Jan 1 14:18:13 2021 +0100

Add rtti.hxx for gcc3_linux_arm

Change-Id: I0fd541a320d3e27e45c29d59cd8bb08054042003
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108558
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/rtti.hxx 
b/bridges/source/cpp_uno/gcc3_linux_arm/rtti.hxx
new file mode 100644
index ..7057cb4ed161
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/rtti.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include 
+
+#include 
+
+#include 
+
+namespace arm
+{
+std::type_info* getRtti(typelib_TypeDescription const& type);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2021-01-01 Thread Julien Nabet (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx |8 +++---
 bridges/source/cpp_uno/gcc3_linux_arm/except.cxx  |   29 +++---
 bridges/source/cpp_uno/gcc3_linux_arm/share.hxx   |6 ++--
 bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx |6 ++--
 4 files changed, 25 insertions(+), 24 deletions(-)

New commits:
commit 7b36e8718036377ad5e370151099aa15c3c9a067
Author: Julien Nabet 
AuthorDate: Fri Jan 1 10:48:34 2021 +0100
Commit: Julien Nabet 
CommitDate: Fri Jan 1 11:57:29 2021 +0100

Fix some warnings for Raspberry pi 4 (part1)


/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx:31:10:
error: replace "..." include form with <...> for inclusion of a source file 
not next to the current source file,
or a header, /home/pi/lo/libreoffice/bridges/inc/cppinterfaceproxy.hxx 
[loplugin:includeform]
include "cppinterfaceproxy.hxx"
 ^~~

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:200:41:
error: variable 'dret' is uninitialized when used here 
[-Werror,-Wuninitialized]
*(double*)pRegisterReturn = dret;
^~~~

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:199:33:
note: initialize the variable 'dret' to silence this warning
register double dret asm("d0");
^
 = 0.0

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:191:40:
error: variable 'fret' is uninitialized when used here 
[-Werror,-Wuninitialized]
*(float*)pRegisterReturn = fret;
   ^~~~

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:190:32:
note: initialize the variable 'fret' to silence this warning
register float fret asm("s0");
   ^
= 0.0
make[1]: *** [/home/pi/lo/libreoffice/solenv/gbuild/LinkTarget.mk:301 :

/home/pi/lo/libreoffice/workdir/CxxObject/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.o]
 Erreur 1

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx:66:22:
error: parentheses immediately inside vardecl statement 
[loplugin:unnecessaryparen]
long n = (*p++ - '0');
 ^~~~

1 error generated.
make[1]: *** [/home/pi/lo/libreoffice/solenv/gbuild/LinkTarget.mk:301 :

/home/pi/lo/libreoffice/workdir/CxxObject/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.o]
 Erreur 1

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx:66:22:
error: parentheses immediately inside vardecl statement 
[loplugin:unnecessaryparen]
long n = (*p++ - '0');
 ^~~~

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx:88:11:
error: externally available entity 'RTTI' is not previously declared in an 
included file
(if it is only used in this translation unit, put it in an unnamed 
namespace; otherwise, provide a declaration of it in an included file) 
[loplugin:external]
class RTTI
~~^~~~

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx:220:42:
error: parentheses immediately inside vardecl statement 
[loplugin:unnecessaryparen]
__cxa_exception const * header = ((__cxa_exception const *)pExc - 
1);
 ^~~

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx:260:12:
error: statement mis-aligned compared to neighbours  [loplugin:indentation]
   ::uno_any_destruct( pUnoExc, 0 );
   ^

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx:246:13:
note: measured against this one [loplugin:indentation]
typelib_TypeDescription * pTypeDescr = 0;
^

/home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx:262:12:
error: statement mis-aligned compared to neighbours  [loplugin:indentation]
   static RTTI rtti_data;
   ^

Change-Id: I054212e829c57b64b23612338b238d987bb17041
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108553
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
index 4ef17b8542e1..9a59044ba8b3 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
@@ -23,14 +23,14 @@
 #include 
 
 #include 
-#include "com/sun/star/uno/RuntimeException.hpp"
+#include 
 #include 
 #include 
 
-#include "bridge.hxx"
+#include 
 #include "cppinterfaceproxy.hxx"
-#include 

[Libreoffice-commits] core.git: bridges/source

2020-12-18 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit d85a3887bf36ff1e4dddb111f2c5634b66eb9510
Author: Stephan Bergmann 
AuthorDate: Fri Dec 18 12:11:05 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Dec 18 22:01:54 2020 +0100

Mention relevant Clang bug in comment

Change-Id: I88140ab20440125d9642a1489e501cdcb74c3a48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107962
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
index 77fa3c03bbf4..b31d87655d0c 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
@@ -559,7 +559,9 @@ void bridges::cpp_uno::shared::VtableFactory::flushCode(
 // "extend.texi (__clear_cache): Correct signature" that 
__builtin___clear_cache takes void*
 // parameters, while Clang uses char* ever since
 // 

 "Add
-// support for __builtin___clear_cache in Clang":
+// support for __builtin___clear_cache in Clang" (TODO: see
+//  
"__builtin___clear_cache() has a different
+// prototype than GCC"; once fixed for our Clang baseline, we can drop the 
reinterpret_casts):
 __builtin___clear_cache(
 reinterpret_cast(const_cast(begin)),
 reinterpret_cast(const_cast(end)));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-12-17 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx|   30 ++--
 bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx|   91 ---
 bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx|   48 +++
 bridges/source/cpp_uno/gcc3_linux_aarch64/vtablecall.hxx |   33 +
 4 files changed, 123 insertions(+), 79 deletions(-)

New commits:
commit 5e636ec653ce798935ed85aeef96a6fcff893729
Author: Stephan Bergmann 
AuthorDate: Thu Dec 17 14:17:05 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Dec 17 15:47:51 2020 +0100

Various minor loplugin fixes (macOS ARM64)

Change-Id: I32276e3ceafa1e65671ba395de3f6fa587179d79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107878
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index 0fce88db6749..8db8c37140e5 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -45,7 +45,7 @@
 namespace {
 
 OUString toUnoName(char const * name) {
-assert(name != 0);
+assert(name != nullptr);
 OUStringBuffer b;
 bool scoped = *name == 'N';
 if (scoped) {
@@ -74,7 +74,7 @@ OUString toUnoName(char const * name) {
 
 class Rtti {
 public:
-Rtti(): app_(dlopen(0, RTLD_LAZY)) {}
+Rtti(): app_(dlopen(nullptr, RTLD_LAZY)) {}
 
 ~Rtti() { dlclose(app_); }
 
@@ -107,7 +107,7 @@ std::type_info * Rtti::getRtti(typelib_TypeDescription 
const & type) {
 OString sym(b.makeStringAndClear());
 std::type_info * rtti = static_cast(
 dlsym(app_, sym.getStr()));
-if (rtti == 0) {
+if (rtti == nullptr) {
 char const * rttiName = strdup(sym.getStr() + std::strlen("_ZTI"));
 if (rttiName == nullptr) {
 throw std::bad_alloc();
@@ -123,7 +123,7 @@ std::type_info * Rtti::getRtti(typelib_TypeDescription 
const & type) {
 typelib_CompoundTypeDescription const & ctd
 = reinterpret_cast(
 type);
-if (ctd.pBaseTypeDescription == 0) {
+if (ctd.pBaseTypeDescription == nullptr) {
 rtti = new __cxxabiv1::__class_type_info(rttiName);
 } else {
 std::type_info * base = getRtti(
@@ -201,9 +201,9 @@ extern "C" void _GLIBCXX_CDTOR_CALLABI deleteException(void 
* exception) {
 #endif
 assert(header->exceptionDestructor == );
 OUString unoName(toUnoName(header->exceptionType->name()));
-typelib_TypeDescription * td = 0;
+typelib_TypeDescription * td = nullptr;
 typelib_typedescription_getByName(, unoName.pData);
-assert(td != 0);
+assert(td != nullptr);
 uno_destructData(exception, td, ::uno::cpp_release);
 typelib_typedescription_release(td);
 }
@@ -214,7 +214,7 @@ enum StructKind {
 };
 
 StructKind getStructKind(typelib_CompoundTypeDescription const * type) {
-StructKind k = type->pBaseTypeDescription == 0
+StructKind k = type->pBaseTypeDescription == nullptr
 ? STRUCT_KIND_EMPTY : getStructKind(type->pBaseTypeDescription);
 for (sal_Int32 i = 0; i != type->nMembers; ++i) {
 StructKind k2 = StructKind();
@@ -246,7 +246,7 @@ StructKind getStructKind(typelib_CompoundTypeDescription 
const * type) {
 break;
 case typelib_TypeClass_STRUCT:
 {
-typelib_TypeDescription * td = 0;
+typelib_TypeDescription * td = nullptr;
 TYPELIB_DANGER_GET(, type->ppTypeRefs[i]);
 k2 = getStructKind(
 reinterpret_cast(
@@ -289,12 +289,12 @@ namespace abi_aarch64 {
 void mapException(
 __cxxabiv1::__cxa_exception * exception, std::type_info const * type, 
uno_Any * any, uno_Mapping * mapping)
 {
-assert(exception != 0);
+assert(exception != nullptr);
 assert(type != nullptr);
 OUString unoName(toUnoName(type->name()));
-typelib_TypeDescription * td = 0;
+typelib_TypeDescription * td = nullptr;
 typelib_typedescription_getByName(, unoName.pData);
-if (td == 0) {
+if (td == nullptr) {
 css::uno::RuntimeException e("exception type not found: " + unoName);
 uno_type_any_constructAndConvert(
 any, ,
@@ -307,15 +307,15 @@ void mapException(
 }
 
 void raiseException(uno_Any * any, uno_Mapping * mapping) {
-typelib_TypeDescription * td = 0;
+typelib_TypeDescription * td = nullptr;
 TYPELIB_DANGER_GET(, any->pType);
-if (td == 0) {
+if (td == nullptr) {
 throw css::uno::RuntimeException(
-"no typedescription for " + OUString(any->pType->pTypeName));
+"no typedescription for " + 
OUString::unacquired(>pType->pTypeName));
 }
 void * exc = __cxxabiv1::__cxa_allocate_exception(td->nSize);
 uno_copyAndConvertData(exc, any->pData, td, mapping);
-uno_any_destruct(any, 0);
+

[Libreoffice-commits] core.git: bridges/source

2020-12-17 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/shared/vtablefactory.cxx |   81 
 1 file changed, 43 insertions(+), 38 deletions(-)

New commits:
commit 052efd869e12796815401fb29a975e49866e6ce7
Author: Stephan Bergmann 
AuthorDate: Thu Dec 17 10:48:51 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Dec 17 13:20:46 2020 +0100

Make the pthread_jit_write_protect_np call pair exception-safe

...just in case

Change-Id: Id056ee4dfd64dd186f01d117cfede28f4b7f6c09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107867
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx 
b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index 90c414290c1a..9d4c5d31dd3f 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -134,6 +134,13 @@ extern "C" void freeExec(
 #endif
 }
 
+#if defined MACOSX && defined __aarch64__
+struct JitMemoryProtectionGuard {
+JitMemoryProtectionGuard() { pthread_jit_write_protect_np(0); }
+~JitMemoryProtectionGuard() { pthread_jit_write_protect_np(1); }
+};
+#endif
+
 }
 
 class VtableFactory::GuardedBlocks:
@@ -342,52 +349,50 @@ sal_Int32 VtableFactory::createVtables(
 typelib_InterfaceTypeDescription * type, sal_Int32 vtableNumber,
 typelib_InterfaceTypeDescription * mostDerived, bool includePrimary) const
 {
+{
 #if defined MACOSX && defined __aarch64__
-// TODO: Should we handle resetting this in a exception-throwing-safe way?
-pthread_jit_write_protect_np(0);
+JitMemoryProtectionGuard guard;
 #endif
-if (includePrimary) {
-sal_Int32 slotCount
-= bridges::cpp_uno::shared::getPrimaryFunctions(type);
-Block block;
-if (!createBlock(block, slotCount)) {
-throw std::bad_alloc();
-}
-try {
-Slot * slots = initializeBlock(
-block.start, slotCount, vtableNumber, mostDerived);
-unsigned char * codeBegin =
-reinterpret_cast< unsigned char * >(slots);
-unsigned char * code = codeBegin;
-sal_Int32 vtableOffset = blocks.size() * sizeof (Slot *);
-for (typelib_InterfaceTypeDescription const * type2 = type;
- type2 != nullptr; type2 = type2->pBaseTypeDescription)
-{
-code = addLocalFunctions(
-, code,
+if (includePrimary) {
+sal_Int32 slotCount
+= bridges::cpp_uno::shared::getPrimaryFunctions(type);
+Block block;
+if (!createBlock(block, slotCount)) {
+throw std::bad_alloc();
+}
+try {
+Slot * slots = initializeBlock(
+block.start, slotCount, vtableNumber, mostDerived);
+unsigned char * codeBegin =
+reinterpret_cast< unsigned char * >(slots);
+unsigned char * code = codeBegin;
+sal_Int32 vtableOffset = blocks.size() * sizeof (Slot *);
+for (typelib_InterfaceTypeDescription const * type2 = type;
+ type2 != nullptr; type2 = type2->pBaseTypeDescription)
+{
+code = addLocalFunctions(
+, code,
 #ifdef USE_DOUBLE_MMAP
-reinterpret_cast(block.exec) - 
reinterpret_cast(block.start),
+reinterpret_cast(block.exec) - 
reinterpret_cast(block.start),
 #endif
-type2,
-baseOffset.getFunctionOffset(type2->aBase.pTypeName),
-bridges::cpp_uno::shared::getLocalFunctions(type2),
-vtableOffset);
-}
-flushCode(codeBegin, code);
+type2,
+baseOffset.getFunctionOffset(type2->aBase.pTypeName),
+bridges::cpp_uno::shared::getLocalFunctions(type2),
+vtableOffset);
+}
+flushCode(codeBegin, code);
 #ifdef USE_DOUBLE_MMAP
-//Finished generating block, swap writable pointer with executable
-//pointer
-std::swap(block.start, block.exec);
+//Finished generating block, swap writable pointer with 
executable
+//pointer
+std::swap(block.start, block.exec);
 #endif
-blocks.push_back(block);
-} catch (...) {
-freeBlock(block);
-throw;
+blocks.push_back(block);
+} catch (...) {
+freeBlock(block);
+throw;
+}
 }
 }
-#if defined MACOSX && defined __aarch64__
-pthread_jit_write_protect_np(1);
-#endif
 for (sal_Int32 i = 0; i < type->nBaseTypes; ++i) {
 vtableNumber = createVtables(
 blocks, baseOffset, type->ppBaseTypes[i],

[Libreoffice-commits] core.git: bridges/source

2020-12-16 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx |   67 --
 1 file changed, 13 insertions(+), 54 deletions(-)

New commits:
commit bf858e4b224ae4dc04f968a3d3c66d184dd1e33d
Author: Stephan Bergmann 
AuthorDate: Wed Dec 16 15:35:30 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 16 19:53:16 2020 +0100

Fix macOS ARM64 RTTI generation

The Apple ARM64 ABI can use RTTI that is either unique (std::type_info 
equality
is decided by comparing pointers to RTTI names) or non-unique (equality is
decided by deep string comparison of RTTI names), where the 
most-significant bit
of a std::type_info's name pointer must be set to indicate the non-unique 
case.
See the " NonUniqueARMRTTIBit" comment at 
 
for
details.

It appears that Clang, at least under -fvisibility=hidden as used by LO, 
emits
RTTI for a C++ class as .private_extern and non-unique, even if the class is
marked as visibility("default") (as is done for the C++ classes 
representing UNO
exception types, cf. CPPU_GCC_DLLPUBLIC_EXPORT in include/cppu/macros.hxx).

So it is expected and harmless that Rtti::getRtti will not find existing 
RTTI
symbols via dlsym, and needs to create RTTI on the fly.  However, what was
missing was to set the most-significant bit of the name pointer, to indicate
non-uniqueness.  (My understanding is that things should even have worked 
whe
we failed to set that bit, as comparison should fall back to deep string
comparison if at least one of the involved RTTIs has the bit set, which the 
RTTI
emitted by Clang does, see above.  It looks like there is a bug though, see

"[libcxx-dev] Is the implementation of two-argument
__non_unique_arm_rtti_bit_impl;;__is_type_name_unique correct?")

Change-Id: I3c39edf569ac668352bbb73e60303856e1b63445
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107839
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index f1cacf8d54ba..0fce88db6749 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -31,7 +32,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -107,44 +107,29 @@ std::type_info * Rtti::getRtti(typelib_TypeDescription 
const & type) {
 OString sym(b.makeStringAndClear());
 std::type_info * rtti = static_cast(
 dlsym(app_, sym.getStr()));
+if (rtti == 0) {
+char const * rttiName = strdup(sym.getStr() + std::strlen("_ZTI"));
+if (rttiName == nullptr) {
+throw std::bad_alloc();
+}
 #if defined MACOSX
-
-// Horrible but hopefully temporary hack.
-
-// For some reason, with the Xcode 12 betas, when compiling for 
arm64-apple-macos, the
-// symbols for the typeinfos for the UNO exception types
-// (_ZTIN3com3sun4star3uno16RuntimeExceptionE etc) end up as "weak 
private external" in the
-// object file, as displayed by "nm -f darwin". We try to look them up 
with dlsym() above,
-// but that then fails. So use a hackaround... introduce separate real 
variables (see end of
-// this file) that point to these typeinfos.
-
-// When compiling for x86_64-apple-macos, the typeinfo symbols end up 
as "weak external"
-// which is fine.
-
-if (rtti == nullptr)
-{
-const OString ptrSym = "ptr" + sym;
-auto ptr = static_cast(dlsym(app_, 
ptrSym.getStr()));
-if (ptr != nullptr)
-rtti = *ptr;
-else
-SAL_WARN("bridges", dlerror());
-}
+// For the Apple ARM64 ABI, if the most significant ("non-unique 
RTTI") bit is set, it
+// means that the instance of the name is not unique (and thus 
RTTI equality needs to be
+// determined by string comparison rather than by pointer 
comparison):
+rttiName = reinterpret_cast(
+reinterpret_cast(rttiName) | 
0x8000''');
 #endif
-
-if (rtti == 0) {
-char const * rttiName = sym.getStr() + std::strlen("_ZTI");
 assert(type.eTypeClass == typelib_TypeClass_EXCEPTION);
 typelib_CompoundTypeDescription const & ctd
 = reinterpret_cast(
 type);
 if (ctd.pBaseTypeDescription == 0) {
-rtti = new __cxxabiv1::__class_type_info(strdup(rttiName));
+rtti = new __cxxabiv1::__class_type_info(rttiName);

[Libreoffice-commits] core.git: bridges/source

2020-12-08 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/shared/vtablefactory.cxx |   19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 6cab5c9170dc167838f1aebafc47153cd84713b4
Author: Stephan Bergmann 
AuthorDate: Mon Dec 7 21:18:25 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Dec 8 10:42:34 2020 +0100

tdf#134754: Gracefully handle EINVAL from mmap MAP_JIT on old macOS

Change-Id: Idfb148fad55c7c6b6e6f4f4b5316fd3b086f7d2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107365
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx 
b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index 73dc42ef6dfc..90c414290c1a 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -85,12 +85,21 @@ extern "C" void * allocExec(
 p = mmap(
 nullptr, n, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON 
| MAP_JIT, -1,
 0);
-if (p == MAP_FAILED) {
+if (p != MAP_FAILED) {
+goto done;
+}
+{
 auto const e = errno;
-SAL_WARN("bridges.osx", "mmap failed with " << e << ", " << 
strerror(e));
-p = nullptr;
+SAL_INFO("bridges.osx", "mmap failed with " << e);
+if (e != EINVAL) {
+p = nullptr;
+goto done;
+}
 }
-#else
+// At least some macOS 10.13 machines are reported to fail the above mmap 
with EINVAL (see
+// tdf#134754 "Crash on macOS 10.13 opening local HSQLDB-based odb file in 
Base on LibreOffice 7
+// rc1", so in that case retry with the "traditional" approach:
+#endif
 p = mmap(
 nullptr, n, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1,
 0);
@@ -102,6 +111,8 @@ extern "C" void * allocExec(
 munmap (p, n);
 p = nullptr;
 }
+#if defined MACOSX
+done:
 #endif
 #elif defined _WIN32
 p = VirtualAlloc(nullptr, n, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-12-06 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/shared/vtablefactory.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit cca1240fe5884f184af489f5326e96892d1ae975
Author: Stephan Bergmann 
AuthorDate: Sun Dec 6 16:44:40 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Dec 6 18:36:55 2020 +0100

Related tdf#134754: Detect failed mmap on macOS

Change-Id: I21202d25e4851725198c58c29d9820bda00f2b30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107315
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx 
b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index 52309c6ec617..73dc42ef6dfc 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -85,6 +85,11 @@ extern "C" void * allocExec(
 p = mmap(
 nullptr, n, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON 
| MAP_JIT, -1,
 0);
+if (p == MAP_FAILED) {
+auto const e = errno;
+SAL_WARN("bridges.osx", "mmap failed with " << e << ", " << 
strerror(e));
+p = nullptr;
+}
 #else
 p = mmap(
 nullptr, n, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-11-13 Thread Tor Lillqvist (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx |  139 ++
 bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx |  121 +++
 2 files changed, 258 insertions(+), 2 deletions(-)

New commits:
commit e0df85554b533fab67a5a91193024e4876c5ec02
Author: Tor Lillqvist 
AuthorDate: Thu Nov 12 23:49:57 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Nov 13 20:01:51 2020 +0100

Improve the C++/UNO bridge for macOS on Apple Silicon

Now bridgetest (as improved by my previous commit) passes. That
doesn't necessarily prove much, though, I am sure there are
interesting corner cases that it doesn't exercise. Anyway, making this
work was easier than I had feared.

Unlike the arm64 ABI used on Linux, on macOS (and iOS, but we don't
really use the C++/UNO bridge for iOS) we need to pack parameters
smaller than eight bytes according to their natural alignment. Bytes
take one byte, shorts two bytes aligned at a two-byte boundary, etc.

Change-Id: I5b7dc2f8fce41ddec88df0e688898a074d8b2dad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105773
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
index a67f2ca611ea..830c42eb52f8 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
@@ -70,11 +70,142 @@ void call(
 sal_Int32 ngpr = 1;
 sal_Int32 nfpr = 0;
 sal_Int32 sp = 0;
+#ifdef MACOSX
+sal_Int32 subsp = 0;
+#endif
 for (sal_Int32 i = 0; i != count; ++i) {
 if (!parameters[i].bOut
 && bridges::cpp_uno::shared::isSimpleType(parameters[i].pTypeRef))
 {
 switch (parameters[i].pTypeRef->eTypeClass) {
+#ifdef MACOSX
+case typelib_TypeClass_BOOLEAN:
+case typelib_TypeClass_BYTE:
+if (ngpr < 8)
+{
+args[i] = gpr + ngpr;
+ngpr++;
+}
+else
+{
+args[i] = reinterpret_cast(reinterpret_cast(stack + sp) + subsp);
+subsp += 1;
+if (subsp == 8)
+{
+sp++;
+subsp = 0;
+}
+}
+break;
+case typelib_TypeClass_SHORT:
+case typelib_TypeClass_UNSIGNED_SHORT:
+case typelib_TypeClass_CHAR:
+if (ngpr < 8)
+{
+args[i] = gpr + ngpr;
+ngpr++;
+}
+else
+{
+subsp = (subsp + 1) & ~0x1;
+if (subsp == 8)
+{
+sp++;
+subsp = 0;
+}
+args[i] = reinterpret_cast(reinterpret_cast(stack + sp) + subsp);
+subsp += 2;
+if (subsp == 8)
+{
+sp++;
+subsp = 0;
+}
+}
+break;
+case typelib_TypeClass_LONG:
+case typelib_TypeClass_UNSIGNED_LONG:
+case typelib_TypeClass_ENUM:
+if (ngpr < 8)
+{
+args[i] = gpr + ngpr;
+ngpr++;
+}
+else
+{
+subsp = (subsp + 3) & ~0x3;
+if (subsp == 8)
+{
+sp++;
+subsp = 0;
+}
+args[i] = reinterpret_cast(reinterpret_cast(stack + sp) + subsp);
+subsp += 4;
+if (subsp == 8)
+{
+sp++;
+subsp = 0;
+}
+}
+break;
+case typelib_TypeClass_HYPER:
+case typelib_TypeClass_UNSIGNED_HYPER:
+if (ngpr < 8)
+{
+args[i] = gpr + ngpr;
+ngpr++;
+}
+else
+{
+if (subsp > 0)
+{
+sp++;
+subsp = 0;
+}
+args[i] = stack + sp;
+sp++;
+}
+break;
+case typelib_TypeClass_FLOAT:
+if (nfpr < 8)
+{
+args[i] = fpr + nfpr;
+nfpr++;
+}
+else
+{
+subsp = (subsp + 3) & ~0x3;
+if (subsp == 8)
+   

[Libreoffice-commits] core.git: bridges/source

2020-10-14 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 6232cb71f4012a52c9b52339c6e00195a37689d7
Author: Stephan Bergmann 
AuthorDate: Tue Oct 13 17:03:44 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Oct 14 09:31:48 2020 +0200

loplugin:external (clang-cl)

Change-Id: I2d636f229ea52505cc263ea0219cf9f00130effd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104241
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx 
b/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx
index 34ba34fb2856..159eb99a4756 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx
@@ -44,8 +44,13 @@ extern "C" typelib_TypeClass cpp_vtable_call(sal_Int64 
nOffsetAndIndex, void **
 }
 
 int const codeSnippetSize = 48;
+
+namespace {
+
 typedef enum { REGPARAM_INT, REGPARAM_FLT } RegParamKind;
 
+}
+
 extern "C" char privateSnippetExecutor;
 
 // This function generates the code that acts as a proxy for the UNO function 
to be called.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-10-14 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 538d69a4c9e382b95ea9a42fa7e51efad22b6807
Author: Stephan Bergmann 
AuthorDate: Tue Oct 13 17:05:17 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Oct 14 08:34:53 2020 +0200

loplugin:includeform (clang-cl)

Change-Id: If1cffd3896d87695ba189728d8c1f1f04d55b6b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104242
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx 
b/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx
index 872cc079a984..15aa14d9b90b 100644
--- a/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx
@@ -24,10 +24,10 @@
 #include 
 #include 
 
-#include "bridge.hxx"
-#include "cppinterfaceproxy.hxx"
-#include "types.hxx"
-#include "vtablefactory.hxx"
+#include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-10-14 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/msvc_shared/except.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit aaf44ae6f0e50838a7e6674eada4eedfce91590c
Author: Stephan Bergmann 
AuthorDate: Tue Oct 13 17:12:26 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Oct 14 08:34:02 2020 +0200

loplugin:stringconstant (clang-cl)

Change-Id: I407b5e80a331950790f549ac8a50e8d7e49ee6d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104245
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/msvc_shared/except.cxx 
b/bridges/source/cpp_uno/msvc_shared/except.cxx
index 5bce2b04bc47..c9432af4e67b 100644
--- a/bridges/source/cpp_uno/msvc_shared/except.cxx
+++ b/bridges/source/cpp_uno/msvc_shared/except.cxx
@@ -70,7 +70,7 @@ static OUString toUNOname(OUString const& rRTTIname) throw()
 static OUString toRTTIname(OUString const& rUNOname) throw()
 {
 OUStringBuffer aRet(64);
-aRet.appendAscii(".?AV"); // class ".?AV"; struct ".?AU"
+aRet.append(".?AV"); // class ".?AV"; struct ".?AU"
 sal_Int32 nPos = rUNOname.getLength();
 while (nPos > 0)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-10-14 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx |4 ++--
 bridges/source/cpp_uno/msvc_shared/except.cxx  |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 06ac088aeec09f7f90d3ccbffc2f5eed04b82151
Author: Stephan Bergmann 
AuthorDate: Tue Oct 13 17:11:01 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Oct 14 08:33:39 2020 +0200

loplugin:redundantcast (clang-cl)

Change-Id: I2918d9ac8a4600bf5729604bda1beffb1dca78d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104244
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx 
b/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx
index e114a1019df7..872cc079a984 100644
--- a/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx
@@ -247,7 +247,7 @@ typelib_TypeClass __cdecl cpp_mediate(void** pCallStack, 
const sal_Int32 nFuncti
   + " vtable index " + 
OUString::number(nFunctionIndex) + "/"
   + 
OUString::number(pInterfaceTD->nMapFunctionIndexToMemberIndex);
 SAL_WARN("bridges", sError);
-throw uno::RuntimeException(sError, 
reinterpret_cast(pThis));
+throw uno::RuntimeException(sError, 
static_cast(pThis));
 }
 
 // determine called method
@@ -345,7 +345,7 @@ typelib_TypeClass __cdecl cpp_mediate(void** pCallStack, 
const sal_Int32 nFuncti
 }
 default:
 throw uno::RuntimeException("no member description found!",
-
reinterpret_cast(pThis));
+static_cast(pThis));
 }
 
 return eRet;
diff --git a/bridges/source/cpp_uno/msvc_shared/except.cxx 
b/bridges/source/cpp_uno/msvc_shared/except.cxx
index f6914922a14f..5bce2b04bc47 100644
--- a/bridges/source/cpp_uno/msvc_shared/except.cxx
+++ b/bridges/source/cpp_uno/msvc_shared/except.cxx
@@ -133,7 +133,7 @@ ExceptionInfos::~ExceptionInfos() throw()
 
 osl::MutexGuard aGuard(m_aMutex);
 for (auto& rEntry : m_allRaiseInfos)
-delete reinterpret_cast(rEntry.second);
+delete static_cast(rEntry.second);
 }
 
 RaiseInfo* ExceptionInfos::getRaiseInfo(typelib_TypeDescription* pTD) throw()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-09-27 Thread Andrea Gelmini (via logerrit)
 bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cceaf762a6693a60147ae49f7e004ca6ca54188b
Author: Andrea Gelmini 
AuthorDate: Sat Sep 26 21:13:31 2020 +0200
Commit: Julien Nabet 
CommitDate: Sun Sep 27 09:51:11 2020 +0200

Fix typo

Change-Id: I3792328b8e768d069e1a5a593cd811764bf7b5b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103492
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx 
b/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx
index 51186d1859fc..e114a1019df7 100644
--- a/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/msvc_shared/cpp2uno.cxx
@@ -96,7 +96,7 @@ cpp2uno_call(bridges::cpp_uno::shared::CppInterfaceProxy* 
pThis,
 {
 pCppArgs[nPos] = pCppIncomingParams;
 pUnoArgs[nPos] = pCppIncomingParams;
-if (sizeof(void*) == sizeof(sal_Int32)) // acccount 64bit types on 
32bit arch
+if (sizeof(void*) == sizeof(sal_Int32)) // account 64bit types on 
32bit arch
 {
 switch (pParamTD->eTypeClass)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-09-22 Thread Tor Lillqvist (via logerrit)
 bridges/source/cpp_uno/gcc3_ios/except.cxx   |   26 ++
 bridges/source/cpp_uno/gcc3_ios/unwind-cxx.h |   17 -
 2 files changed, 42 insertions(+), 1 deletion(-)

New commits:
commit dba1a27be2438b5dbd1f8d253acb3850c9c044da
Author: Tor Lillqvist 
AuthorDate: Thu Sep 17 14:02:24 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Sep 23 00:11:46 2020 +0300

Add Stephan's "Very bad HACK" to the iOS code, too, for iOS 14

Change-Id: Ie05d2dc77bfdcd323037d2e94b523808df4e1c9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102916
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102980
Tested-by: Tor Lillqvist 

diff --git a/bridges/source/cpp_uno/gcc3_ios/except.cxx 
b/bridges/source/cpp_uno/gcc3_ios/except.cxx
index 58f458da34db..d5c49859db27 100644
--- a/bridges/source/cpp_uno/gcc3_ios/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios/except.cxx
@@ -351,6 +351,32 @@ void fillUnoException(uno_Any * pUnoExc, uno_Mapping * 
pCpp2Uno)
 return;
 }
 
+// Very bad HACK to find out whether we run against a libcxxabi that has a 
new
+// __cxa_exception::reserved member at the start, introduced with LLVM 10
+// 

+// "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility".  The layout of the
+// start of __cxa_exception is
+//
+//  [8 byte  void *reserve]
+//   8 byte  size_t referenceCount
+//
+// where the (bad, hacky) assumption is that reserve (if present) is null
+// (__cxa_allocate_exception in at least LLVM 11 zero-fills the object, 
and nothing actively
+// sets reserve) while referenceCount is non-null (__cxa_throw sets it to 
1, and
+// __cxa_decrement_exception_refcount destroys the exception as soon as it 
drops to 0; for a
+// __cxa_dependent_exception, the referenceCount member is rather
+//
+//   8 byte  void* primaryException
+//
+// but which also will always be set to a non-null value in 
__cxa_rethrow_primary_exception).
+// As described in the definition of __cxa_exception
+// (bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx), this hack 
(together with the "#if 0"
+// there) can be dropped once we can be sure that we only run against new 
libcxxabi that has the
+// reserve member:
+if (*reinterpret_cast(header) == nullptr) {
+header = reinterpret_cast<__cxa_exception *>(reinterpret_cast(header) + 1);
+}
+
 std::type_info *exceptionType = __cxxabiv1::__cxa_current_exception_type();
 
 typelib_TypeDescription * pExcTypeDescr = nullptr;
diff --git a/bridges/source/cpp_uno/gcc3_ios/unwind-cxx.h 
b/bridges/source/cpp_uno/gcc3_ios/unwind-cxx.h
index 9a700445c12a..83ed084860fd 100644
--- a/bridges/source/cpp_uno/gcc3_ios/unwind-cxx.h
+++ b/bridges/source/cpp_uno/gcc3_ios/unwind-cxx.h
@@ -59,8 +59,23 @@ namespace __cxxabiv1
 // followed by the exception object itself.
 
 struct __cxa_exception
-{ 
+{
 #if __LP64__
+#if 0
+// This is a new field added with LLVM 10
+// 

+// "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility".  The HACK in
+// fillUnoException (bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx) 
tries to find out at
+// runtime whether a __cxa_exception has this member.  Once we can be sure 
that we only run
+// against new libcxxabi that has this member, we can drop the "#if 0" 
here and drop the hack
+// in fillUnoException.
+
+// Now _Unwind_Exception is marked with __attribute__((aligned)),
+// which implies __cxa_exception is also aligned. Insert padding
+// in the beginning of the struct, rather than before unwindHeader.
+void *reserve;
+#endif
+
// This is a new field to support C++ 0x exception_ptr.
// For binary compatibility it is at the start of this
// struct which is prepended to the object thrown in
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-09-16 Thread Jan-Marek Glogowski (via logerrit)
 bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx  |2 
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx|2 
 bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx  |  391 +--
 bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx  |  228 +--
 bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx |  323 +++
 bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx |  181 
 6 files changed, 547 insertions(+), 580 deletions(-)

New commits:
commit 52ac46d798a1787baca33cdf9e1c2fd768559522
Author: Jan-Marek Glogowski 
AuthorDate: Sat Jul 18 16:01:21 2020 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Thu Sep 17 00:01:00 2020 +0200

WIN bridges: unify bridge code layout

This just a cosmetic change to minimize the diff between the
files of the different msvc bridges, by renaming variables,
adapting comments and reordering variables.

This includes the reduction of the "using namespace" to
com::sun::star, so a few types now gain an uno:: prefix.

Change-Id: I2189d2ba223ed3fb51cfa94639c6ca03d26a83e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102863
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx
index cc1528f53d89..21de11b5ea36 100644
--- a/bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx
@@ -451,7 +451,7 @@ namespace
 int index = functionIndex*nVtableOffsets + vtableOffset;
 unsigned char *result = ((unsigned char *) ) + 
codeSnippets[index];
 
-SAL_INFO( "bridges.ios", "codeSnippet(" << 
OUString(type->aBase.pTypeName) << "::" << OUString(member->pTypeName) << "): 
[" << functionIndex << "," << vtableOffset << "]=" << (void *) result << " (" 
<< std::hex << ((int*)result)[0] << "," << ((int*)result)[1] << "," << 
((int*)result)[2] << "," << ((int*)result)[3] << ")");
+SAL_INFO( "bridges", "codeSnippet(" << OUString(type->aBase.pTypeName) 
<< "::" << OUString(member->pTypeName) << "): [" << functionIndex << "," << 
vtableOffset << "]=" << (void *) result << " (" << std::hex << 
((int*)result)[0] << "," << ((int*)result)[1] << "," << ((int*)result)[2] << 
"," << ((int*)result)[3] << ")");
 
 return result;
 }
diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index 988502713639..f1cacf8d54ba 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -128,7 +128,7 @@ std::type_info * Rtti::getRtti(typelib_TypeDescription 
const & type) {
 if (ptr != nullptr)
 rtti = *ptr;
 else
-SAL_WARN("bridges.osx", dlerror());
+SAL_WARN("bridges", dlerror());
 }
 #endif
 
diff --git a/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx 
b/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx
index a5e0e53580ac..24a0837a6e30 100644
--- a/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx
@@ -32,195 +32,188 @@
 
 #include "msci.hxx"
 
-using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star;
 
 namespace
 {
 
 static inline typelib_TypeClass cpp2uno_call(
 bridges::cpp_uno::shared::CppInterfaceProxy * pThis,
-const typelib_TypeDescription * pMemberTypeDescr,
-typelib_TypeDescriptionReference * pReturnTypeRef, // 0 indicates void 
return
-sal_Int32 nParams, typelib_MethodParameter * pParams,
+const typelib_TypeDescription * pMemberTD,
+typelib_TypeDescriptionReference * pReturnTypeRef, // nullptr indicates 
void return
+sal_Int32 nParams,
+typelib_MethodParameter * pParams,
 void ** pCallStack,
-sal_Int64 * pRegisterReturn /* space for register return */ )
+sal_Int64 * pRegisterReturn /* space for register return */)
 {
 // pCallStack: ret, this, [complex return ptr], params
-char * pCppStack = (char *)(pCallStack +2);
+char * pCppCallStack = (char *)(pCallStack +2);
 
-// return
-typelib_TypeDescription * pReturnTypeDescr = 0;
+// return type
+typelib_TypeDescription * pReturnTD = nullptr;
 if (pReturnTypeRef)
-{
-TYPELIB_DANGER_GET( , pReturnTypeRef );
-}
+TYPELIB_DANGER_GET(, pReturnTypeRef);
 
 void * pUnoReturn = nullptr;
-void * pCppReturn = nullptr; // complex return ptr: if != 0 && != 
pUnoReturn, reconversion need
+void * pCppReturn = nullptr; // complex return ptr: if != nullptr && != 
pUnoReturn, reconversion need
 
-if (pReturnTypeDescr)
+if (pReturnTD)
 {
-if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr ))
-{
-pUnoReturn = pRegisterReturn; // direct way for simple types
-}
-else // complex return via ptr (pCppReturn)
+if 

[Libreoffice-commits] core.git: bridges/source dbaccess/source drawinglayer/source

2020-08-18 Thread Andrea Gelmini (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_mips64/call.s|2 +-
 dbaccess/source/ui/browser/genericcontroller.cxx   |4 ++--
 dbaccess/source/ui/browser/unodatbr.cxx|4 ++--
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx |2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit d44a5250a4996bcfb2c66b8510f8a01a5888dd9f
Author: Andrea Gelmini 
AuthorDate: Tue Aug 18 14:58:32 2020 +0200
Commit: Julien Nabet 
CommitDate: Tue Aug 18 20:05:00 2020 +0200

Fix typos

Change-Id: I9d55e4478d8cf3047b4ccac88e06fdc87e68e6ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100871
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/bridges/source/cpp_uno/gcc3_linux_mips64/call.s 
b/bridges/source/cpp_uno/gcc3_linux_mips64/call.s
index 8f73a0557eb1..eb83eef46365 100644
--- a/bridges/source/cpp_uno/gcc3_linux_mips64/call.s
+++ b/bridges/source/cpp_uno/gcc3_linux_mips64/call.s
@@ -49,7 +49,7 @@ privateSnippetExecutor:
 sd $a5,56($sp)
 sd $a6,64($sp)
 sd $a7,72($sp)
-// Load arguemtns
+// Load arguments
 // a0=index
 move   $a0,$v0
 // a1=offset
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx 
b/dbaccess/source/ui/browser/genericcontroller.cxx
index a53ade551795..4c12a3ae7b51 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -872,7 +872,7 @@ sal_Bool SAL_CALL 
OGenericUnoController::supportsService(const OUString& Service
 
 void OGenericUnoController::startConnectionListening(const Reference< 
XConnection >& _rxConnection)
 {
-// we have to remove ourself before dispoing the connection
+// we have to remove ourself before disposing the connection
 Reference< XComponent >  xComponent(_rxConnection, UNO_QUERY);
 if (xComponent.is())
 xComponent->addEventListener(static_cast(this));
@@ -880,7 +880,7 @@ void OGenericUnoController::startConnectionListening(const 
Reference< XConnectio
 
 void OGenericUnoController::stopConnectionListening(const Reference< 
XConnection >& _rxConnection)
 {
-// we have to remove ourself before dispoing the connection
+// we have to remove ourself before disposing the connection
 Reference< XComponent >  xComponent(_rxConnection, UNO_QUERY);
 if (xComponent.is())
 
xComponent->removeEventListener(static_cast(this));
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx 
b/dbaccess/source/ui/browser/unodatbr.cxx
index 2d448bbcf1a0..46ea151072a4 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -240,7 +240,7 @@ void SAL_CALL SbaTableQueryBrowser::disposing()
 
 if (getBrowserView())
 {
-// Need to do some cleaup of the data pointed to the tree view entries 
before we remove the treeview
+// Need to do some cleanup of the data pointed to the tree view 
entries before we remove the treeview
 clearTreeModel();
 m_pTreeView = nullptr;
 getBrowserView()->setTreeView(nullptr);
@@ -3389,7 +3389,7 @@ int SbaTableQueryBrowser::OnTreeEntryCompare(const 
weld::TreeIter& rLHS, const w
 // we want the table entry and the end so we have to do a check
 if (isContainer(rRHS))
 {
-// don't use getEntryType (directly or indirecly) for the LHS:
+// don't use getEntryType (directly or indirectly) for the LHS:
 // LHS is currently being inserted, so it is not "completely valid" at 
the moment
 
 const EntryType eRight = getEntryType(rRHS);
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 73fb76012889..d20efe5eb01f 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -681,7 +681,7 @@ VclMetafileProcessor2D::~VclMetafileProcessor2D()
 Only used in goodies\source\filter.vcl\ieps\ieps.cxx and 
svx\source\xml\xmlgrhlp.cxx to
 hold the original EPS which was imported in the same MetaFile as first 2 
entries. Only
 used to export the original again (if exists).
-Not necessary to support with MetaFuleRenderer.
+Not necessary to support with MetaFileRenderer.
 
 XTEXT_SCROLLRECT, XTEXT_PAINTRECT
 Currently used to get extra MetaFile infos using GraphicExporter which 
again uses
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-08-13 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx   |   43 +---
 bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx |   53 
 2 files changed, 88 insertions(+), 8 deletions(-)

New commits:
commit cc5a6c6afeed1d2cf76d288133971d29ee8d893e
Author: Stephan Bergmann 
AuthorDate: Thu Aug 13 11:20:38 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Aug 13 15:55:08 2020 +0200

gcc3_linux_{aarch64,x86-64} need the __cxa_exception hack in deleteException

* gcc3_linux_aarch64 needs a hack to detect the reserve member in LLVM >= 10
  libcxxabi __cxa_exception, in addition to the existing hack for LLVM 5.

  On macOS arm64 (which shares the 
bridges/source/cpp_uno/gcc3_linux_aarch64/
  code) we know that we always target a >= LLVM 10 libcxxabi, so we do not 
need
  neither of the two hacks there.

  (And a7d1fed24557b203acb5016a98af26f4ef24d27a "Hack to dynamically adapt 
to
  __cxa_exceptiom in LLVM 5.0 libcxxabi" had introduced a 
"fillUnoException" vs.
  "mapException" typo in the comment when it copied it from
  bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx.)

* Similarly, gcc3_linux_x86_64 needs both hacks when it is built against
  libcxxabi (and the need for the LLVM 5 hack had gone unnoticed there for 
now).

* It is not clear to me now why gcc3_macosx_x86-64 needs the LLVM 5 hack 
(which
  I even initially developed for that platform,
  7a9dd3d482deeeb3ed1d50074e56adbd3f928296 "Hack to dynamically adapt to
  __cxa_exceptiom in LLVM 5.0 libcxxabi") but not the LLVM >= 10 hack 
(although
  it does need the corresponding hack in fillUnoException when running 
against
  recent upstream LLVM trunk libcxxabi, 
f4b6f6a8ae60bdec53512728d00853b73fa18500
  "Hack to dynamically adapt to __cxa_exceptiom in LLVM 11 libcxxabi".

Change-Id: I8e7a5c871fbeeaf82bbd16fa03e73f10f229da93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100656
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index 492c14898977..988502713639 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -162,8 +162,8 @@ std::type_info * getRtti(typelib_TypeDescription const & 
type) {
 extern "C" void _GLIBCXX_CDTOR_CALLABI deleteException(void * exception) {
 __cxxabiv1::__cxa_exception * header =
 static_cast<__cxxabiv1::__cxa_exception *>(exception) - 1;
-#if defined _LIBCPPABI_VERSION // detect libc++abi
-// The libcxxabi commit
+#if !defined MACOSX && defined _LIBCPPABI_VERSION // detect libc++abi
+// First, the libcxxabi commit
 // 
 // "[libcxxabi] Align unwindHeader on a double-word boundary" towards
 // LLVM 5.0 changed the size of __cxa_exception by adding
@@ -173,21 +173,48 @@ extern "C" void _GLIBCXX_CDTOR_CALLABI 
deleteException(void * exception) {
 // to the final member unwindHeader, on x86-64 effectively adding a hole of
 // size 8 in front of that member (changing its offset from 88 to 96,
 // sizeof(__cxa_exception) from 120 to 128, and alignof(__cxa_exception)
-// from 8 to 16); a hack to dynamically determine whether we run against a
+// from 8 to 16); the "header1" hack below to dynamically determine 
whether we run against a
 // LLVM 5 libcxxabi is to look at the exceptionDestructor member, which 
must
-// point to this function (the use of __cxa_exception in fillUnoException 
is
+// point to this function (the use of __cxa_exception in mapException is
 // unaffected, as it only accesses members towards the start of the struct,
 // through a pointer known to actually point at the start).  The libcxxabi 
commit
 // 

 // "Insert padding before the __cxa_exception header to ensure the thrown" 
in LLVM 6
-// removes the need for this hack, so it can be removed again once we can 
be sure that we only
-// run against libcxxabi from LLVM >= 6:
+// removes the need for this hack, so the "header1" hack can be removed 
again once we can be
+// sure that we only run against libcxxabi from LLVM >= 6.
+//
+// Second, the libcxxabi commit
+// 

+// "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility" in LLVM 10 changed
+// the layout of the start of __cxa_exception to
+//
+//  [8 byte  void *reserve]
+//   8 byte  size_t referenceCount
+//
+// so the "header2" hack below to dynamically determine whether we run 
against a LLVM >= 10
+// libcxxabi is to look whether the exceptionDestructor (with its known 
value) 

[Libreoffice-commits] core.git: bridges/source

2020-08-13 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_ios/except.cxx   |8 ++--
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx|   14 ++
 bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx |8 
 3 files changed, 16 insertions(+), 14 deletions(-)

New commits:
commit 96b3de39bc723ffe0beea278e32b9c858873bfc5
Author: Stephan Bergmann 
AuthorDate: Thu Aug 13 08:29:51 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Aug 13 13:41:20 2020 +0200

Document that the deleteException hack is only relevant for LLVM 5, not 
later

Change-Id: I2d93d3d76f2fe5e24e6864725184519c0595076b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100638
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_ios/except.cxx 
b/bridges/source/cpp_uno/gcc3_ios/except.cxx
index 2ef8ef49b966..58f458da34db 100644
--- a/bridges/source/cpp_uno/gcc3_ios/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios/except.cxx
@@ -267,10 +267,14 @@ static void deleteException( void * pExc )
 // size 8 in front of that member (changing its offset from 88 to 96,
 // sizeof(__cxa_exception) from 120 to 128, and alignof(__cxa_exception)
 // from 8 to 16); a hack to dynamically determine whether we run against a
-// new libcxxabi is to look at the exceptionDestructor member, which must
+// LLVM 5 libcxxabi is to look at the exceptionDestructor member, which 
must
 // point to this function (the use of __cxa_exception in fillUnoException 
is
 // unaffected, as it only accesses members towards the start of the struct,
-// through a pointer known to actually point at the start):
+// through a pointer known to actually point at the start).  The libcxxabi 
commit
+// 

+// "Insert padding before the __cxa_exception header to ensure the thrown" 
in LLVM 6
+// removes the need for this hack, so it can be removed again once we can 
be sure that we only
+// run against libcxxabi from LLVM >= 6:
 if (header->exceptionDestructor != ) {
 header = reinterpret_cast<__cxa_exception const *>(
 reinterpret_cast(header) - 8);
diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index 7164b4ecb51c..492c14898977 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -174,16 +174,14 @@ extern "C" void _GLIBCXX_CDTOR_CALLABI 
deleteException(void * exception) {
 // size 8 in front of that member (changing its offset from 88 to 96,
 // sizeof(__cxa_exception) from 120 to 128, and alignof(__cxa_exception)
 // from 8 to 16); a hack to dynamically determine whether we run against a
-// new libcxxabi is to look at the exceptionDestructor member, which must
+// LLVM 5 libcxxabi is to look at the exceptionDestructor member, which 
must
 // point to this function (the use of __cxa_exception in fillUnoException 
is
 // unaffected, as it only accesses members towards the start of the struct,
-// through a pointer known to actually point at the start):
-
-// Later, libcxxabi, as used at least on macOS on arm64, added a
-// void *reserve at the start of the __cxa_exception in front of
-// the referenceCount. See
-// 
https://github.com/llvm/llvm-project/commit/674ec1eb16678b8addc02a4b0534ab383d22fa77
-
+// through a pointer known to actually point at the start).  The libcxxabi 
commit
+// 

+// "Insert padding before the __cxa_exception header to ensure the thrown" 
in LLVM 6
+// removes the need for this hack, so it can be removed again once we can 
be sure that we only
+// run against libcxxabi from LLVM >= 6:
 if (header->exceptionDestructor != ) {
 header = reinterpret_cast<__cxxabiv1::__cxa_exception *>(
 reinterpret_cast(header) - 8);
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx 
b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
index e0216ddf3824..60f5f6e40ef1 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
@@ -271,14 +271,14 @@ static void deleteException( void * pExc )
 // size 8 in front of that member (changing its offset from 88 to 96,
 // sizeof(__cxa_exception) from 120 to 128, and alignof(__cxa_exception)
 // from 8 to 16); a hack to dynamically determine whether we run against a
-// new libcxxabi is to look at the exceptionDestructor member, which must
+// LLVM 5 libcxxabi is to look at the exceptionDestructor member, which 
must
 // point to this function (the use of __cxa_exception in fillUnoException 
is
 // unaffected, as it only accesses members towards the start of the struct,
 // 

[Libreoffice-commits] core.git: bridges/source

2020-08-13 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx |   11 ++
 bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx |   33 --
 2 files changed, 42 insertions(+), 2 deletions(-)

New commits:
commit e6450f1115b8c1f80d6b442cce8b4ee24bcddd02
Author: Stephan Bergmann 
AuthorDate: Thu Aug 13 09:38:27 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Aug 13 13:25:47 2020 +0200

gcc3_linux_aarch64 also needs the hack to dynamically adapt to 
__cxa_exception

...in LLVM 10 libcxxabi, same as f4b6f6a8ae60bdec53512728d00853b73fa18500 
"Hack
to dynamically adapt to __cxa_exceptiom in LLVM 11 libcxxabi" for
gcc3_macosx_x86-64 and 986bd28388df745dd969e7be7c3bda36b2b2cb0e "ofz#24641
libc++abi __cxa_exception has grown another member" for gcc3_linux_x86-64.
(Note that 91c8a3f3e7d3c178952d7e78e24cd0d6ba2b165a "The
__cxa_exception::reserve member has been backported to LLVM 10 libcxxabi" 
found
out that this is already relevant for LLVM 10, contrary to the mentioned
commits' subject lines.)

On macOS arm64 (which shares the bridges/source/cpp_uno/gcc3_linux_aarch64/
code) we know that we always target a >= LLVM 10 libcxxabi, so we do not 
need
the hack there.

Change-Id: I49e3d5b06b0b427ee3edeb10281025e4b9f2615f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100644
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx
index 008d4723e295..4a677be0219f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx
@@ -72,6 +72,17 @@ struct __cxa_exception {
 #if defined _LIBCPPABI_VERSION // detect libc++abi
 #if defined __LP64__ || LIBCXXABI_ARM_EHABI
 #ifdef MACOSX // on arm64
+// This is a new field added with LLVM 10
+// 

+// "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility".  For non-MACOSX,
+// the HACK in call 
(bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx) tries to find out at
+// runtime whether a __cxa_exception has this member.  Once we can be sure 
that we only run
+// against new libcxxabi that has this member, we can drop the "#ifdef 
MACOSX" here and drop the
+// hack in call.
+
+// Now _Unwind_Exception is marked with __attribute__((aligned)),
+// which implies __cxa_exception is also aligned. Insert padding
+// in the beginning of the struct, rather than before unwindHeader.
 void *reserve;
 #endif
 std::size_t referenceCount;
diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx
index d1928942eb06..760a7b38551d 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx
@@ -187,9 +187,38 @@ void call(
 "C++ code threw unknown exception");
 }
 } catch (css::uno::Exception &) {
+__cxxabiv1::__cxa_exception * header = 
reinterpret_cast<__cxxabiv1::__cxa_eh_globals *>(
+__cxxabiv1::__cxa_get_globals())->caughtExceptions;
+#if !defined MACOSX && defined _LIBCPPABI_VERSION // detect libc++abi
+// Very bad HACK to find out whether we run against a libcxxabi that 
has a new
+// __cxa_exception::reserved member at the start, introduced with LLVM 
10
+// 

+// "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility".  The layout of
+// the start of __cxa_exception is
+//
+//  [8 byte  void *reserve]
+//   8 byte  size_t referenceCount
+//
+// where the (bad, hacky) assumption is that reserve (if present) is 
null
+// (__cxa_allocate_exception in at least LLVM 11 zero-fills the 
object, and nothing actively
+// sets reserve) while referenceCount is non-null (__cxa_throw sets it 
to 1, and
+// __cxa_decrement_exception_refcount destroys the exception as soon 
as it drops to 0; for a
+// __cxa_dependent_exception, the referenceCount member is rather
+//
+//   8 byte  void* primaryException
+//
+// but which also will always be set to a non-null value in
+// __cxa_rethrow_primary_exception).  As described in the definition 
of __cxa_exception
+// (bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx), this hack 
(together with the
+// "#ifdef MACOSX" there) can be dropped once we can be sure that we 
only run against new
+// libcxxabi that has the reserve member:
+if (*reinterpret_cast(header) == nullptr) {
+header = reinterpret_cast<__cxxabiv1::__cxa_exception*>(
+

[Libreoffice-commits] core.git: bridges/source

2020-08-12 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx|2 +-
 bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx  |4 ++--
 bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx   |4 ++--
 bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx |   10 +-
 bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx  |4 ++--
 5 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 91c8a3f3e7d3c178952d7e78e24cd0d6ba2b165a
Author: Stephan Bergmann 
AuthorDate: Wed Aug 12 13:37:19 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Aug 12 17:37:06 2020 +0200

The __cxa_exception::reserve member has been backported to LLVM 10 libcxxabi

...so record that fact in our comments, to avoid confusion

Change-Id: I83a9c576a92d74c207c8c778df0d020daf5bf33d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100593
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index b0a35996784e..7164b4ecb51c 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -182,7 +182,7 @@ extern "C" void _GLIBCXX_CDTOR_CALLABI deleteException(void 
* exception) {
 // Later, libcxxabi, as used at least on macOS on arm64, added a
 // void *reserve at the start of the __cxa_exception in front of
 // the referenceCount. See
-// 
https://github.com/llvm/llvm-project/commit/f2a436058fcbc11291e73badb44e243f61046183#diff-ba9cda1ceca630ba040b154fe198adbd
+// 
https://github.com/llvm/llvm-project/commit/674ec1eb16678b8addc02a4b0534ab383d22fa77
 
 if (header->exceptionDestructor != ) {
 header = reinterpret_cast<__cxxabiv1::__cxa_exception *>(
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
index 25931671f7dc..981ddfe676f7 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
@@ -152,8 +152,8 @@ void fillUnoException(uno_Any * pUnoExc, uno_Mapping * 
pCpp2Uno)
 
 #if defined _LIBCPPABI_VERSION // detect libc++abi
 // Very bad HACK to find out whether we run against a libcxxabi that has a 
new
-// __cxa_exception::reserved member at the start, introduced with LLVM 11
-// 

+// __cxa_exception::reserved member at the start, introduced with LLVM 10
+// 

 // "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility".  The layout of the
 // start of __cxa_exception is
 //
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
index 53c8841fbbcb..edcb46d0da2a 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
@@ -109,8 +109,8 @@ struct __cxa_exception {
 #if defined _LIBCPPABI_VERSION // detect libc++abi
 #if defined __LP64__ || LIBCXXABI_ARM_EHABI
 #if 0
-// This is a new field added with LLVM 11
-// 

+// This is a new field added with LLVM 10
+// 

 // "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility".  The HACK in
 // fillUnoException (bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx) 
tries to find out at
 // runtime whether a __cxa_exception has this member.  Once we can be sure 
that we only run
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx 
b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
index 36eeda41bca7..e0216ddf3824 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
@@ -275,10 +275,10 @@ static void deleteException( void * pExc )
 // point to this function (the use of __cxa_exception in fillUnoException 
is
 // unaffected, as it only accesses members towards the start of the struct,
 // through a pointer known to actually point at the start).  The libcxxabi 
commit
-// 

-// "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility" towards LLVM 11
+// 

+// "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility" in LLVM 10
 // removes the need for this hack, so it can be removed again once we can 
be sure that we only
-// run against libcxxabi from LLVM >= 11:
+// run against libcxxabi from LLVM >= 10:
 if 

[Libreoffice-commits] core.git: bridges/source

2020-08-06 Thread Caolán McNamara (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx |   28 
 bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx  |   14 ++
 2 files changed, 42 insertions(+)

New commits:
commit 986bd28388df745dd969e7be7c3bda36b2b2cb0e
Author: Caolán McNamara 
AuthorDate: Thu Aug 6 10:50:47 2020 +0100
Commit: Caolán McNamara 
CommitDate: Thu Aug 6 21:42:21 2020 +0200

ofz#24641 libc++abi __cxa_exception has grown another member

https: 
//github.com/llvm/llvm-project/commit/f2a436058fcbc11291e73badb44e243f61046183

this is the same problem as

commit f4b6f6a8ae60bdec53512728d00853b73fa18500
Author: Stephan Bergmann 
Date:   Thu Feb 13 08:40:11 2020 +0100

Hack to dynamically adapt to __cxa_exceptiom in LLVM 11 libcxxabi

(where the new change to __cxa_exception effectively reverts the change 
that
prompted 7a9dd3d482deeeb3ed1d50074e56adbd3f928296 "Hack to dynamically 
adapt to
__cxa_exceptiom in LLVM 5.0 libcxxabi")

Change-Id: Iec4ef1dc188bea2223d99b1b7eb8adec636c98e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88583
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

so c-n-p that solution here

Change-Id: I4475757a766e3ade7b9fcaf6149e535c9f9a4fa4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100209
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
index e9e861f1c210..25931671f7dc 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
@@ -150,6 +150,34 @@ void fillUnoException(uno_Any * pUnoExc, uno_Mapping * 
pCpp2Uno)
 return;
 }
 
+#if defined _LIBCPPABI_VERSION // detect libc++abi
+// Very bad HACK to find out whether we run against a libcxxabi that has a 
new
+// __cxa_exception::reserved member at the start, introduced with LLVM 11
+// 

+// "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility".  The layout of the
+// start of __cxa_exception is
+//
+//  [8 byte  void *reserve]
+//   8 byte  size_t referenceCount
+//
+// where the (bad, hacky) assumption is that reserve (if present) is null
+// (__cxa_allocate_exception in at least LLVM 11 zero-fills the object, 
and nothing actively
+// sets reserve) while referenceCount is non-null (__cxa_throw sets it to 
1, and
+// __cxa_decrement_exception_refcount destroys the exception as soon as it 
drops to 0; for a
+// __cxa_dependent_exception, the referenceCount member is rather
+//
+//   8 byte  void* primaryException
+//
+// but which also will always be set to a non-null value in 
__cxa_rethrow_primary_exception).
+// As described in the definition of __cxa_exception
+// (bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx), this hack 
(together with the "#if 0"
+// there) can be dropped once we can be sure that we only run against new 
libcxxabi that has the
+// reserve member:
+if (*reinterpret_cast(header) == nullptr) {
+header = 
reinterpret_cast<__cxxabiv1::__cxa_exception*>(reinterpret_cast(header) + 1);
+}
+#endif
+
 std::type_info *exceptionType = __cxxabiv1::__cxa_current_exception_type();
 
 typelib_TypeDescription * pExcTypeDescr = nullptr;
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
index e8afe35c4f59..53c8841fbbcb 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
@@ -108,6 +108,20 @@ namespace __cxxabiv1 {
 struct __cxa_exception {
 #if defined _LIBCPPABI_VERSION // detect libc++abi
 #if defined __LP64__ || LIBCXXABI_ARM_EHABI
+#if 0
+// This is a new field added with LLVM 11
+// 

+// "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility".  The HACK in
+// fillUnoException (bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx) 
tries to find out at
+// runtime whether a __cxa_exception has this member.  Once we can be sure 
that we only run
+// against new libcxxabi that has this member, we can drop the "#if 0" 
here and drop the hack
+// in fillUnoException.
+
+// Now _Unwind_Exception is marked with __attribute__((aligned)),
+// which implies __cxa_exception is also aligned. Insert padding
+// in the beginning of the struct, rather than before unwindHeader.
+void *reserve;
+#endif
 std::size_t referenceCount;
 #endif
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: bridges/source hardened_runtime.xcent.in

2020-04-29 Thread Tor Lillqvist (via logerrit)
 bridges/source/cpp_uno/shared/vtablefactory.cxx |6 ++
 hardened_runtime.xcent.in   |2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 2c366aae9263dc4115b054fe74b90cabea61fa0b
Author: Tor Lillqvist 
AuthorDate: Wed Apr 29 20:12:21 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Apr 30 07:38:02 2020 +0200

Use a less extreme entitlement for our run-time machine code generation

See 
https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-executable-page-protection
and 
https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-jit

Change-Id: I192038efa9cff4fb723bf4bdc8644f0b09f0fcda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93181
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx 
b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index 018b808d89e6..036b81c4218a 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -77,6 +77,11 @@ extern "C" void * allocExec(
 std::size_t n = (*size + (pagesize - 1)) & ~(pagesize - 1);
 void * p;
 #if defined SAL_UNX
+#if defined MACOSX
+p = mmap(
+nullptr, n, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON 
| MAP_JIT, -1,
+0);
+#else
 p = mmap(
 nullptr, n, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1,
 0);
@@ -88,6 +93,7 @@ extern "C" void * allocExec(
 munmap (p, n);
 p = nullptr;
 }
+#endif
 #elif defined _WIN32
 p = VirtualAlloc(nullptr, n, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
 #endif
diff --git a/hardened_runtime.xcent.in b/hardened_runtime.xcent.in
index d270c93ec694..2bbcda34f18c 100644
--- a/hardened_runtime.xcent.in
+++ b/hardened_runtime.xcent.in
@@ -6,7 +6,7 @@
 com.apple.security.automation.apple-events
 
 
-com.apple.security.cs.disable-executable-page-protection
+com.apple.security.cs.allow-jit
 
 
 com.apple.security.cs.disable-library-validation
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-04-18 Thread Noel Grandin (via logerrit)
 bridges/source/cpp_uno/shared/bridge.cxx|  152 ++--
 bridges/source/cpp_uno/shared/component.cxx |  152 ++--
 bridges/source/cpp_uno/shared/unointerfaceproxy.cxx |   26 +--
 bridges/source/jni_uno/jni_bridge.cxx   |   86 +--
 4 files changed, 208 insertions(+), 208 deletions(-)

New commits:
commit eab4993eab9a2a9e0660a827ed60f0125cf20d53
Author: Noel Grandin 
AuthorDate: Sat Apr 18 14:15:02 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Apr 18 21:47:45 2020 +0200

loplugin:flatten in bridges

Change-Id: I736032df48cb491508c27cbe773b964d1d2359b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92482
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/cpp_uno/shared/bridge.cxx 
b/bridges/source/cpp_uno/shared/bridge.cxx
index 007373448bb3..3753341ccde2 100644
--- a/bridges/source/cpp_uno/shared/bridge.cxx
+++ b/bridges/source/cpp_uno/shared/bridge.cxx
@@ -59,39 +59,39 @@ void cpp2unoMapping(
 static_cast< uno_Interface * >( *ppUnoI ) );
 *ppUnoI = nullptr;
 }
-if (pCppI)
+if (!pCppI)
+return;
+
+Bridge * pBridge = static_cast< Bridge::Mapping * >( pMapping )->pBridge;
+
+// get object id of interface to be wrapped
+rtl_uString * pOId = nullptr;
+(*pBridge->pCppEnv->getObjectIdentifier)(
+pBridge->pCppEnv, , pCppI );
+assert(pOId);
+
+// try to get any known interface from target environment
+(*pBridge->pUnoEnv->getRegisteredInterface)(
+pBridge->pUnoEnv, ppUnoI, pOId, pTypeDescr );
+
+if (! *ppUnoI) // no existing interface, register new proxy interface
 {
-Bridge * pBridge = static_cast< Bridge::Mapping * >( pMapping 
)->pBridge;
-
-// get object id of interface to be wrapped
-rtl_uString * pOId = nullptr;
-(*pBridge->pCppEnv->getObjectIdentifier)(
-pBridge->pCppEnv, , pCppI );
-assert(pOId);
-
-// try to get any known interface from target environment
-(*pBridge->pUnoEnv->getRegisteredInterface)(
-pBridge->pUnoEnv, ppUnoI, pOId, pTypeDescr );
-
-if (! *ppUnoI) // no existing interface, register new proxy interface
-{
-// try to publish a new proxy (refcount initially 1)
-uno_Interface * pSurrogate
-= bridges::cpp_uno::shared::UnoInterfaceProxy::create(
-pBridge,
-static_cast< ::com::sun::star::uno::XInterface * >( pCppI 
),
-pTypeDescr, pOId );
-
-// proxy may be exchanged during registration
-(*pBridge->pUnoEnv->registerProxyInterface)(
-pBridge->pUnoEnv, reinterpret_cast< void ** >(  ),
-freeUnoInterfaceProxy, pOId,
-pTypeDescr );
-
-*ppUnoI = pSurrogate;
-}
-::rtl_uString_release( pOId );
+// try to publish a new proxy (refcount initially 1)
+uno_Interface * pSurrogate
+= bridges::cpp_uno::shared::UnoInterfaceProxy::create(
+pBridge,
+static_cast< ::com::sun::star::uno::XInterface * >( pCppI ),
+pTypeDescr, pOId );
+
+// proxy may be exchanged during registration
+(*pBridge->pUnoEnv->registerProxyInterface)(
+pBridge->pUnoEnv, reinterpret_cast< void ** >(  ),
+freeUnoInterfaceProxy, pOId,
+pTypeDescr );
+
+*ppUnoI = pSurrogate;
 }
+::rtl_uString_release( pOId );
 }
 
 void uno2cppMapping(
@@ -105,38 +105,38 @@ void uno2cppMapping(
 release();
 *ppCppI = nullptr;
 }
-if (pUnoI)
+if (!pUnoI)
+return;
+
+Bridge * pBridge = static_cast< Bridge::Mapping * >( pMapping )->pBridge;
+
+// get object id of uno interface to be wrapped
+rtl_uString * pOId = nullptr;
+(*pBridge->pUnoEnv->getObjectIdentifier)(
+pBridge->pUnoEnv, , pUnoI );
+assert(pOId);
+
+// try to get any known interface from target environment
+(*pBridge->pCppEnv->getRegisteredInterface)(
+pBridge->pCppEnv, ppCppI, pOId, pTypeDescr );
+
+if (! *ppCppI) // no existing interface, register new proxy interface
 {
-Bridge * pBridge = static_cast< Bridge::Mapping * >( pMapping 
)->pBridge;
-
-// get object id of uno interface to be wrapped
-rtl_uString * pOId = nullptr;
-(*pBridge->pUnoEnv->getObjectIdentifier)(
-pBridge->pUnoEnv, , pUnoI );
-assert(pOId);
-
-// try to get any known interface from target environment
-(*pBridge->pCppEnv->getRegisteredInterface)(
-pBridge->pCppEnv, ppCppI, pOId, pTypeDescr );
-
-if (! *ppCppI) // no existing interface, register new proxy interface
-{
-// try to publish a new proxy (ref count initially 1)
-com::sun::star::uno::XInterface * pProxy
-

[Libreoffice-commits] core.git: bridges/source compilerplugins/clang pyuno/inc sc/source sdext/source sfx2/source sw/qa sw/source vcl/source vcl/unx

2020-03-26 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/shared/vtablefactory.cxx |2 
 compilerplugins/clang/cstylecast.cxx|   87 +---
 compilerplugins/clang/test/cstylecast.cxx   |   11 +++
 pyuno/inc/pyuno.hxx |2 
 sc/source/filter/xcl97/xcl97rec.cxx |2 
 sdext/source/pdfimport/tree/style.hxx   |2 
 sfx2/source/sidebar/SidebarController.cxx   |2 
 sw/qa/extras/globalfilter/globalfilter.cxx  |2 
 sw/source/core/doc/doctxm.cxx   |   12 +--
 sw/source/core/doc/notxtfrm.cxx |4 -
 sw/source/core/layout/paintfrm.cxx  |2 
 sw/source/core/text/porfld.cxx  |2 
 vcl/source/app/svmain.cxx   |2 
 vcl/unx/gtk3/gtk3gtkinst.cxx|8 +-
 14 files changed, 95 insertions(+), 45 deletions(-)

New commits:
commit 1ebeacb20ad0165e399629fcfd7795ad0da3edf8
Author: Stephan Bergmann 
AuthorDate: Thu Mar 26 08:34:37 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Mar 26 09:13:55 2020 +0100

Extend loplugin:cstylecast to certain function-style casts

...that are equivalent to const_cast or reinterpret_cast, and should 
arguably
better be written that way for clarity.  Drawing inspiration from
 "Replace `T(x)` with 
`reinterpret_cast(x)`
everywhere it means reinterpret_cast. No functional change".

Change-Id: I27b8f70d324d32ecba658db4d1c2db03e10d5d3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91086
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx 
b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index 70187cbd2fe7..018b808d89e6 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -336,7 +336,7 @@ sal_Int32 VtableFactory::createVtables(
 code = addLocalFunctions(
 , code,
 #ifdef USE_DOUBLE_MMAP
-sal_uIntPtr(block.exec) - sal_uIntPtr(block.start),
+reinterpret_cast(block.exec) - 
reinterpret_cast(block.start),
 #endif
 type2,
 baseOffset.getFunctionOffset(type2->aBase.pTypeName),
diff --git a/compilerplugins/clang/cstylecast.cxx 
b/compilerplugins/clang/cstylecast.cxx
index fe3b2a19c561..7fa2ce0ae1b0 100644
--- a/compilerplugins/clang/cstylecast.cxx
+++ b/compilerplugins/clang/cstylecast.cxx
@@ -17,7 +17,9 @@
 #include "plugin.hxx"
 
 //
-// We don't like using C-style casts in C++ code
+// We don't like using C-style casts in C++ code.  Similarly, warn about 
function-style casts (which
+// are semantically equivalent to C-style casts) that are not semantically 
equivalent to static_cast
+// and should rather be written as const_cast or reinterpret_cast.
 //
 
 namespace {
@@ -187,6 +189,8 @@ public:
 
 bool VisitCStyleCastExpr(const CStyleCastExpr * expr);
 
+bool VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr const * expr);
+
 private:
 bool isConstCast(QualType from, QualType to);
 
@@ -199,6 +203,8 @@ private:
 
 bool rewriteArithmeticCast(CStyleCastExpr const * expr, char const ** 
replacement);
 
+void reportCast(ExplicitCastExpr const * expr, char const * performsHint);
+
 unsigned int externCContexts_ = 0;
 std::set rewritten_;
 // needed when rewriting in macros, in general to avoid "double code 
replacement, possible
@@ -258,32 +264,35 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr 
* expr) {
 perf = "const_cast";
 }
 }
-std::string incompFrom;
-std::string incompTo;
-if( expr->getCastKind() == CK_BitCast ) {
-if (resolvePointers(expr->getSubExprAsWritten()->getType())
-->isIncompleteType())
+reportCast(expr, perf);
+return true;
+}
+
+bool CStyleCast::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr const * 
expr) {
+if (ignoreLocation(expr)) {
+return true;
+}
+char const * perf = nullptr;
+switch (expr->getCastKind()) {
+case CK_ConstructorConversion:
+case CK_Dependent: //TODO: really filter out all of these?
+case CK_IntegralCast:
+case CK_IntegralToBoolean:
+case CK_ToVoid:
+return true;
+case CK_NoOp:
+if (isConstCast(
+expr->getSubExprAsWritten()->getType(),
+expr->getTypeAsWritten()))
 {
-incompFrom = "incomplete ";
-}
-if (resolvePointers(expr->getType())->isIncompleteType()) {
-incompTo = "incomplete ";
+perf = "const_cast";
+break;
 }
+return true; //TODO: really filter out all of these?
+default:
+break;
 }
-if (perf == nullptr) {
-perf = recommendedFix(expr->getCastKind());
-}
-std::string performs;
-if (perf != nullptr) {
-

[Libreoffice-commits] core.git: bridges/source

2020-02-23 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/call.s |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b5b4f3153fe54fb2f9db5f9d4f176fe68f0baf7f
Author: Stephan Bergmann 
AuthorDate: Sun Feb 23 19:02:45 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Feb 23 19:46:00 2020 +0100

.eh_frame section should probably have type @unwind

(i.e., SHT_X86_64_UNWIND) rather than @progbits (i.e., SHT_PROGBITS).
Discussion at 

"SHT_X86_64_UNWIND" sounds like both @unwind and @progbits are used in 
practice,
but Clang/LLVM now started to fail with

> 
/home/sbergman/lo/core/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s:79:2: 
error: changed section type for .eh_frame, expected: 0x7001
>  .section .eh_frame,"a",@progbits
>  ^

after  "[MC][ELF] Error for sh_type, 
sh_flags
or sh_entsize change".

Change-Id: I07cae987f7449c526a7130beee7a71d01afc457e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89305
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
index 57d0c9f94657..447ac0cecfdd 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
@@ -76,7 +76,7 @@ privateSnippetExecutor:
# see 
http://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html
# for details of the .eh_frame, the "Common Information Entry" and 
"Frame Description Entry" formats
# and http://mentorembedded.github.io/cxx-abi/exceptions.pdf for more 
info
-   .section.eh_frame,"a",@progbits
+   .section.eh_frame,"a",@unwind
 .Lframe1:
.long   .LECIE1-.LSCIE1
 .LSCIE1:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-02-13 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx |   32 ++-
 bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx  |   15 
 2 files changed, 46 insertions(+), 1 deletion(-)

New commits:
commit f4b6f6a8ae60bdec53512728d00853b73fa18500
Author: Stephan Bergmann 
AuthorDate: Thu Feb 13 08:40:11 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Feb 13 09:23:01 2020 +0100

Hack to dynamically adapt to __cxa_exceptiom in LLVM 11 libcxxabi

(where the new change to __cxa_exception effectively reverts the change that
prompted 7a9dd3d482deeeb3ed1d50074e56adbd3f928296 "Hack to dynamically 
adapt to
__cxa_exceptiom in LLVM 5.0 libcxxabi")

Change-Id: Iec4ef1dc188bea2223d99b1b7eb8adec636c98e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88583
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx 
b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
index c4cfe5123ec9..36eeda41bca7 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
@@ -274,7 +274,11 @@ static void deleteException( void * pExc )
 // new libcxxabi is to look at the exceptionDestructor member, which must
 // point to this function (the use of __cxa_exception in fillUnoException 
is
 // unaffected, as it only accesses members towards the start of the struct,
-// through a pointer known to actually point at the start):
+// through a pointer known to actually point at the start).  The libcxxabi 
commit
+// 

+// "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility" towards LLVM 11
+// removes the need for this hack, so it can be removed again once we can 
be sure that we only
+// run against libcxxabi from LLVM >= 11:
 if (header->exceptionDestructor != ) {
 header = reinterpret_cast<__cxa_exception const *>(
 reinterpret_cast(header) - 8);
@@ -348,6 +352,32 @@ void fillUnoException(uno_Any * pUnoExc, uno_Mapping * 
pCpp2Uno)
 return;
 }
 
+// Very bad HACK to find out whether we run against a libcxxabi that has a 
new
+// __cxa_exception::reserved member at the start, introduced with LLVM 11
+// 

+// "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility".  The layout of the
+// start of __cxa_exception is
+//
+//  [8 byte  void *reserve]
+//   8 byte  size_t referenceCount
+//
+// where the (bad, hacky) assumption is that reserve (if present) is null
+// (__cxa_allocate_exception in at least LLVM 11 zero-fills the object, 
and nothing actively
+// sets reserve) while referenceCount is non-null (__cxa_throw sets it to 
1, and
+// __cxa_decrement_exception_refcount destroys the exception as soon as it 
drops to 0; for a
+// __cxa_dependent_exception, the referenceCount member is rather
+//
+//   8 byte  void* primaryException
+//
+// but which also will always be set to a non-null value in 
__cxa_rethrow_primary_exception).
+// As described in the definition of __cxa_exception
+// (bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx), this hack 
(together with the "#if 0"
+// there) can be dropped once we can be sure that we only run against new 
libcxxabi that has the
+// reserve member:
+if (*reinterpret_cast(header) == nullptr) {
+header = reinterpret_cast<__cxa_exception *>(reinterpret_cast(header) + 1);
+}
+
 std::type_info *exceptionType = __cxxabiv1::__cxa_current_exception_type();
 
 typelib_TypeDescription * pExcTypeDescr = nullptr;
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx 
b/bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx
index 39939ab6be72..015cda1c00e5 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx
@@ -68,6 +68,21 @@ typedef unsigned _Unwind_Ptr 
__attribute__((__mode__(__pointer__)));
 struct __cxa_exception
 {
 #if __LP64__
+#if 0
+// This is a new field added with LLVM 11
+// 

+// "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility".  The HACK in
+// fillUnoException (bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx) 
tries to find out at
+// runtime whether a __cxa_exception has this member.  Once we can be sure 
that we only run
+// against new libcxxabi that has this member, we can drop the "#if 0" 
here and drop the hack
+// in fillUnoException.
+
+// Now _Unwind_Exception is marked with __attribute__((aligned)),
+// which implies __cxa_exception is also aligned. Insert padding
+

[Libreoffice-commits] core.git: bridges/source

2020-02-12 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6dd94a4dd8f0b842cd62ec872ede17c8077be98c
Author: Stephan Bergmann 
AuthorDate: Wed Feb 12 12:47:04 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Feb 12 16:20:15 2020 +0100

Blind fix for Linux aarch64 with libcxxabi

...after untested a7d1fed24557b203acb5016a98af26f4ef24d27a "Hack to 
dynamically
adapt to __cxa_exceptiom in LLVM 5.0 libcxxabi" had been submitted

Change-Id: I68694645825ddebb249a90d9af9b8ba04c0bdbb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88519
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index 611442a31e31..4a5a1d1b662d 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -153,8 +153,8 @@ extern "C" void _GLIBCXX_CDTOR_CALLABI deleteException(void 
* exception) {
 // unaffected, as it only accesses members towards the start of the struct,
 // through a pointer known to actually point at the start):
 if (header->exceptionDestructor != ) {
-header = reinterpret_cast<__cxa_exception const *>(
-reinterpret_cast(header) - 8);
+header = reinterpret_cast<__cxxabiv1::__cxa_exception *>(
+reinterpret_cast(header) - 8);
 assert(header->exceptionDestructor == );
 }
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2020-02-12 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx |   22 ++
 1 file changed, 22 insertions(+)

New commits:
commit a7d1fed24557b203acb5016a98af26f4ef24d27a
Author: Stephan Bergmann 
AuthorDate: Tue Feb 11 15:46:45 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Feb 12 09:11:45 2020 +0100

Hack to dynamically adapt to __cxa_exceptiom in LLVM 5.0 libcxxabi

...for Linux aarch64, similar to 7a9dd3d482deeeb3ed1d50074e56adbd3f928296 
"Hack
to dynamically adapt to __cxa_exceptiom in LLVM 5.0 libcxxabi" for macOS 
x86-64.
But unlike on macOS (which is known to always use libcxxabi), be careful to 
only
execute the hack in builds targeting libcxxabi.

Change-Id: I5417fde425d2d6bac9400592193a9fe5d2bfe175
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88458
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index 892bf6e81963..611442a31e31 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -136,6 +136,28 @@ std::type_info * getRtti(typelib_TypeDescription const & 
type) {
 extern "C" void _GLIBCXX_CDTOR_CALLABI deleteException(void * exception) {
 __cxxabiv1::__cxa_exception * header =
 static_cast<__cxxabiv1::__cxa_exception *>(exception) - 1;
+#if defined _LIBCPPABI_VERSION // detect libc++abi
+// The libcxxabi commit
+// 
+// "[libcxxabi] Align unwindHeader on a double-word boundary" towards
+// LLVM 5.0 changed the size of __cxa_exception by adding
+//
+//   __attribute__((aligned))
+//
+// to the final member unwindHeader, on x86-64 effectively adding a hole of
+// size 8 in front of that member (changing its offset from 88 to 96,
+// sizeof(__cxa_exception) from 120 to 128, and alignof(__cxa_exception)
+// from 8 to 16); a hack to dynamically determine whether we run against a
+// new libcxxabi is to look at the exceptionDestructor member, which must
+// point to this function (the use of __cxa_exception in fillUnoException 
is
+// unaffected, as it only accesses members towards the start of the struct,
+// through a pointer known to actually point at the start):
+if (header->exceptionDestructor != ) {
+header = reinterpret_cast<__cxa_exception const *>(
+reinterpret_cast(header) - 8);
+assert(header->exceptionDestructor == );
+}
+#endif
 OUString unoName(toUnoName(header->exceptionType->name()));
 typelib_TypeDescription * td = 0;
 typelib_typedescription_getByName(, unoName.pData);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source connectivity/source dbaccess/source embeddedobj/source filter/source io/source oox/source package/source sax/source sc/source sdext/source sd/source sfx2

2020-01-25 Thread Noel Grandin (via logerrit)
 bridges/source/jni_uno/jni_data.cxx|1 -
 connectivity/source/drivers/flat/ETable.cxx|1 -
 dbaccess/source/ui/misc/UITools.cxx|1 -
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx  |1 -
 embeddedobj/source/msole/olevisual.cxx |3 +--
 filter/source/config/cache/filterfactory.cxx   |2 --
 io/source/stm/omark.cxx|4 
 oox/source/export/shapes.cxx   |1 -
 oox/source/shape/ShapeContextHandler.cxx   |2 --
 package/source/manifest/ManifestImport.cxx |1 -
 sax/source/expatwrap/sax_expat.cxx |1 -
 sc/source/core/data/documen5.cxx   |1 -
 sc/source/filter/excel/excrecds.cxx|1 -
 sc/source/filter/excel/xeformula.cxx   |1 -
 sc/source/ui/view/dbfunc.cxx   |1 -
 sd/source/filter/html/htmlattr.cxx |2 --
 sd/source/filter/xml/sdxmlwrp.cxx  |1 -
 sd/source/ui/animations/SlideTransitionPane.cxx|1 -
 sd/source/ui/dlg/PhotoAlbumDialog.cxx  |1 -
 sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx |1 -
 sdext/source/presenter/PresenterNotesView.cxx  |9 -
 sdext/source/presenter/PresenterToolBar.cxx|1 -
 sfx2/source/dialog/versdlg.cxx |1 -
 sfx2/source/doc/doctemplates.cxx   |2 +-
 slideshow/source/engine/opengl/TransitionImpl.cxx  |2 +-
 slideshow/source/engine/slide/shapemanagerimpl.cxx |1 -
 svx/source/dialog/imapwnd.cxx  |2 --
 svx/source/dialog/rubydialog.cxx   |1 -
 svx/source/form/formcontroller.cxx |1 -
 svx/source/gallery2/galtheme.cxx   |1 -
 svx/source/gengal/gengal.cxx   |2 --
 svx/source/svdraw/svdoashp.cxx |1 -
 sw/source/core/access/accmap.cxx   |5 +
 sw/source/core/undo/unins.cxx  |2 --
 sw/source/filter/ww8/WW8TableInfo.cxx  |2 --
 sw/source/filter/xml/wrtxml.cxx|1 -
 ucb/source/ucp/cmis/cmis_content.cxx   |3 +--
 ucb/source/ucp/webdav-neon/webdavcontent.cxx   |1 -
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx|2 --
 vcl/source/gdi/gdimtf.cxx  |3 ---
 vcl/source/gdi/salmisc.cxx |1 -
 vcl/source/treelist/iconviewimpl.cxx   |2 --
 vcl/source/window/brdwin.cxx   |1 -
 vcl/unx/generic/gdi/gdiimpl.cxx|   10 --
 44 files changed, 5 insertions(+), 80 deletions(-)

New commits:
commit 51b5b93092d6231615de470c62494c24e54828a1
Author: Noel Grandin 
AuthorDate: Sat Jan 25 17:49:47 2020 +0200
Commit: Noel Grandin 
CommitDate: Sun Jan 26 08:01:42 2020 +0100

remove some unused local vars

found by a more aggressive variant of loplugin:unusedvariables.

This is my first pass, committing the simplest and most obviously
unnecessary vars

Change-Id: I9676a6e39a101937097788548764506c93811c57
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87414
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/jni_uno/jni_data.cxx 
b/bridges/source/jni_uno/jni_data.cxx
index daff48a48492..06e8467f7e7c 100644
--- a/bridges/source/jni_uno/jni_data.cxx
+++ b/bridges/source/jni_uno/jni_data.cxx
@@ -2339,7 +2339,6 @@ void Bridge::map_to_java(
 
 if (0 < nElements)
 {
-TypeDescr element_td( element_type );
 uno_Sequence * const * elements = 
reinterpret_cast(seq->elements);
 for ( sal_Int32 nPos = 0; nPos < nElements; ++nPos )
 {
diff --git a/connectivity/source/drivers/flat/ETable.cxx 
b/connectivity/source/drivers/flat/ETable.cxx
index 2da5d6ab8570..142d191be8c9 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -82,7 +82,6 @@ void OFlatTable::fillColumns(const css::lang::Locale& 
_aLocale)
 setRowPos(rowNum++, rowPos);
 
 // read first row
-QuotedTokenizedString aFirstLine;
 if(bRead)
 {
 bRead = readLine(, );
diff --git a/dbaccess/source/ui/misc/UITools.cxx 
b/dbaccess/source/ui/misc/UITools.cxx
index 257a10f3b8c0..0522d4ab834e 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -145,7 +145,6 @@ SQLExceptionInfo createConnection(  const OUString& 
_rsDataSourceName,
 catch(const Exception&)
 {
 }
-SQLExceptionInfo aInfo;
 
 return 

[Libreoffice-commits] core.git: bridges/source

2020-01-07 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx |7 
+--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 386248c9c2de669c211ba5a06afc8466f14c542b
Author: Stephan Bergmann 
AuthorDate: Tue Jan 7 17:35:18 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 7 20:27:57 2020 +0100

aarch64 r18 is reserved at least on Android

 states:  "The role of register r18 is platform specific.  If a
platform ABI has need of a dedicated general purpose register to carry 
inter-
procedural state (for example, the thread context) then it should use this
register for that purpose.  If the platform ABI has no such requirements, 
then
it should use r18 as an additional temporary register."

For a --host=aarch64-linux-android build, Clang warned

> bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx:39:9: 
error: inline asm clobber list contains reserved registers: X18 
[-Werror,-Winline-asm]
> "ldp x0, x1, [%[gpr_]]\n\t"
> ^
> :1:1: note: instantiated into assembly here
> ldp x0, x1, [x20]
> ^
> bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx:39:9: 
note: Reserved registers on the clobber list may not be preserved across the 
asm statement, and clobbering them may lead to undefined behaviour.
> "ldp x0, x1, [%[gpr_]]\n\t"
> ^
> :1:1: note: instantiated into assembly here
> ldp x0, x1, [x20]
> ^

and  "Start reserving x18 by default on
Android targets" shows that at least LLVM/Clang claims that the Android ABI
reserves it (though it doesn't cite any sources for that).

(If this bridges/source/cpp_uno/ implementation is used for other non-Linux 
OS
like Fuchsia, we may need to extend the #if accordingly; see the above LLVM
commit for which platforms it claims reserve the register.)

Change-Id: I62a5210ddc4784eee2ab56ee134b9e195827b9dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86366
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx
index 2f7188ea4f99..ba5194d6f8c8 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx
@@ -54,8 +54,11 @@ void callVirtualFunction(
[ret_]"m" (ret),
"m" (stackargs) // dummy input to prevent optimizing the alloca away
 : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",
-  "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18"/*TODO?*/, 
"v0",
-  "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11",
+  "r11", "r12", "r13", "r14", "r15", "r16", "r17",
+#if !defined ANDROID
+  "r18"/*TODO?*/,
+#endif
+  "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", 
"v11",
   "v12", "v13", "v14", "v15", "v16", "v17", "v18", "v19", "v20", "v21",
   "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31",
   "memory"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2019-12-18 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 23b384ee3b0ecde3e30dfd8c4fcb13aab9e65c04
Author: Stephan Bergmann 
AuthorDate: Wed Dec 18 15:42:41 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 18 18:10:44 2019 +0100

Silence -Werror,-Wuninitialized

...as seen with "Android (5220042 based on r346389c) clang version 8.0.7
(https://android.googlesource.com/toolchain/clang
b55f2d4ebfd35bf643d27dbca1bb228957008617)
(https://android.googlesource.com/toolchain/llvm
3c393fe7a7e13b0fba4ac75a01aa683d7a5b11cd) (based on LLVM 8.0.7svn)", warning
about functionIndex, vtableOffset, and indirectRet being used 
"uninitialized"
(but which is as intended, carrying over the values those registers have 
upon
entry to the function)

Change-Id: I443fe2e8bf7c25a5bd2bfd99c245d430be65f445
Reviewed-on: https://gerrit.libreoffice.org/85400
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
index d11a11b0c965..f9396321cb14 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
@@ -313,6 +313,7 @@ struct aarch64_va_list {
 };
 
 #pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wuninitialized"
 #pragma GCC diagnostic ignored "-Wvolatile-register-var"
 extern "C" void vtableSlotCall(
 unsigned long gpr0, unsigned long gpr1, unsigned long gpr2,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source

2019-12-18 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx |7 -
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx |  117 +-
 bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx |4 
 3 files changed, 92 insertions(+), 36 deletions(-)

New commits:
commit 189d498f5c0c633f8cd87b3f1b6d57020371a952
Author: Stephan Bergmann 
AuthorDate: Tue Dec 17 23:33:28 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 18 15:08:18 2019 +0100

tdf#128671: Rely on unwind.h, declare what's missing from cxxabi.h

...for gcc3_linux_aarch64, similar to what
128deeae81a6f802bfb79b8f0fa8c4b10729f7db "cxxabi.h is not specific to GCC" 
et al
did for gcc3_linux_x86-64

Change-Id: Iee9980842c0e5f6f49642407339a67e865f8be9c
Reviewed-on: https://gerrit.libreoffice.org/85344
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index 938011a09a2e..892bf6e81963 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -24,7 +24,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #include 
@@ -135,8 +134,8 @@ std::type_info * getRtti(typelib_TypeDescription const & 
type) {
 }
 
 extern "C" void _GLIBCXX_CDTOR_CALLABI deleteException(void * exception) {
-abi_aarch64::__cxa_exception * header =
-static_cast(exception) - 1;
+__cxxabiv1::__cxa_exception * header =
+static_cast<__cxxabiv1::__cxa_exception *>(exception) - 1;
 OUString unoName(toUnoName(header->exceptionType->name()));
 typelib_TypeDescription * td = 0;
 typelib_typedescription_getByName(, unoName.pData);
@@ -224,7 +223,7 @@ StructKind getStructKind(typelib_CompoundTypeDescription 
const * type) {
 namespace abi_aarch64 {
 
 void mapException(
-__cxa_exception * exception, std::type_info const * type, uno_Any * any, 
uno_Mapping * mapping)
+__cxxabiv1::__cxa_exception * exception, std::type_info const * type, 
uno_Any * any, uno_Mapping * mapping)
 {
 assert(exception != 0);
 assert(type != nullptr);
diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx
index 50c5f1f21a37..e3dc9b5872a7 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx
@@ -22,55 +22,114 @@
 
 #include 
 
+#include 
 #include 
 #include 
 
+#include 
+#ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h
+#define _GLIBCXX_CDTOR_CALLABI
+#endif
+#include 
+
+#include 
 #include 
 #include 
 #include 
 
-namespace abi_aarch64 {
-
-// Following declarations from libstdc++-v3/libsupc++/unwind-cxx.h and
-// lib/gcc/*-*-*/*/include/unwind.h:
-
-struct _Unwind_Exception
-{
-unsigned exception_class __attribute__((__mode__(__DI__)));
-void * exception_cleanup;
-unsigned private_1 __attribute__((__mode__(__word__)));
-unsigned private_2 __attribute__((__mode__(__word__)));
-} __attribute__((__aligned__));
+#if !HAVE_CXXABI_H_CLASS_TYPE_INFO
+// ,
+// libstdc++-v3/libsupc++/cxxabi.h:
+namespace __cxxabiv1 {
+class __class_type_info: public std::type_info {
+public:
+explicit __class_type_info(char const * n): type_info(n) {}
+~__class_type_info() override;
+};
+}
+#endif
 
-struct __cxa_exception
-{
-std::type_info *exceptionType;
-void (*exceptionDestructor)(void *);
+#if !HAVE_CXXABI_H_SI_CLASS_TYPE_INFO
+// ,
+// libstdc++-v3/libsupc++/cxxabi.h:
+namespace __cxxabiv1 {
+class __si_class_type_info: public __class_type_info {
+public:
+__class_type_info const * __base_type;
+explicit __si_class_type_info(
+char const * n, __class_type_info const *base):
+__class_type_info(n), __base_type(base) {}
+~__si_class_type_info() override;
+};
+}
+#endif
 
+#if !HAVE_CXXABI_H_CXA_EXCEPTION
+// ,
+// libcxxabi/src/cxa_exception.hpp:
+namespace __cxxabiv1 {
+struct __cxa_exception {
+#if defined _LIBCPPABI_VERSION // detect libc++abi
+#if defined __LP64__ || LIBCXXABI_ARM_EHABI
+std::size_t referenceCount;
+#endif
+#endif
+std::type_info * exceptionType;
+void (* exceptionDestructor)(void *);
 void (*unexpectedHandler)(); // std::unexpected_handler dropped from C++17
 std::terminate_handler terminateHandler;
-
-__cxa_exception *nextException;
-
+__cxa_exception * nextException;
 int handlerCount;
-
 int handlerSwitchValue;
-const unsigned char *actionRecord;
-const unsigned char *languageSpecificData;
-void *catchTemp;
-void *adjustedPtr;
-
+char const * actionRecord;
+char const * languageSpecificData;
+void * catchTemp;
+void * adjustedPtr;
 _Unwind_Exception unwindHeader;
 };
+}
+#endif
 
-struct 

[Libreoffice-commits] core.git: bridges/source configure.ac

2019-12-18 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_arm/share.hxx|2 +-
 bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx |2 +-
 configure.ac   |6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 97d736d27435fb26d5609000f77bd79ece08572e
Author: Stephan Bergmann 
AuthorDate: Wed Dec 18 10:59:46 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 18 13:54:27 2019 +0100

Fix typos concerning the __cxa_exception check

...introduced with 069506bcb0ee4005b01c22095ed427b96b553c98 "Use 
config_cxxabi.h
to check for __cxa_eh_globals, __cxa_exception", but which appear to have 
been
harmless as (a) the checked-for __cxxabiv1::__cxa_exceptions never existed 
in
cxxabi.h, and (b) lack of __cxxabiv1::__cxa_exception in cxxabi.h happened 
to
conincide with !HAVE_CXXABI_H_CXA_EH_GLOBALS

Change-Id: I13f8a2b3cf0f03f2bc96cf053d2b571860055978
Reviewed-on: https://gerrit.libreoffice.org/85373
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx 
b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
index ac380969e21b..0faa612d92fd 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
@@ -60,7 +60,7 @@ public:
 }
 #endif
 
-#if !HAVE_CXXABI_H_CXA_EH_GLOBALS
+#if !HAVE_CXXABI_H_CXA_EXCEPTION
 namespace __cxxabiv1 {
 struct __cxa_exception
 {
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
index 864173470476..e8afe35c4f59 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
@@ -101,7 +101,7 @@ public:
 }
 #endif
 
-#if !HAVE_CXXABI_H_CXA_EH_GLOBALS
+#if !HAVE_CXXABI_H_CXA_EXCEPTION
 // ,
 // libcxxabi/src/cxa_exception.hpp:
 namespace __cxxabiv1 {
diff --git a/configure.ac b/configure.ac
index ba5e87ea1641..ad246a64f37a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6312,14 +6312,14 @@ if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
 ], [AC_MSG_RESULT([no])])
 AC_LANG_POP([C++])
 
-AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_exceptions in cxxabi.h])
+AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_exception in cxxabi.h])
 AC_LANG_PUSH([C++])
 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 #include 
 #include 
-std::size_t f() { return sizeof(__cxxabiv1::__cxa_exceptions); }
+std::size_t f() { return sizeof(__cxxabiv1::__cxa_exception); }
 ])], [
-AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTIONS],[1])
+AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTION],[1])
 AC_MSG_RESULT([yes])
 ], [AC_MSG_RESULT([no])])
 AC_LANG_POP([C++])
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bridges/source canvas/source connectivity/source dtrans/source embeddedobj/source embedserv/source extensions/source fpicker/source sal/osl sal/qa sal/rtl sfx2/source s

2019-12-05 Thread Stephan Bergmann (via logerrit)
 bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx   |   19 
+-
 canvas/source/directx/dx_canvas.cxx   |4 ++
 canvas/source/directx/dx_canvasbitmap.cxx |4 ++
 connectivity/source/drivers/ado/Aservices.cxx |2 +
 dtrans/source/win32/clipb/MtaOleClipb.cxx |4 ++
 dtrans/source/win32/dtobj/FmtFilter.cxx   |4 ++
 dtrans/source/win32/ftransl/ftransl.cxx   |3 +
 embeddedobj/source/msole/xdialogcreator.cxx   |4 ++
 embedserv/source/embed/servprov.cxx   |4 ++
 embedserv/source/embed/tracker.cxx|7 
+++
 embedserv/source/inprocserv/dllentry.cxx  |5 ++
 extensions/source/activex/SOActiveX.cxx   |   14 
---
 extensions/source/activex/SOActiveX.h |2 -
 extensions/source/ole/ole2uno.cxx |3 +
 extensions/source/ole/unoobjw.cxx |   16 

 extensions/source/update/check/download.cxx   |2 +
 fpicker/source/win32/VistaFilePickerEventHandler.cxx  |2 +
 fpicker/source/win32/resourceprovider.cxx |4 ++
 sal/osl/w32/file.cxx  |4 ++
 sal/osl/w32/file_dirvol.cxx   |   18 
+++--
 sal/osl/w32/file_error.cxx|4 ++
 sal/osl/w32/nlsupport.cxx |4 ++
 sal/osl/w32/pipe.cxx  |4 ++
 sal/osl/w32/process.cxx   |4 +-
 sal/osl/w32/profile.cxx   |4 +-
 sal/osl/w32/socket.cxx|6 
+++
 sal/osl/w32/thread.cxx|8 

 sal/qa/systools/test_comtools.cxx |4 ++
 sal/rtl/uri.cxx   |1 
 sfx2/source/appl/appdde.cxx   |5 +-
 sfx2/source/appl/shutdowniconw32.cxx  |3 +
 shell/source/backends/wininetbe/wininetbackend.cxx|5 --
 shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx   |4 ++
 shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx   |4 +-
 shell/source/win32/zipfile/zipfile.cxx|6 
+++
 vcl/opengl/win/gdiimpl.cxx|8 

 vcl/win/app/salinst.cxx   |4 ++
 vcl/win/gdi/gdiimpl.cxx   |4 ++
 vcl/win/gdi/salbmp.cxx|4 ++
 vcl/win/gdi/salfont.cxx   |   16 

 vcl/win/gdi/salnativewidgets-luna.cxx |   10 
+++--
 vcl/win/gdi/winlayout.cxx |   10 
+
 vcl/win/window/keynames.cxx   |4 ++
 winaccessibility/source/UAccCOM/MAccessible.cxx   |4 ++
 winaccessibility/source/service/msaaservice_impl.cxx  |4 ++
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |4 ++
 xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx  |4 ++
 xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx|4 ++
 48 files changed, 243 insertions(+), 28 deletions(-)

New commits:
commit 55e596956e56b175ab17b682e7c8ac7daeb9289a
Author: Stephan Bergmann 
AuthorDate: Thu Dec 5 09:55:56 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Dec 5 13:31:39 2019 +0100

loplugin:external (clang-cl)

...plus loplugin:consttobool and loplugin:fakebool fallout

Change-Id: Ie3d8121815c080b13bea6d9deca1eb138ca56138
Reviewed-on: https://gerrit.libreoffice.org/84515
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx 
b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
index e483d47c27b9..c725bca543c8 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -306,6 +306,9 @@ static OUString toRTTIname(
 //RTTI simulation
 
 typedef std::unordered_map< OUString, void * > t_string2PtrMap;
+
+namespace {
+
 class type_info_descriptor;
 
 class RTTInfos
@@ -323,7 +326,7 @@ public:
 class type_info_
 {
   

[Libreoffice-commits] core.git: bridges/source cppuhelper/Library_cppuhelper.mk cppuhelper/source include/ios ios/Module_ios.mk ios/source ios/StaticLibrary_ios.mk

2019-12-05 Thread Jan Holesovsky (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx |4 +
 cppuhelper/Library_cppuhelper.mk  |1 
 cppuhelper/source/exc_thrower.cxx |   57 --
 include/ios/ios.hxx   |   19 --
 ios/Module_ios.mk |1 
 ios/StaticLibrary_ios.mk  |   20 --
 ios/source/ios.cxx|   42 -
 7 files changed, 56 insertions(+), 88 deletions(-)

New commits:
commit eb15ac837e06087fb8148330e9171d6697d89ee6
Author: Jan Holesovsky 
AuthorDate: Fri Nov 29 16:03:27 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Thu Dec 5 11:02:01 2019 +0100

android: Avoid throwing exceptions through the bridges.

From some reason it does not work, so let's do the same we are doing on
iOS; at least for now.

Change-Id: I915f8683a112548fc3defc1114f9dce3aa7be30e
Reviewed-on: https://gerrit.libreoffice.org/84067
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/84204
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
index aaf48deb67ca..d11a11b0c965 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
@@ -457,10 +457,14 @@ unsigned char * 
bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
 void bridges::cpp_uno::shared::VtableFactory::flushCode(
 unsigned char const * begin, unsigned char const * end)
 {
+#ifndef ANDROID
static void (*clear_cache)(unsigned char const *, unsigned char const *)
= (void (*)(unsigned char const *, unsigned char const *)) dlsym(
RTLD_DEFAULT, "__clear_cache");
(*clear_cache)(begin, end);
+#else
+__builtin___clear_cache((char*)begin, (char*)end);
+#endif
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppuhelper/Library_cppuhelper.mk b/cppuhelper/Library_cppuhelper.mk
index 67413f711cd2..5741eea6476f 100644
--- a/cppuhelper/Library_cppuhelper.mk
+++ b/cppuhelper/Library_cppuhelper.mk
@@ -15,6 +15,7 @@ $(eval $(call 
gb_Library_set_soversion_script,cppuhelper,$(SRCDIR)/cppuhelper/so
 $(eval $(call gb_Library_use_internal_comprehensive_api,cppuhelper,\
cppuhelper \
udkapi \
+   offapi \
 ))
 
 $(eval $(call gb_Library_add_defs,cppuhelper,\
diff --git a/cppuhelper/source/exc_thrower.cxx 
b/cppuhelper/source/exc_thrower.cxx
index 5e029feae982..a0e7fb32b046 100644
--- a/cppuhelper/source/exc_thrower.cxx
+++ b/cppuhelper/source/exc_thrower.cxx
@@ -17,21 +17,22 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include 
 
-#ifdef IOS
-#include 
-#endif
-
 using namespace ::osl;
 using namespace ::cppu;
 using namespace ::com::sun::star;
@@ -172,6 +173,46 @@ ExceptionThrower::ExceptionThrower()
 
 class theExceptionThrower : public rtl::Static {};
 
+#if defined(IOS) || HAVE_FEATURE_ANDROID_LOK
+// In the native iOS / Android app, where we don't have any Java, Python,
+// BASIC, or other scripting, the only thing that would use the C++/UNO bridge
+// functionality that invokes codeSnippet() was cppu::throwException().
+//
+// codeSnippet() is part of what corresponds to the code that uses
+// run-time-generated machine code on other platforms. We can't generate code
+// at run-time on iOS, that has been known forever.
+//
+// Instead of digging in and trying to understand what is wrong, another
+// solution was chosen. It turns out that the number of types of exception
+// objects thrown by cppu::throwException() is fairly small. During startup of
+// the LibreOffice code, and loading of an .odt document, only one kind of
+// exception is thrown this way... (The lovely
+// css::ucb:InteractiveAugmentedIOException.)
+//
+// So we can simply have code that checks what the type of object being thrown
+// is, and explicitgly throws such an object then with a normal C++ throw
+// statement. Seems to work.
+template  void tryThrow(css::uno::Any const& aException)
+{
+E aSpecificException;
+if (aException >>= aSpecificException)
+throw aSpecificException;
+}
+
+void lo_mobile_throwException(css::uno::Any const& aException)
+{
+assert(aException.getValueTypeClass() == css::uno::TypeClass_EXCEPTION);
+
+tryThrow(aException);
+tryThrow(aException);
+tryThrow(aException);
+
+SAL_WARN("cppuhelper", "lo_mobile_throwException: Unhandled exception 
type: " << aException.getValueTypeName());
+
+assert(false);
+}
+#endif // defined(IOS) || HAVE_FEATURE_ANDROID_LOK
+
 } // anonymous namespace
 
 
@@ -188,8 +229,8 @@ void SAL_CALL throwException( Any const & exc 

[Libreoffice-commits] core.git: bridges/source

2019-12-02 Thread Jan Holesovsky (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx |2 +-
 bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx |8 
 bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx |8 
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 5313ff56d75e08df4a811ce8b71efd39cfbd8a29
Author: Jan Holesovsky 
AuthorDate: Fri Nov 1 15:18:49 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Mon Dec 2 11:34:25 2019 +0100

bridges arm64: Use [[falltrough]].

Change-Id: I28d3cabab74bea6ea9f2712c240110a44643c54d
Reviewed-on: https://gerrit.libreoffice.org/84193
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index a07365a5943e..938011a09a2e 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -262,7 +262,7 @@ ReturnKind getReturnKind(typelib_TypeDescription const * 
type) {
 switch (type->eTypeClass) {
 default:
 assert(false);
-// fall through to avoid warnings
+[[fallthrough]];
 case typelib_TypeClass_VOID:
 case typelib_TypeClass_BOOLEAN:
 case typelib_TypeClass_BYTE:
diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
index d867a04dd299..aaf48deb67ca 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
@@ -187,13 +187,13 @@ void call(
 switch (rtd->nSize) {
 case 16:
 std::memcpy(fpr + 3, static_cast(retin) + 12, 4);
-// fall through
+[[fallthrough]];
 case 12:
 std::memcpy(fpr + 2, static_cast(retin) + 8, 4);
-// fall through
+[[fallthrough]];
 case 8:
 std::memcpy(fpr + 1, static_cast(retin) + 4, 4);
-// fall through
+[[fallthrough]];
 case 4:
 std::memcpy(fpr, retin, 4);
 break;
@@ -286,7 +286,7 @@ extern "C" void vtableCall(
 TYPELIB_DANGER_RELEASE(td);
 }
 }
-// fall through
+[[fallthrough]];
 default:
 call(
 proxy, desc,
diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx
index 32a19de020b1..f03d848521cc 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx
@@ -252,13 +252,13 @@ void call(
 switch (rtd->nSize) {
 case 16:
 std::memcpy(static_cast(ret) + 12, fpr + 3, 4);
-// fall through
+[[fallthrough]];
 case 12:
 std::memcpy(static_cast(ret) + 8, fpr + 2, 4);
-// fall through
+[[fallthrough]];
 case 8:
 std::memcpy(static_cast(ret) + 4, fpr + 1, 4);
-// fall through
+[[fallthrough]];
 case 4:
 std::memcpy(ret, fpr, 4);
 break;
@@ -356,7 +356,7 @@ void unoInterfaceProxyDispatch(
 TYPELIB_DANGER_RELEASE(td);
 }
 }
-// fall through
+[[fallthrough]];
 default:
 call(
 proxy, slot, mtd->pReturnTypeRef, mtd->nParams,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: bridges/source

2019-11-04 Thread Tomoyuki Kubota (via logerrit)
 bridges/source/cpp_uno/msvc_win32_intel/except.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 523dcbd046f200785c78bc6b23f4c04e38f25f47
Author: Tomoyuki Kubota 
AuthorDate: Mon Nov 4 23:04:06 2019 +0900
Commit: Noel Grandin 
CommitDate: Tue Nov 5 07:25:29 2019 +0100

typeinfo fix for x86

Change-Id: Ic0a9dcb97cfda4155f33d9ad07a96db8960b57a0
Reviewed-on: https://gerrit.libreoffice.org/82023
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx 
b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
index 4f761ef3ed20..360abb038bec 100644
--- a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
@@ -20,7 +20,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: bridges/source compilerplugins/clang cui/source dbaccess/source desktop/source editeng/source framework/source i18npool/source include/rtl sc/source sdext/source sd/sou

2019-10-16 Thread Noel Grandin (via logerrit)
 bridges/source/jni_uno/jni_data.cxx   |   12 -
 compilerplugins/clang/bufferadd.cxx   |   36 
 compilerplugins/clang/test/bufferadd.cxx  |   17 +
 cui/source/customize/CustomNotebookbarGenerator.cxx   |   12 -
 dbaccess/source/ui/app/AppControllerDnD.cxx   |5 
 desktop/source/deployment/manager/dp_activepackages.cxx   |   33 +--
 desktop/source/deployment/registry/component/dp_component.cxx |   15 -
 desktop/source/deployment/registry/dp_backenddb.cxx   |   54 +++---
 desktop/source/splash/splash.cxx  |7 
 editeng/source/items/bulitem.cxx  |5 
 framework/source/jobs/helponstartup.cxx   |9 -
 framework/source/layoutmanager/toolbarlayoutmanager.cxx   |6 
 framework/source/services/desktop.cxx |6 
 i18npool/source/breakiterator/breakiteratorImpl.cxx   |   15 -
 i18npool/source/breakiterator/breakiterator_unicode.cxx   |5 
 include/rtl/stringconcat.hxx  |2 
 sc/source/core/tool/addincol.cxx  |   18 --
 sc/source/core/tool/interpr1.cxx  |4 
 sc/source/core/tool/unitconv.cxx  |5 
 sc/source/filter/excel/xehelper.cxx   |4 
 sc/source/filter/html/htmlexp.cxx |7 
 sc/source/ui/view/viewutil.cxx|6 
 sd/source/ui/unoidl/UnoDocumentSettings.cxx   |4 
 sdext/source/pdfimport/misc/pdfihelper.cxx|5 
 sdext/source/pdfimport/pdfparse/pdfentries.cxx|   34 +--
 sdext/source/pdfimport/sax/emitcontext.cxx|   10 -
 sdext/source/pdfimport/tree/drawtreevisiting.cxx  |5 
 sdext/source/pdfimport/tree/writertreevisiting.cxx|5 
 sfx2/source/appl/appuno.cxx   |6 
 sfx2/source/bastyp/frmhtmlw.cxx   |7 
 sfx2/source/dialog/filedlghelper.cxx  |   18 +-
 sfx2/source/view/classificationhelper.cxx |3 
 stoc/source/security/file_policy.cxx  |7 
 stoc/source/security/permissions.cxx  |7 
 svtools/source/svhtml/htmlout.cxx |5 
 sw/source/filter/html/htmlbas.cxx |   16 -
 sw/source/filter/html/htmlfldw.cxx|   11 -
 sw/source/filter/html/htmlflywriter.cxx   |   10 -
 sw/source/filter/html/htmlftn.cxx |   18 +-
 sw/source/filter/html/htmltabw.cxx|6 
 sw/source/filter/html/wrthtml.cxx |   25 +-
 sw/source/uibase/app/applab.cxx   |   10 -
 tools/source/fsys/urlobj.cxx  |   16 -
 vcl/source/gdi/pdfwriter_impl.cxx |   88 +++---
 vcl/unx/generic/print/printerjob.cxx  |   12 -
 vcl/unx/generic/printer/cpdmgr.cxx|5 
 vcl/unx/generic/printer/cupsmgr.cxx   |   12 -
 vcl/unx/generic/printer/ppdparser.cxx |8 
 vcl/unx/generic/printer/printerinfomanager.cxx|4 
 vcl/unx/generic/window/salframe.cxx   |5 
 vcl/workben/svpclient.cxx |9 -
 vcl/workben/svptest.cxx   |6 
 writerfilter/source/dmapper/TextEffectsHandler.cxx|2 
 xmloff/source/style/xmlnumi.cxx   |   10 -
 54 files changed, 269 insertions(+), 403 deletions(-)

New commits:
commit 4a96fb8ec0130e1036913093836bcf28bc37a49b
Author: Noel Grandin 
AuthorDate: Wed Oct 16 10:13:30 2019 +0200
Commit: Noel Grandin 
CommitDate: Wed Oct 16 12:12:31 2019 +0200

loplugin:bufferadd loosen some constraints

and extend O*StringView to have a constructor that takes a pointer and a
length

Change-Id: I6120e96280f030757e855a6596efdae438b7e1e8
Reviewed-on: https://gerrit.libreoffice.org/80872
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/jni_uno/jni_data.cxx 
b/bridges/source/jni_uno/jni_data.cxx
index feb9674563c5..daff48a48492 100644
--- a/bridges/source/jni_uno/jni_data.cxx
+++ b/bridges/source/jni_uno/jni_data.cxx
@@ -1786,11 +1786,7 @@ void Bridge::map_to_java(
 if (in_param)
 {
 // call static .fromInt( int )
-OStringBuffer sig_buf( 5 + class_name.getLength() );
-sig_buf.append( "(I)L" );
-sig_buf.append( class_name.replace( '.', '/' ) );
-sig_buf.append( ';' );
-

[Libreoffice-commits] core.git: bridges/source compilerplugins/clang connectivity/source cppuhelper/source formula/source include/oox include/svx sc/inc sd/source solenv/CompilerTest_compilerplugins_c

2019-09-19 Thread Noel Grandin (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx   |2 
 compilerplugins/clang/fragiledestructor.cxx |  113 
 compilerplugins/clang/test/fragiledestructor.cxx|   88 +++
 connectivity/source/drivers/evoab2/NConnection.hxx  |2 
 connectivity/source/drivers/evoab2/NResultSet.cxx   |4 
 connectivity/source/drivers/firebird/Connection.hxx |2 
 connectivity/source/inc/file/FConnection.hxx|4 
 connectivity/source/inc/file/FResultSet.hxx |2 
 connectivity/source/inc/odbc/OConnection.hxx|4 
 cppuhelper/source/weak.cxx  |2 
 formula/source/core/api/token.cxx   |2 
 include/oox/helper/binaryinputstream.hxx|2 
 include/oox/helper/binaryoutputstream.hxx   |2 
 include/svx/fmgridif.hxx|4 
 sc/inc/chgtrack.hxx |4 
 sd/source/ui/inc/sdxfer.hxx |2 
 sd/source/ui/slideshow/slideshowimpl.hxx|2 
 solenv/CompilerTest_compilerplugins_clang.mk|1 
 sw/inc/finalthreadmanager.hxx   |2 
 sw/inc/section.hxx  |3 
 ucb/source/ucp/file/filinpstr.hxx   |2 
 ucb/source/ucp/gio/gio_inputstream.hxx  |2 
 ucb/source/ucp/gio/gio_outputstream.hxx |2 
 vcl/inc/unx/gtk/gtkdata.hxx |2 
 vcl/inc/unx/salbmp.h|2 
 vcl/inc/unx/salframe.h  |2 
 vcl/source/app/svdata.cxx   |2 
 vcl/unx/generic/printer/printerinfomanager.cxx  |2 
 vcl/unx/gtk3/gtk3gtkinst.cxx|4 
 vcl/workben/vcldemo.cxx |2 
 30 files changed, 193 insertions(+), 76 deletions(-)

New commits:
commit 82572caae4a282cdf79456b977508ca71507c584
Author: Noel Grandin 
AuthorDate: Wed Sep 18 14:15:59 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 19 11:42:47 2019 +0200

improve and enable loplugin:fragiledestructor

Where the problem was benign and the class was not extended, I marked
the class as final.
Where the problem was benign and the class was extended, I marked the
relevant callee methods as final.

Other cases were excluded in the plugin.

Change-Id: Idb762fb2206af4e8b534aa35ff77f8368c7909bc
Reviewed-on: https://gerrit.libreoffice.org/79089
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
index 350e5df4e6a2..faf45a8b0590 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
@@ -64,7 +64,7 @@ public:
 
 ~GeneratedPad() override { get()->~type_info(); }
 
-std::type_info * get() const override
+std::type_info * get() const override final
 { return reinterpret_cast(pad_.get()); }
 
 private:
diff --git a/compilerplugins/clang/fragiledestructor.cxx 
b/compilerplugins/clang/fragiledestructor.cxx
index 1631cb30c1e9..a1a09a2e6081 100644
--- a/compilerplugins/clang/fragiledestructor.cxx
+++ b/compilerplugins/clang/fragiledestructor.cxx
@@ -6,6 +6,7 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
+#ifndef LO_CLANG_SHARED_PLUGINS
 
 #include 
 #include 
@@ -28,71 +29,99 @@ public:
 explicit FragileDestructor(loplugin::InstantiationData const & data):
 FilteringPlugin(data) {}
 
-virtual void run() override { 
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
+virtual bool preRun() override
+{
+StringRef fn(handler.getMainFileName());
+
+// TODO, these all need fixing
+
+if (loplugin::isSamePathname(fn, SRCDIR 
"/comphelper/source/misc/proxyaggregation.cxx"))
+ return false;
+if (loplugin::isSamePathname(fn, SRCDIR 
"/svx/source/svdraw/svdpntv.cxx")) // ~SdrPaintView calling ClearPageView
+ return false;
+if (loplugin::isSamePathname(fn, SRCDIR 
"/svx/source/svdraw/svdobj.cxx")) // ~SdrObject calling GetLastBoundRect
+ return false;
+if (loplugin::isSamePathname(fn, SRCDIR 
"/svx/source/svdraw/svdedxv.cxx")) // ~SdrObjEditView calling SdrEndTextEdit
+ return false;
+if (loplugin::isSamePathname(fn, SRCDIR 
"/connectivity/source/drivers/file/FStatement.cxx")) // ~OStatement_Base 
calling disposing
+ return false;
+if (loplugin::isSamePathname(fn, SRCDIR 
"/sd/source/core/CustomAnimationEffect.cxx")) // ~EffectSequenceHelper calling 
reset
+ return false;
+if (loplugin::isSamePathname(fn, SRCDIR 
"/sd/source/ui/view/sdview.cxx")) // ~View calling DeleteWindowFromPaintView
+ 

[Libreoffice-commits] core.git: bridges/source compilerplugins/clang slideshow/source writerfilter/source xmlsecurity/source

2019-08-21 Thread Noel Grandin (via logerrit)
 bridges/source/cpp_uno/shared/vtablefactory.cxx   |2 
 compilerplugins/clang/constvars.cxx   |   70 --
 compilerplugins/clang/test/constvars.cxx  |   60 
 slideshow/source/engine/slide/userpaintoverlay.cxx|2 
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx  |4 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |2 
 writerfilter/source/dmapper/PropertyMap.cxx   |6 
 writerfilter/source/dmapper/SdtHelper.cxx |2 
 writerfilter/source/dmapper/StyleSheetTable.cxx   |4 
 writerfilter/source/rtftok/rtfdispatchdestination.cxx |2 
 writerfilter/source/rtftok/rtfdispatchflag.cxx|2 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|   16 +-
 writerfilter/source/rtftok/rtfsdrimport.cxx   |2 
 writerfilter/source/rtftok/rtfsprm.cxx|2 
 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx |2 
 15 files changed, 141 insertions(+), 37 deletions(-)

New commits:
commit 10280dabe2c1c47c3cddbc28fcd701deb618772f
Author: Noel Grandin 
AuthorDate: Tue Aug 13 15:14:06 2019 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 21 11:16:15 2019 +0200

loplugin:constvars, look for loop vars that can be const

Change-Id: I67ee714739800f3718f9d3facf57474cd564d855
Reviewed-on: https://gerrit.libreoffice.org/77415
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx 
b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index 9eb4d690204f..c71ae52ae14e 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -182,7 +182,7 @@ VtableFactory::VtableFactory(): m_arena(
 VtableFactory::~VtableFactory() {
 {
 osl::MutexGuard guard(m_mutex);
-for (auto& rEntry : m_map) {
+for (const auto& rEntry : m_map) {
 for (sal_Int32 j = 0; j < rEntry.second.count; ++j) {
 freeBlock(rEntry.second.blocks[j]);
 }
diff --git a/compilerplugins/clang/constvars.cxx 
b/compilerplugins/clang/constvars.cxx
index 56f863407f0b..d4a431dc14f0 100644
--- a/compilerplugins/clang/constvars.cxx
+++ b/compilerplugins/clang/constvars.cxx
@@ -127,6 +127,7 @@ public:
 bool shouldVisitImplicitCode() const { return true; }
 
 bool VisitVarDecl(const VarDecl*);
+bool VisitCXXForRangeStmt(const CXXForRangeStmt*);
 bool VisitDeclRefExpr(const DeclRefExpr*);
 bool TraverseCXXConstructorDecl(CXXConstructorDecl*);
 bool TraverseCXXMethodDecl(CXXMethodDecl*);
@@ -167,7 +168,7 @@ void ConstVars::run()
 // Implement a marker that disables this plugins warning at a specific 
site
 if (sourceString.contains("loplugin:constvars:ignore"))
 continue;
-report(DiagnosticsEngine::Warning, "static var can be const", 
compat::getBeginLoc(v));
+report(DiagnosticsEngine::Warning, "var can be const", 
compat::getBeginLoc(v));
 }
 }
 
@@ -178,6 +179,8 @@ bool ConstVars::VisitVarDecl(const VarDecl* varDecl)
 return true;
 if (!varDecl->hasGlobalStorage())
 return true;
+if (isa(varDecl))
+return true;
 if (varDecl->getLinkageAndVisibility().getLinkage() == ExternalLinkage)
 return true;
 if (varDecl->getType().isConstQualified())
@@ -192,6 +195,8 @@ bool ConstVars::VisitVarDecl(const VarDecl* varDecl)
 
 if (!varDecl->getInit())
 return true;
+if (varDecl->getInit()->isInstantiationDependent())
+return true;
 if (!varDecl->getInit()->isCXX11ConstantExpr(compiler.getASTContext()))
 return true;
 
@@ -199,6 +204,26 @@ bool ConstVars::VisitVarDecl(const VarDecl* varDecl)
 return true;
 }
 
+bool ConstVars::VisitCXXForRangeStmt(const CXXForRangeStmt* forStmt)
+{
+if (compat::getBeginLoc(forStmt).isValid() && ignoreLocation(forStmt))
+return true;
+const VarDecl* varDecl = forStmt->getLoopVariable();
+if (!varDecl)
+return true;
+// we don't handle structured assignment properly
+if (isa(varDecl))
+return true;
+auto tc = loplugin::TypeCheck(varDecl->getType());
+if (!tc.LvalueReference())
+return true;
+if (tc.LvalueReference().Const())
+return true;
+
+definitionSet.insert(varDecl);
+return true;
+}
+
 bool ConstVars::TraverseCXXConstructorDecl(CXXConstructorDecl* 
cxxConstructorDecl)
 {
 auto copy = insideMoveOrCopyDeclParent;
@@ -276,7 +301,9 @@ void ConstVars::check(const VarDecl* varDecl, const Expr* 
memberExpr)
 const Stmt* child = memberExpr;
 const Stmt* parent
 = parentsRange.begin() == parentsRange.end() ? nullptr : 
parentsRange.begin()->get();
+
 // walk up the tree until we find something interesting
+
 bool bCannotBeConst = false;

[Libreoffice-commits] core.git: bridges/source sc/source svx/uiconfig

2019-08-18 Thread Andrea Gelmini (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx |2 +-
 sc/source/core/opencl/formulagroupcl.cxx  |4 ++--
 svx/uiconfig/ui/sidebarstylespanel.ui |6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 935a2fa0f7ee5dbe6402e0d202a581c05a7b01a2
Author: Andrea Gelmini 
AuthorDate: Sun Aug 18 14:39:29 2019 +0200
Commit: Andrea Gelmini 
CommitDate: Sun Aug 18 17:21:40 2019 +0200

Fix typos

It passed "make check" on Linux

Change-Id: Ibda74a6c5bd50bac7af3b3af1f294817c3e406cc
Reviewed-on: https://gerrit.libreoffice.org/77667
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index 477879f2f2a0..a07365a5943e 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -198,7 +198,7 @@ StructKind getStructKind(typelib_CompoundTypeDescription 
const * type) {
 case STRUCT_KIND_EMPTY:
 // this means an empty sub-object, which nevertheless obtains a 
byte
 // of storage (TODO: does it?), so the full object cannot be a
-// homogenous collection of float or double
+// homogeneous collection of float or double
 case STRUCT_KIND_POD:
 assert(k != STRUCT_KIND_DTOR);
 k = STRUCT_KIND_POD;
diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 27c981758b8a..8948160c4695 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -964,7 +964,7 @@ size_t DynamicKernelStringArgument::Marshal( cl_kernel k, 
int argno, int, cl_pro
 return 1;
 }
 
-/// A mixed string/numberic vector
+/// A mixed string/numeric vector
 class DynamicKernelMixedArgument : public VectorRef
 {
 public:
@@ -1212,7 +1212,7 @@ protected:
 std::shared_ptr mpCodeGen;
 };
 
-/// A mixed string/numberic vector
+/// A mixed string/numeric vector
 class DynamicKernelMixedSlidingArgument : public VectorRef
 {
 public:
diff --git a/svx/uiconfig/ui/sidebarstylespanel.ui 
b/svx/uiconfig/ui/sidebarstylespanel.ui
index afdc241ab750..a4955472f50d 100644
--- a/svx/uiconfig/ui/sidebarstylespanel.ui
+++ b/svx/uiconfig/ui/sidebarstylespanel.ui
@@ -33,7 +33,7 @@
   
   
 True
-True
+True
   
 
   
@@ -67,7 +67,7 @@
   
   
 True
-True
+True
   
 
   
@@ -90,7 +90,7 @@
   
   
 True
-True
+True
   
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: bridges/source

2019-05-31 Thread Juergen Funk (via logerrit)
 bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx |4 ++--
 bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 6d21e8d651ace0704e954bb13bdc8f67c17b1a41
Author: Juergen Funk 
AuthorDate: Mon May 27 12:36:44 2019 +0200
Commit: Michael Stahl 
CommitDate: Fri May 31 11:26:51 2019 +0200

Replace 0 in nullptr

Change-Id: I517a036ccf41c377fee78f841f474b72998bd9ac
Reviewed-on: https://gerrit.libreoffice.org/73028
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx 
b/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx
index 01967af8bf43..a5e0e53580ac 100644
--- a/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx
@@ -55,8 +55,8 @@ static inline typelib_TypeClass cpp2uno_call(
 TYPELIB_DANGER_GET( , pReturnTypeRef );
 }
 
-void * pUnoReturn = 0;
-void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, 
reconversion need
+void * pUnoReturn = nullptr;
+void * pCppReturn = nullptr; // complex return ptr: if != 0 && != 
pUnoReturn, reconversion need
 
 if (pReturnTypeDescr)
 {
diff --git a/bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx 
b/bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx
index d5c89ca78985..f215a92e9078 100644
--- a/bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx
@@ -150,7 +150,7 @@ static void cpp_call(
 TYPELIB_DANGER_GET( , pReturnTypeRef );
 assert(pReturnTypeDescr);
 
-void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
+void * pCppReturn = nullptr; // if != 0 && != pUnoReturn, needs 
reconversion
 
 if (pReturnTypeDescr)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

  1   2   3   >