[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - bridges/source

2016-01-27 Thread Stephan Bergmann
 bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit b7937f1caf86cb68ba8d9b04fb4069934a754cf1
Author: Stephan Bergmann 
Date:   Wed Jan 27 08:34:52 2016 +0100

Quickfix for Win 64-bit C++ UNO bridge (more than 20 params)

See 
,
increase the number of supported params to 32 to at least make the
ooo.vba.excel.XApplication.Intersect case (and thus 
CppunitTest_sc_macros_test)
work.  The true fix will be to abandon this simplistic approach, as elegant 
as
it may have appeared.

Change-Id: Ieeb17f682bd5ea8cb7a6188b89978698949461aa
(cherry picked from commit ef99aad5868b308e1a421c3eaa8221f8f78d80d5)
Reviewed-on: https://gerrit.libreoffice.org/21834
Tested-by: Jenkins 
Reviewed-by: David Tardon 

diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx 
b/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx
index ada3623..65ca1ee 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx
@@ -52,7 +52,7 @@ static bool cpp_call(
 void * pUnoArgs[],
 uno_Any ** ppUnoExc ) throw ()
 {
-const int MAXPARAMS = 20;
+const int MAXPARAMS = 32;
 
 if ( nParams > MAXPARAMS )
 {
@@ -206,14 +206,20 @@ static bool cpp_call(
   aCppParams[4].i, aCppParams[5].i, aCppParams[6].i, 
aCppParams[7].i,
   aCppParams[8].i, aCppParams[9].i, aCppParams[10].i, 
aCppParams[11].i,
   aCppParams[12].i, aCppParams[13].i, 
aCppParams[14].i, aCppParams[15].i,
-  aCppParams[16].i, aCppParams[17].i, 
aCppParams[18].i, aCppParams[19].i );
+  aCppParams[16].i, aCppParams[17].i, 
aCppParams[18].i, aCppParams[19].i,
+  aCppParams[20].i, aCppParams[21].i, 
aCppParams[22].i, aCppParams[23].i,
+  aCppParams[24].i, aCppParams[25].i, 
aCppParams[26].i, aCppParams[27].i,
+  aCppParams[28].i, aCppParams[29].i, 
aCppParams[30].i, aCppParams[31].i );
 else
 uRetVal.i =
 pIMethod (aCppParams[0].i, aCppParams[1].d, aCppParams[2].d, 
aCppParams[3].d,
   aCppParams[4].i, aCppParams[5].i, aCppParams[6].i, 
aCppParams[7].i,
   aCppParams[8].i, aCppParams[9].i, aCppParams[10].i, 
aCppParams[11].i,
   aCppParams[12].i, aCppParams[13].i, 
aCppParams[14].i, aCppParams[15].i,
-  aCppParams[16].i, aCppParams[17].i, 
aCppParams[18].i, aCppParams[19].i );
+  aCppParams[16].i, aCppParams[17].i, 
aCppParams[18].i, aCppParams[19].i,
+  aCppParams[20].i, aCppParams[21].i, 
aCppParams[22].i, aCppParams[23].i,
+  aCppParams[24].i, aCppParams[25].i, 
aCppParams[26].i, aCppParams[27].i,
+  aCppParams[28].i, aCppParams[29].i, 
aCppParams[30].i, aCppParams[31].i );
 }
 __except (CPPU_CURRENT_NAMESPACE::mscx_filterCppException(
   GetExceptionInformation(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - bridges/source

2015-12-16 Thread Stephan Bergmann
 bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx |   44 ---
 1 file changed, 30 insertions(+), 14 deletions(-)

New commits:
commit 80acb57d5c60abd3a07b2674d1c30f926d311513
Author: Stephan Bergmann 
Date:   Tue Dec 15 16:52:19 2015 +0100

tdf#95903: Fix return value handling in msvc_win32_x86-64 bridge

...where a return value was double-deleted if it was "complex" (i.e., 
generated
by callee into caller-provided memory) but not related to UNO interface 
types
(so doesn't need any mapping, like sequence returned by
css.beans.XPropertySetInfo.getProperties).

Change-Id: I4cfc16ba63022686afd016ef5b64419e8dee53a4
(cherry picked from commit 27f5679c84602713e74c947d88e72cfafc02fbc8)
Reviewed-on: https://gerrit.libreoffice.org/20723
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx 
b/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx
index 35ca9eb..ada3623 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+
+#include 
 
 #include 
 
@@ -77,16 +80,21 @@ static bool cpp_call(
 void * pAdjustedThisPtr = (void **)( pThis->getCppI() ) + 
aVtableSlot.offset;
 aCppParams[nCppParamIndex++].p = pAdjustedThisPtr;
 
-bool bSimpleReturn = true;
-if ( pReturnTD )
-{
-if ( !bridges::cpp_uno::shared::isSimpleType( pReturnTD ) )
+enum class ReturnKind { Void, Simple, Complex, ComplexConvert };
+ReturnKind retKind;
+if (pUnoReturn == nullptr) {
+retKind = ReturnKind::Void;
+} else {
+assert(pReturnTD != nullptr);
+if (bridges::cpp_uno::shared::isSimpleType(pReturnTD)) {
+retKind = ReturnKind::Simple;
+} else if (bridges::cpp_uno::shared::relatesToInterfaceType(pReturnTD))
 {
-// Complex return via ptr
-bSimpleReturn = false;
-aCppParams[nCppParamIndex++].p =
-bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTD )?
- alloca( pReturnTD->nSize ) : pUnoReturn;
+retKind = ReturnKind::ComplexConvert;
+aCppParams[nCppParamIndex++].p = alloca(pReturnTD->nSize);
+} else {
+retKind = ReturnKind::Complex;
+aCppParams[nCppParamIndex++].p = pUnoReturn;
 }
 }
 
@@ -267,16 +275,24 @@ static bool cpp_call(
 }
 
 // Return value
-if ( !bSimpleReturn )
-{
+switch (retKind) {
+case ReturnKind::Void:
+break;
+case ReturnKind::Simple:
+*(sal_Int64*)pUnoReturn = uRetVal.i;
+break;
+case ReturnKind::Complex:
+assert(uRetVal.p == pUnoReturn);
+break;
+case ReturnKind::ComplexConvert:
+assert(uRetVal.p == aCppParams[1].p);
 ::uno_copyAndConvertData(
 pUnoReturn, uRetVal.p, pReturnTD,
 pThis->getBridge()->getCpp2Uno() );
 ::uno_destructData(
-aCppParams[1].p, pReturnTD, cpp_release );
+uRetVal.p, pReturnTD, cpp_release );
+break;
 }
-else if ( pUnoReturn )
-*(sal_Int64*)pUnoReturn = uRetVal.i;
 
 if ( pReturnTD )
 TYPELIB_DANGER_RELEASE( pReturnTD );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - bridges/source

2015-09-13 Thread Julien Nabet
 bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 313037a7ed10e979a3af8ffac801dd6b6bdb7615
Author: Julien Nabet 
Date:   Sun Sep 13 09:42:01 2015 +0200

cppcheck: Mismatching allocation and deallocation

+ Typo: excecptionTypeSizeArray->exceptionTypeSizeArray

Cherry-picked from 81d62c5f48f3bf341c4c7bdaef5a5ce5941f3e62

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

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 f95a045..321a168 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -609,8 +609,8 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw ()
 
 // 2.Pass: Get the total needed memory for class ExceptionType
 // (with embedded type_info) and keep the sizes for each instance
-// is stored in alloced int array
-int *excecptionTypeSizeArray = new int[nLen];
+// is stored in allocated int array
+int *exceptionTypeSizeArray = new int[nLen];
 
 nLen = 0;
 for (pCompTD = (typelib_CompoundTypeDescription*)pTD;
@@ -625,14 +625,14 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw 
()
 n++;
 typeInfoLen = n*4;
 }
-excecptionTypeSizeArray[nLen++] = typeInfoLen + sizeof(ExceptionType);
+exceptionTypeSizeArray[nLen++] = typeInfoLen + sizeof(ExceptionType);
 }
 
 // Total ExceptionType related mem
 int excTypeAddLen = 0;
 for (int i = 0; i < nLen; i++)
 {
-excTypeAddLen += excecptionTypeSizeArray[i];
+excTypeAddLen += exceptionTypeSizeArray[i];
 }
 
 // Allocate mem for code and all dynamic data in one chunk to guarantee
@@ -684,7 +684,7 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw ()
 // Next trampoline entry offset
 pCodeOffset += codeSnippetSize;
 // Next ExceptionType placement offset
-etMemOffset += excecptionTypeSizeArray[nPos - 1];
+etMemOffset += exceptionTypeSizeArray[nPos - 1];
 
 // Keep offset of addresses of ET for D-Tor call in ~RaiseInfo
 types[nPos++]
@@ -694,7 +694,7 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw ()
 assert(etMem + etMemOffset == pCode + totalSize);
 
 // remove array
-delete excecptionTypeSizeArray;
+delete[] exceptionTypeSizeArray;
 }
 
 RaiseInfo::~RaiseInfo() throw ()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - bridges/source testtools/com testtools/source

2015-07-13 Thread Caolan McNamara
 bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx |6 ++
 bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx |   16 ++--
 testtools/com/sun/star/comp/bridge/TestComponent.java   |4 
 testtools/source/bridgetest/bridgetest.cxx  |4 
 testtools/source/bridgetest/cli/cli_cs_testobj.cs   |5 +
 testtools/source/bridgetest/cppobj.cxx  |2 ++
 testtools/source/bridgetest/idl/bridgetest.idl  |6 ++
 7 files changed, 37 insertions(+), 6 deletions(-)

New commits:
commit f31326f623b0be2392b3846f710df75ea8760446
Author: Caolan McNamara caol...@redhat.com
Date:   Fri Jul 10 16:36:41 2015 +0100

ppc64: using a fp register also consumes a gp register slot

Change-Id: Idf6f40081f4598c0fa9d1e10bdc208eae49e4cd1
Reviewed-on: https://gerrit.libreoffice.org/16936
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
(cherry picked from commit e8ac3b5bd973054c6fd74db017bb448721e2c3e2)
Reviewed-on: https://gerrit.libreoffice.org/16946
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx
index 6b58246..6ac003b 100644
--- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx
@@ -133,6 +133,12 @@ static typelib_TypeClass cpp2uno_call(
 }
 pCppArgs[nPos] = pUnoArgs[nPos] = fpreg++;
 nf++;
+
+if (ng  ppc64::MAX_GPR_REGS)
+{
+ng++;
+gpreg++;
+}
 }
 else
 {
diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
index 81d3d5c..28dfaf8 100644
--- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
@@ -229,16 +229,20 @@ static void callVirtualMethod(void * pThis, sal_uInt32 
nVtableIndex,
 
 // The value in %xmm register is already prepared to be retrieved as a float,
 // thus we treat float and double the same
-#define INSERT_FLOAT( pSV, nr, pFPR, pDS, bOverflow ) \
-if ( nr  ppc64::MAX_SSE_REGS ) \
+#define INSERT_FLOAT( pSV, nr, pFPR, nGPR, pDS, bOverflow ) \
+if ( nGPR  ppc64::MAX_GPR_REGS ) \
+++nGPR;   \
+if ( nr  ppc64::MAX_SSE_REGS )   \
 pFPR[nr++] = *reinterpret_castfloat *( pSV ); \
 else \
 bOverflow = true; \
 if (bOverflow) \
 *pDS++ = *reinterpret_castsal_uInt64 *( pSV ); // verbatim!
 
-#define INSERT_DOUBLE( pSV, nr, pFPR, pDS, bOverflow ) \
-if ( nr  ppc64::MAX_SSE_REGS ) \
+#define INSERT_DOUBLE( pSV, nr, pFPR, nGPR, pDS, bOverflow ) \
+if ( nGPR  ppc64::MAX_GPR_REGS ) \
+++nGPR;   \
+if ( nr  ppc64::MAX_SSE_REGS )   \
 pFPR[nr++] = *reinterpret_castdouble *( pSV ); \
 else \
 bOverflow = true; \
@@ -390,10 +394,10 @@ static void cpp_call(
 INSERT_INT8( pCppArgs[nPos], nGPR, pGPR, 
pStack, bOverflow );
 break;
 case typelib_TypeClass_FLOAT:
-INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, 
pStack, bOverflow );
+INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, 
nGPR, pStack, bOverflow );
 break;
 case typelib_TypeClass_DOUBLE:
-INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, 
pStack, bOverflow );
+INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, 
nGPR, pStack, bOverflow );
 break;
 default:
 break;
diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java 
b/testtools/com/sun/star/comp/bridge/TestComponent.java
index bf1524d..8e07d1a 100644
--- a/testtools/com/sun/star/comp/bridge/TestComponent.java
+++ b/testtools/com/sun/star/comp/bridge/TestComponent.java
@@ -498,6 +498,10 @@ public class TestComponent {
 return i2;
 }
 
+public int testPPC64Alignment( double d1, double d2, double d3, int i1 
) throws com.sun.star.uno.RuntimeException {
+return i1;
+}
+
 public double testTenDoubles( double d1, double d2, double d3, double 
d4, double d5, double d6, double d7, double d8, double d9, double d10 ) {
 return d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10;
 }
diff --git 

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - bridges/source

2015-07-13 Thread Caolan McNamara
 bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx |   61 ++--
 1 file changed, 24 insertions(+), 37 deletions(-)

New commits:
commit 3059edbc419e79f964a340b5b0ac828a5e86
Author: Caolan McNamara caol...@redhat.com
Date:   Fri Jul 10 16:00:22 2015 +0100

ppc64: simplify this a little

Change-Id: I8166f65625d389a604750852d6d5a4fee25a88fa
Reviewed-on: https://gerrit.libreoffice.org/16935
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
(cherry picked from commit fe14c55f000b9a31d885b411655232e0691e1cd4)
Reviewed-on: https://gerrit.libreoffice.org/16945
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
index 4013076..81d3d5c 100644
--- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
@@ -124,6 +124,8 @@ void MapReturn(long r3, long r4, double dret, 
typelib_TypeDescriptionReference*
 if (pReturnType-pType-nSize  8)
 pRegisters[1] = r4;
 }
