From 7b36e8718036377ad5e370151099aa15c3c9a067 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Fri, 1 Jan 2021 10:48:34 +0100 Subject: 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 --- 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(-) (limited to 'bridges') 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 "types.hxx" -#include "vtablefactory.hxx" +#include +#include #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx index 251fbe09857f..367604f3ed11 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx @@ -27,10 +27,11 @@ #include #include -#include "com/sun/star/uno/RuntimeException.hpp" +#include #include #include #include +#include "rtti.hxx" #include "share.hxx" @@ -63,7 +64,7 @@ namespace CPPU_CURRENT_NAMESPACE while ('E' != *p) { // read chars count - long n = (*p++ - '0'); + long n = *p++ - '0'; while ('0' <= *p && '9' >= *p) { n *= 10; @@ -257,18 +258,18 @@ namespace CPPU_CURRENT_NAMESPACE ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp ); // destruct uno exception - ::uno_any_destruct( pUnoExc, 0 ); - // avoiding locked counts - static RTTI rtti_data; - rtti = (type_info*)rtti_data.getRTTI((typelib_CompoundTypeDescription*)pTypeDescr); - TYPELIB_DANGER_RELEASE( pTypeDescr ); - assert(rtti && "### no rtti for throwing exception!"); - if (! rtti) - { - throw RuntimeException( - OUString("no rtti for type ") + - OUString::unacquired( &pUnoExc->pType->pTypeName ) ); - } + ::uno_any_destruct( pUnoExc, 0 ); + // avoiding locked counts + static RTTI rtti_data; + rtti = (type_info*)rtti_data.getRTTI((typelib_CompoundTypeDescription*)pTypeDescr); + TYPELIB_DANGER_RELEASE( pTypeDescr ); + assert(rtti && "### no rtti for throwing exception!"); + if (! rtti) + { + throw RuntimeException( + OUString("no rtti for type ") + + OUString::unacquired( &pUnoExc->pType->pTypeName ) ); + } } __cxa_throw( pCppExc, rtti, deleteException ); diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx index 284d2b6ffbee..040ce60b9251 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #pragma once -#include "sal/config.h" +#include #include #include @@ -29,8 +29,8 @@ #define _GLIBCXX_CDTOR_CALLABI #endif -#include "config_cxxabi.h" -#include "uno/mapping.h" +#include +#include #if !HAVE_CXXABI_H_CLASS_TYPE_INFO // , diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx index b71ab2acbb0b..8a455ad2d072 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx @@ -22,7 +22,7 @@ #include #include -#include "com/sun/star/uno/RuntimeException.hpp" +#include #include #include @@ -187,7 +187,7 @@ void MapReturn(sal_uInt32 r0, sal_uInt32 r1, typelib_TypeDescriptionReference * #if !defined(__ARM_PCS_VFP) && (defined(__ARM_EABI__) || defined(__SOFTFP__)) pRegisterReturn[0] = r0; #else - register float fret asm("s0"); + register float fret asm = "s0"; *(float*)pRegisterReturn = fret; #endif break; @@ -196,7 +196,7 @@ void MapReturn(sal_uInt32 r0, sal_uInt32 r1, typelib_TypeDescriptionReference * pRegisterReturn[1] = r1; pRegisterReturn[0] = r0; #else - register double dret asm("d0"); + register double dret asm= "d0"; *(double*)pRegisterReturn = dret; #endif break; -- cgit