+#else
+(void)r4;
 #endif
 default:
 break;
@@ -185,45 +187,29 @@ static void callVirtualMethod(void * pThis, sal_uInt32 
nVtableIndex,
 
 //  fill registers
 __asm__ __volatile__ (
-ld   3,  0(%0)\n\t
-ld   4,  8(%0)\n\t
-ld   5, 16(%0)\n\t
-ld   6, 24(%0)\n\t
-ld   7, 32(%0)\n\t
-ld   8, 40(%0)\n\t
-ld   9, 48(%0)\n\t
-ld  10, 56(%0)\n\t
-lfd  1,  0(%1)\n\t
-lfd  2,  8(%1)\n\t
-lfd  3, 16(%1)\n\t
-lfd  4, 24(%1)\n\t
-lfd  5, 32(%1)\n\t
-lfd  6, 40(%1)\n\t
-lfd  7, 48(%1)\n\t
-lfd  8, 56(%1)\n\t
-lfd  9, 64(%1)\n\t
-lfd 10, 72(%1)\n\t
-lfd 11, 80(%1)\n\t
-lfd 12, 88(%1)\n\t
-lfd 13, 96(%1)\n\t
-: : r (pGPR), r (pFPR)
-  : r0, r3, r4, r5, r6, r7, r8, r9, r10,
-  fr1, fr2, fr3, fr4, fr5, fr6, fr7, fr8, 
fr9,
-  fr10, fr11, fr12, fr13
+lfd  1,  0(%0)\n\t
+lfd  2,  8(%0)\n\t
+lfd  3, 16(%0)\n\t
+lfd  4, 24(%0)\n\t
+lfd  5, 32(%0)\n\t
+lfd  6, 40(%0)\n\t
+lfd  7, 48(%0)\n\t
+lfd  8, 56(%0)\n\t
+lfd  9, 64(%0)\n\t
+lfd 10, 72(%0)\n\t
+lfd 11, 80(%0)\n\t
+lfd 12, 88(%0)\n\t
+lfd 13, 96(%0)\n\t
+: : r (pFPR)
+  : fr1, fr2, fr3, fr4, fr5, fr6, fr7, fr8, fr9,
+fr10, fr11, fr12, fr13
 );
 
 // tell gcc that r3 to r11 are not available to it for doing the TOC and 
exception munge on the func call
 register sal_uInt64 r3 asm(r3);
 register sal_uInt64 r4 asm(r4);
-register sal_uInt64 r5 asm(r5);
-register sal_uInt64 r6 asm(r6);
-register sal_uInt64 r7 asm(r7);
-register sal_uInt64 r8 asm(r8);
-register sal_uInt64 r9 asm(r9);
-register sal_uInt64 r10 asm(r10);
-register sal_uInt64 r11 asm(r11);
 
-(*pFunc)(r3, r4, r5, r6, r7, r8, r9, r10);
+(*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3], pGPR[4], pGPR[5], pGPR[6], 
pGPR[7]);
 
 // get return value
 __asm__ __volatile__ (
@@ -375,7 +361,6 @@ static void cpp_call(
 
 if (!rParam.bOut  bridges::cpp_uno::shared::isSimpleType( 
pParamTypeDescr ))
 {
-//  uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), 
pUnoArgs[nPos], pParamTypeDescr,
 uno_copyAndConvertData( pCppArgs[nPos] = pStack, pUnoArgs[nPos], 
pParamTypeDescr,
 pThis-getBridge()-getUno2Cpp() );
 switch (pParamTypeDescr-eTypeClass)
@@ -383,7 +368,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 %lx\n, 
pCppArgs[nPos]);
 #endif
 INSERT_INT64( pCppArgs[nPos], nGPR, pGPR, 
pStack, bOverflow );
 break;
@@ -391,7 +376,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 %x\n, 
pCppArgs[nPos]);
 #endif
 INSERT_INT32( 

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - bridges/source

2015-06-22 Thread Stephan Bergmann
 bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit aa6670764b49a37a82641ae8d9fe77683b820190
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Jun 22 16:47:39 2015 +0200

MSVC 64-bit: In queryInterface optimization, copy hidden ret val addr

...to location where privateSnippetExecutor will pick it up to return it 
from
RAX.

Change-Id: I59b8db1a12177a3c4da4c810770bee4ace295115
(cherry picked from commit 04834f4ad1682e7853536ffcdd9b19a9848c4c70)

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 d7f534d..4f1905c 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx
@@ -332,6 +332,7 @@ extern C typelib_TypeClass cpp_vtable_call(
 pInterface-release();
 TYPELIB_DANGER_RELEASE( pTD );
 
+pStack[0] = pStack[3];
 eRet = typelib_TypeClass_ANY;
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - bridges/source

2015-06-15 Thread Stephan Bergmann
 bridges/source/jni_uno/jni_data.cxx |   57 
 1 file changed, 32 insertions(+), 25 deletions(-)

New commits:
commit 49ce7b855c0ec21f038eb96bc44dcbb20ed336f7
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Jun 15 16:58:21 2015 +0200

Work around change in JNI func sigs between Java 6 and 7

Change-Id: I8f6a988ef8bd3642fe6997170dfb50935e6bf3b6
(cherry picked from commit dfba745437324b8e1a352ab5280c665c543fc37f)

diff --git a/bridges/source/jni_uno/jni_data.cxx 
b/bridges/source/jni_uno/jni_data.cxx
index d1f36ed..3e3ed84 100644
--- a/bridges/source/jni_uno/jni_data.cxx
+++ b/bridges/source/jni_uno/jni_data.cxx
@@ -1160,6 +1160,13 @@ void Bridge::map_to_java(
 bool in_param, bool out_param,
 bool special_wrapped_integral_types ) const
 {
+// 4th param of Set*ArrayRegion changed from pointer to non-const to 
pointer
+// to const between http://docs.oracle.com/javase/6/docs/technotes/guides/
+// jni/spec/functions.html#wp22933 and http://docs.oracle.com/javase/7/
+// docs/technotes/guides/jni/spec/functions.html#wp22933; work around that
+// difference in a way that doesn't trigger loplugin:redundantcast:
+void * data = const_castvoid *(uno_data);
+
 switch (type-eTypeClass)
 {
 case typelib_TypeClass_CHAR:
@@ -1172,7 +1179,7 @@ void Bridge::map_to_java(
 if (in_param)
 {
 jni-SetCharArrayRegion(
-static_castjcharArray(jo_ar.get()), 0, 1, 
static_castjchar const *(uno_data) );
+static_castjcharArray(jo_ar.get()), 0, 1, 
static_castjchar *(data) );
 jni.ensure_no_exception();
 }
 java_data-l = jo_ar.release();
@@ -1182,7 +1189,7 @@ void Bridge::map_to_java(
 if (in_param)
 {
 jni-SetCharArrayRegion(
-static_castjcharArray(java_data-l), 0, 1, 
static_castjchar const *(uno_data) );
+static_castjcharArray(java_data-l), 0, 1, 
static_castjchar *(data) );
 jni.ensure_no_exception();
 }
 }
@@ -1212,7 +1219,7 @@ void Bridge::map_to_java(
 {
 jni-SetBooleanArrayRegion(
 static_castjbooleanArray(jo_ar.get()),
-0, 1, static_castjboolean const *(uno_data) );
+0, 1, static_castjboolean *(data) );
 jni.ensure_no_exception();
 }
 java_data-l = jo_ar.release();
@@ -1223,7 +1230,7 @@ void Bridge::map_to_java(
 {
 jni-SetBooleanArrayRegion(
 static_castjbooleanArray(java_data-l),
-0, 1, static_castjboolean const *(uno_data) );
+0, 1, static_castjboolean *(data) );
 jni.ensure_no_exception();
 }
 }
@@ -1252,7 +1259,7 @@ void Bridge::map_to_java(
 if (in_param)
 {
 jni-SetByteArrayRegion(
-static_castjbyteArray(jo_ar.get()), 0, 1, 
static_castjbyte const *(uno_data) );
+static_castjbyteArray(jo_ar.get()), 0, 1, 
static_castjbyte *(data) );
 jni.ensure_no_exception();
 }
 java_data-l = jo_ar.release();
@@ -1262,7 +1269,7 @@ void Bridge::map_to_java(
 if (in_param)
 {
 jni-SetByteArrayRegion(
-static_castjbyteArray(java_data-l), 0, 1, 
static_castjbyte const *(uno_data) );
+static_castjbyteArray(java_data-l), 0, 1, 
static_castjbyte *(data) );
 jni.ensure_no_exception();
 }
 }
@@ -1292,7 +1299,7 @@ void Bridge::map_to_java(
 if (in_param)
 {
 jni-SetShortArrayRegion(
-static_castjshortArray(jo_ar.get()), 0, 1, 
static_castjshort const *(uno_data) );
+static_castjshortArray(jo_ar.get()), 0, 1, 
static_castjshort *(data) );
 jni.ensure_no_exception();
 }
 java_data-l = jo_ar.release();
@@ -1302,7 +1309,7 @@ void Bridge::map_to_java(
 if (in_param)
 {
 jni-SetShortArrayRegion(
-static_castjshortArray(java_data-l), 0, 1, 
static_castjshort const *(uno_data) );
+static_castjshortArray(java_data-l), 0, 1, 
static_castjshort *(data) );
 jni.ensure_no_exception();
 }
 }
@@ -1332,7 +1339,7 @@ void Bridge::map_to_java(
 if (in_param)
 {
 jni-SetIntArrayRegion(
-