summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2020-08-17Remove leftover debug includeStephan Bergmann
Change-Id: Idca54798ab5ad464f8a641eb6250cb20aa2147ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100840 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-17loplugin:loopvartoosmallStephan Bergmann
And while at it, merge the change from e2bd5afd726abd5df438b6b821416bd7cf496e4d "Make the C++/UNO bridge work to some extent on macOS on arm64" into the existing code in a better way, reviving the assertion that openMax will be non- negative when entering the loop. Change-Id: I4b4e173a79ae6a0bbbf07df87d46761e86f460c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100841 Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2020-08-13loplugin:stringstatic also look for local staticsNoel Grandin
Add some API to O*StringLiteral, to make it easier to use in some places that were using O*String Change-Id: I1fb93bd47ac2065c9220d509aad3f4320326d99e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100270 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-11loplugin:flattenNoel Grandin
Change-Id: I6560756eb63856a22b43e3e65a7b7843cd2d5376 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100447 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-10Make the C++/UNO bridge work to some extent on macOS on arm64Tor Lillqvist
Use the same code as for Linux on aarch64, with minor additional hacks. But that will not actually work in all cases, as there are slight differences in the ABI. See https://developer.apple.com/library/archive/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html Thus we can drop the use of the lo_mobile_throwException() hack that was very temporarily used. The run-time code generation requires use of a new API on macOS to work: See the use of pthread_jit_write_protect_np() in bridges/source/cpp_uno/shared/vtablefactory.cxx. For some reason, with the Xcode 12 betas, when compiling for arm64-apple-macos, the symbols for the type_infos 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(), but that then fails. So use a gross hack: Introduce separate real variables that point to these typeinfos, and look up and dereference them instead. If this hack ends up needing to be permanent, instead of having a manually edited set of such pointer variables, we should teach codemaker to generate corresponding functions, and look up and invoke them to get the std::type_info pointer. When compiling for x86_64-apple-macos, the type_info symbols end up as "weak external" which is fine. With this, LibreOffice starts and seems to work to some extent, and many unit tests succeed. Change-Id: I05f46a122a51ade1ac7dccd57cb90e594547740e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100408 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-08-04loplugin:elidestringvar (clang-cl)Stephan Bergmann
...plus ensuing loplugin:unnecessaryparen in vcl/source/treelist/transfer.cxx Change-Id: I1abf2e0c589c2c124399c1337f5dd703ee7d04a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100094 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-04Improved loplugin:staticanonymous -> redundantstatic redux, clang-clStephan Bergmann
Change-Id: Ie6dc22edbcfdf05ab8d7d668cb7cc33b5b747995 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100100 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-21Improved oplugin:staticanonymous -> redundantstatic redux, macOSStephan Bergmann
Change-Id: I221351bdc43b48e714acca89bc84db007258299e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99115 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-07Allow making SAL_LOG based output fatalJan-Marek Glogowski
This introduces the [+-]FATAL marker for SAL_LOG. This way you can set part of the matching SAL_LOG string to std::abort on match. The example "SAL_LOG=+FATAL+WARN.vcl.scheduler-FATAL+INFO" will abort for any "+WARN.vcl.scheduler" match, but will just print all additional "+INFO" logs. Change-Id: Ib77f194a78f5165e6c885c82374ae41293815ee9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97651 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-02Upcoming improved loplugin:staticanonymous -> redundantstatic: salStephan Bergmann
Change-Id: I022f5ed37d25f2c8a8870033bab32ff59d4d8da6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97648 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-05Upcoming loplugin:elidestringvar: salStephan Bergmann
Change-Id: Ia277fc825d9687fc70d35bc7db92df5cd5d9b2bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95529 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-04Remove useless Result variableStephan Bergmann
It always had a statically known value ever since 9399c662f36c385b0c705eb34e636a9aec450282 "initial import". The always-true check for Result == osl_cond_result_ok in the SAL_INFO invocation was apparently a glitch introduced with a883b6b13b67898accdc1ffe3fd9e770612352b1 "Improve logging". Change-Id: I83ebb3fb02c8f080d560fdff86a98ee5f6a9c204 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95513 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-29loplugin:simplifybool in oox..sdNoel Grandin
Change-Id: I76cbd5d3e65f0b392d713a51607f5c88dae79593 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95101 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-25createSocketImpl is always called with the same argumentStephan Bergmann
Change-Id: I15d442a36407ebfecefe7adf594bffbf1204443e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94796 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-24Revert "Try to blind-solve cppunittester hangs on Windows"Mike Kaganski
This reverts commit 1126515226b60630b3a0fd72c45258b230dfe8fd. Reason for revert: it only took one run after merging the patch to see it still hangs... Change-Id: I9235004d0568462b112da7f23bc615f3647f4755 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94677 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-24Try to blind-solve cppunittester hangs on WindowsMike Kaganski
... calling OleInitialize early in sal_main to initialize COM and concurrency. Seeing intermittent hangs in main thread in CAPNDataObject::GetData calling m_rIDataObjectOrg->GetData, and the inner stack waiting objects in the code doing apartment switching (I forgot to save a stack to paste unfortunately), I suspect that being related to incorrect concurrency model. OleInitialize docs [1] mention: Applications that use the following functionality must call OleInitialize before calling any other function in the COM library: * Clipboard * Drag and Drop * Object linking and embedding (OLE) * In-place activation ... Because OLE operations are not thread-safe, OleInitialize specifies the concurrency model as single-thread apartment. CoInitializeEx sets COINIT_MULTITHREADED by default, so possibly that might get called somewhere before clipboard/OLE code is called. I hope that this change would fix those hangs. [1] https://docs.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleinitialize Change-Id: I7213c9d6cb4bd0691a3ce355995157797d7db93f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94675 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-10compact namespace in sal..svgioNoel Grandin
Change-Id: I7e70614ea5a1cb1a1dc0ef8e9fb6fd48e85c3562 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93904 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-29Fix problems when running a sandboxed LO as instdir/.../soffice on macOSTor Lillqvist
The argv[0] passed to osl_setCommandArgs will then be the relative path and osl::realpath() will fail. Instead, use bootstrap_getExecutableFile() which calls _NSGetExecutablePath() to get the executable's pathname for g_command_args. Change-Id: I1345afe158d7b64871f6340733fb5490d5ca6bd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93123 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-04-17Just use __builtin_ffs on GCC and ClangStephan Bergmann
GCC appears to support it at least since <https://gcc.gnu.org/git/ ?p=gcc.git;a=commit;h=51e2940139d5e3e86590f6e6802ffc3f3010be5b> "Initial revision" in 1992, and Clang appears to support it since <https://github.com/ llvm/llvm-project/commit/d93abc3bb0acdd430839abdd67bd3920fee87bbc> "Implement ffs, parity, and popcount builtins" in Clang 2.4. (And if a build used a compiler that does not support it, there would be no guarantee that it would support strings.h function ffs from X/Open System Interfaces, either.) Introducing HAVE_GCC_BUILTIN_FFS in 334a9f16cd1d1f9694f885c759903a41aa3d4833 "tdf#113211: fix calculations with big integers" appears to be due to a misguided recommendation at <https://gerrit.libreoffice.org/c/core/+/43477/4# message-899806c724fbdcece0ea9438514a6a5db6a2e645>. Change-Id: Ib6ee6de548172b3aae25483d03efb86620133933 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92421 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-15loplugin:buriedassign in salNoel Grandin
Change-Id: I5a7bc9378ceacb9116c03e3a9fc01c5675c40908 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92243 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-06Nah, let's revert that shiteTor Lillqvist
This reverts commit 533f0094df9a591116b73dca63bc34ddab683bdd. This reverts commit 96ae6bc47414194a477bf95a1f5a360b555884b3. This reverts commit 0050759cb9cf8ac337c0ecec48c009501de9fb0f. This reverts commit 70de006670880df7931fb1c39966d181e2893a61.
2020-04-04Let's put some verbosity in #if 0, thoughTor Lillqvist
Change-Id: I862c6277b4ef8d80bd6352fe27fed96a262cd02e
2020-04-04Show what pathname a fd was opened from in the SAL_INFO("sal.file") callsTor Lillqvist
The pathname is logged in abbreviated form. This, like the two preceding commits, is not claimed to be perfect, MT-safe, etc. It is for debugging output, for SAL_LOG=+INFO.sal.file. If you don't like it, don't use it. Or improve it. Or revert it, I promise not to bother again. Just don't start bike-shedding. Change-Id: Ie8fcea5f5f2373671eebf9ee54d32143e7ed68e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91679 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-04-04Add SAL_INFO with "sal.file" also for the pread, read, pwrite, and write callsTor Lillqvist
Change-Id: Ib8fe62614a87d7350bec195ff22ae5701558d967 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91678 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-04-04Show flags and modes symbolically in the SAL_INFO() for open() and access()Tor Lillqvist
Change-Id: I0d3f7f7216d35bb6f636797894832a4714bcc388 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91677 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-04-02loplugin:flatten in salNoel Grandin
Change-Id: Icc30c79d599486203c8f763cd5ff43059f0bb910 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91556 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-16Avoid stack overflow in testTdf124815 on WindowsMike Kaganski
Regression from commit 2af67c35d283abefe6030a5b90b831b0b797dd62. It happens in row 217, in a recursive calculation of cell values, starting on row 454 down to 0, with 237 repeated patterns on stack: ======================= ucrtbased.dll!__acrt_FlsGetValue(unsigned long fls_index) Line 472 ucrtbased.dll!__crt_state_management::get_current_state_index() Line 101 ucrtbased.dll!__crt_state_management::dual_state_global<long>::value() Line 147 ucrtbased.dll!_query_new_mode() Line 30 ucrtbased.dll!heap_alloc_dbg(const unsigned __int64 size, const int block_use, const char * const file_name, const int line_number) Line 447 ucrtbased.dll!_malloc_dbg(unsigned __int64 size, int block_use, const char * file_name, int line_number) Line 496 ucrtbased.dll!malloc(unsigned __int64 size) Line 27 sclo.dll!operator new(unsigned __int64 size) Line 35 sclo.dll!std::_Default_allocate_traits::_Allocate(const unsigned __int64 _Bytes) Line 52 sclo.dll!std::_Allocate<16,std::_Default_allocate_traits,0>(const unsigned __int64 _Bytes) Line 180 sclo.dll!std::allocator<std::_Container_proxy>::allocate(const unsigned __int64 _Count) Line 785 sclo.dll!std::_Container_base12::_Alloc_proxy<std::allocator<std::_Container_proxy>>(std::allocator<std::_Container_proxy> && _Al) Line 1098 sclo.dll!std::vector<rtl::OUString,std::allocator<rtl::OUString>>::vector<rtl::OUString,std::allocator<rtl::OUString>>() Line 445 sclo.dll!sc::TokenStringContext::TokenStringContext(const ScDocument * pDoc, formula::FormulaGrammar::Grammar eGram) Line 38 sclo.dll!sc::FormulaLogger::GroupScope::Impl::Impl(sc::FormulaLogger & rLogger, const rtl::OUString & rPrefix, const ScDocument & rDoc, const ScFormulaCell & rCell, bool bOutputEnabled) Line 80 sclo.dll!std::make_unique<sc::FormulaLogger::GroupScope::Impl,sc::FormulaLogger &,rtl::OUString const &,ScDocument const &,ScFormulaCell const &,bool &,0>(sc::FormulaLogger & <_Args_0>, const rtl::OUString & <_Args_1>, const ScDocument & <_Args_2>, const ScFormulaCell & <_Args_3>, bool & <_Args_4>) Line 2055 sclo.dll!sc::FormulaLogger::GroupScope::GroupScope(sc::FormulaLogger & rLogger, const rtl::OUString & rPrefix, const ScDocument & rDoc, const ScFormulaCell & rCell, bool bOutputEnabled) Line 127 sclo.dll!sc::FormulaLogger::enterGroup(const ScDocument & rDoc, const ScFormulaCell & rCell) Line 352 sclo.dll!ScFormulaCell::InterpretFormulaGroup(long nStartOffset, long nEndOffset) Line 4573 sclo.dll!ScFormulaCell::Interpret(long nStartOffset, long nEndOffset) Line 1606 sclo.dll!ScFormulaCell::MaybeInterpret() Line 446 sclo.dll!ScFormulaCell::GetErrCode() Line 2956 sclo.dll!ScInterpreter::GetCellValueOrZero(const ScAddress & rPos, ScRefCellValue & rCell) Line 202 sclo.dll!ScInterpreter::GetCellValue(const ScAddress & rPos, ScRefCellValue & rCell) Line 186 sclo.dll!ScInterpreter::GetDouble() Line 2088 sclo.dll!ScInterpreter::CalculateAddSub(bool _bSub) Line 1277 sclo.dll!ScInterpreter::ScAdd() Line 1261 sclo.dll!ScInterpreter::Interpret() Line 4032 sclo.dll!ScFormulaCell::InterpretTail(ScInterpreterContext & rContext, ScFormulaCell::ScInterpretTailParameter eTailParam) Line 1939 sclo.dll!ScFormulaCell::Interpret(long nStartOffset, long nEndOffset) Line 1632 ....................... <SKIP repeated pattern> ....................... sclo.dll!ScFormulaCell::MaybeInterpret() Line 446 sclo.dll!ScFormulaCell::GetErrCode() Line 2956 sclo.dll!ScInterpreter::GetCellValueOrZero(const ScAddress & rPos, ScRefCellValue & rCell) Line 202 sclo.dll!ScInterpreter::GetCellValue(const ScAddress & rPos, ScRefCellValue & rCell) Line 186 sclo.dll!ScInterpreter::GetDouble() Line 2088 sclo.dll!ScInterpreter::CalculateAddSub(bool _bSub) Line 1300 sclo.dll!ScInterpreter::ScAdd() Line 1261 sclo.dll!ScInterpreter::Interpret() Line 4032 sclo.dll!ScFormulaCell::InterpretTail(ScInterpreterContext & rContext, ScFormulaCell::ScInterpretTailParameter eTailParam) Line 1939 sclo.dll!ScFormulaCell::Interpret(long nStartOffset, long nEndOffset) Line 1632 sclo.dll!ScFormulaCell::MaybeInterpret() Line 446 sclo.dll!ScFormulaCell::GetErrCode() Line 2956 sclo.dll!ScInterpreter::GetCellValueOrZero(const ScAddress & rPos, ScRefCellValue & rCell) Line 202 sclo.dll!ScInterpreter::GetCellValue(const ScAddress & rPos, ScRefCellValue & rCell) Line 186 sclo.dll!ScInterpreter::GetDouble() Line 2088 sclo.dll!ScInterpreter::CalculateAddSub(bool _bSub) Line 1300 sclo.dll!ScInterpreter::ScAdd() Line 1261 sclo.dll!ScInterpreter::Interpret() Line 4032 sclo.dll!ScFormulaCell::InterpretTail(ScInterpreterContext & rContext, ScFormulaCell::ScInterpretTailParameter eTailParam) Line 1939 sclo.dll!ScFormulaCell::Interpret(long nStartOffset, long nEndOffset) Line 1632 sclo.dll!ScFormulaCell::MaybeInterpret() Line 446 sclo.dll!ScFormulaCell::GetErrCode() Line 2956 sclo.dll!ScInterpreter::GetCellValueOrZero(const ScAddress & rPos, ScRefCellValue & rCell) Line 202 sclo.dll!ScInterpreter::GetCellValue(const ScAddress & rPos, ScRefCellValue & rCell) Line 186 sclo.dll!ScInterpreter::GetDouble() Line 2088 sclo.dll!ScInterpreter::CalculateAddSub(bool _bSub) Line 1300 sclo.dll!ScInterpreter::ScAdd() Line 1261 sclo.dll!ScInterpreter::Interpret() Line 4032 sclo.dll!ScFormulaCell::InterpretTail(ScInterpreterContext & rContext, ScFormulaCell::ScInterpretTailParameter eTailParam) Line 1939 sclo.dll!ScFormulaCell::Interpret(long nStartOffset, long nEndOffset) Line 1632 sclo.dll!ScFormulaCell::MaybeInterpret() Line 446 sclo.dll!ScFormulaCell::GetErrCode() Line 2956 sclo.dll!ScInterpreter::PushCellResultToken(bool bDisplayEmptyAsString, const ScAddress & rAddress, SvNumFormatType * pRetTypeExpr, unsigned long * pRetIndexExpr, bool bFinalResult) Line 703 sclo.dll!ScInterpreter::CalculateLookup(bool bHLookup) Line 7451 sclo.dll!ScInterpreter::ScVLookup() Line 7519 sclo.dll!ScInterpreter::Interpret() Line 4254 sclo.dll!ScFormulaCell::InterpretTail(ScInterpreterContext & rContext, ScFormulaCell::ScInterpretTailParameter eTailParam) Line 1939 sclo.dll!ScFormulaCell::Interpret(long nStartOffset, long nEndOffset) Line 1632 sclo.dll!ScFormulaCell::MaybeInterpret() Line 446 sclo.dll!ScFormulaCell::IsEmpty() Line 2733 sclo.dll!ScRefCellValue::hasEmptyValue() Line 681 sclo.dll!ScInterpreter::Compare(ScQueryOp eOp) Line 916 sclo.dll!ScInterpreter::ScLess() Line 1214 sclo.dll!ScInterpreter::Interpret() Line 4040 sclo.dll!ScFormulaCell::InterpretTail(ScInterpreterContext & rContext, ScFormulaCell::ScInterpretTailParameter eTailParam) Line 1939 sclo.dll!ScFormulaCell::Interpret(long nStartOffset, long nEndOffset) Line 1632 sclo.dll!ScFormulaCell::MaybeInterpret() Line 446 sclo.dll!ScFormulaCell::IsValue() Line 2745 sclo.dll!`anonymous namespace'::hasNumericImpl(CellType eType, ScFormulaCell * pFormula) Line 155 sclo.dll!ScRefCellValue::hasNumeric() Line 625 sclo.dll!ScInterpreter::FillEntry(ScQueryEntry & rEntry) Line 7484 sclo.dll!ScInterpreter::CalculateLookup(bool bHLookup) Line 7301 sclo.dll!ScInterpreter::ScVLookup() Line 7519 sclo.dll!ScInterpreter::Interpret() Line 4254 sclo.dll!ScFormulaCell::InterpretTail(ScInterpreterContext & rContext, ScFormulaCell::ScInterpretTailParameter eTailParam) Line 1939 sclo.dll!ScFormulaCell::Interpret(long nStartOffset, long nEndOffset) Line 1632 sclo.dll!ScFormulaCell::MaybeInterpret() Line 446 sclo.dll!ScFormulaCell::IsEmpty() Line 2733 sclo.dll!ScRefCellValue::hasEmptyValue() Line 681 sclo.dll!ScInterpreter::Compare(ScQueryOp eOp) Line 916 sclo.dll!ScInterpreter::ScLess() Line 1214 sclo.dll!ScInterpreter::Interpret() Line 4040 sclo.dll!ScFormulaCell::InterpretTail(ScInterpreterContext & rContext, ScFormulaCell::ScInterpretTailParameter eTailParam) Line 1939 sclo.dll!ScFormulaCell::Interpret(long nStartOffset, long nEndOffset) Line 1632 sclo.dll!lcl_InterpretSpan(std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<ScFormulaCell *>>> & rSpanIter, long nStartOffset, long nEndOffset, const boost::intrusive_ptr<ScFormulaCellGroup> & mxParentGroup, bool & bAllowThreading, ScDocument & rDoc) Line 1669 sclo.dll!lcl_EvalDirty(mdds::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52,svl::SharedString>,mdds::mtv::noncopyable_managed_element_block<53,EditTextObject>,mdds::mtv::noncopyable_managed_element_block<54,ScFormulaCell>>,sc::CellStoreEvent> & rCells, long nRow1, long nRow2, ScDocument & rDoc, const boost::intrusive_ptr<ScFormulaCellGroup> & mxGroup, bool bThreadingDepEval, bool bSkipRunning, bool & bIsDirty, bool & bAllowThreading) Line 1779 sclo.dll!ScColumn::HandleRefArrayForParallelism(long nRow1, long nRow2, const boost::intrusive_ptr<ScFormulaCellGroup> & mxGroup) Line 1854 sclo.dll!ScTable::HandleRefArrayForParallelism(short nCol, long nRow1, long nRow2, const boost::intrusive_ptr<ScFormulaCellGroup> & mxGroup) Line 2458 sclo.dll!ScDocument::HandleRefArrayForParallelism(const ScAddress & rPos, long nLength, const boost::intrusive_ptr<ScFormulaCellGroup> & mxGroup) Line 1828 sclo.dll!`anonymous namespace'::ScDependantsCalculator::DoIt() Line 4553 sclo.dll!ScFormulaCell::CheckComputeDependencies(sc::FormulaLogger::GroupScope & rScope, bool fromFirstRow, long nStartOffset, long nEndOffset, bool bCalcDependencyOnly) Line 4683 sclo.dll!ScFormulaCell::InterpretFormulaGroupOpenCL(sc::FormulaLogger::GroupScope & aScope, bool & bDependencyComputed, bool & bDependencyCheckFailed) Line 4988 sclo.dll!ScFormulaCell::InterpretFormulaGroup(long nStartOffset, long nEndOffset) Line 4644 sclo.dll!ScFormulaCell::Interpret(long nStartOffset, long nEndOffset) Line 1606 sclo.dll!ScFormulaCell::MaybeInterpret() Line 446 sclo.dll!ScFormulaCell::IsEmpty() Line 2733 sclo.dll!ScRefCellValue::hasEmptyValue() Line 681 sclo.dll!ScInterpreter::PushCellResultToken(bool bDisplayEmptyAsString, const ScAddress & rAddress, SvNumFormatType * pRetTypeExpr, unsigned long * pRetIndexExpr, bool bFinalResult) Line 692 sclo.dll!ScInterpreter::Interpret() Line 4633 sclo.dll!ScFormulaCell::InterpretTail(ScInterpreterContext & rContext, ScFormulaCell::ScInterpretTailParameter eTailParam) Line 1939 sclo.dll!ScFormulaCell::Interpret(long nStartOffset, long nEndOffset) Line 1632 sclo.dll!`anonymous namespace'::DirtyCellInterpreter::operator()(unsigned __int64 __formal, ScFormulaCell * p) Line 104 sclo.dll!sc::EachElem<mdds::mtv::noncopyable_managed_element_block<54,ScFormulaCell>,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<ScFormulaCell *>>>,mdds::detail::mtv::iterator_value_node<unsigned __int64,mdds::mtv::base_element_block>,`anonymous namespace'::DirtyCellInterpreter>(mdds::detail::mtv::iterator_value_node<unsigned __int64,mdds::mtv::base_element_block> & rNode, unsigned __int64 nOffset, unsigned __int64 nDataSize, `anonymous-namespace'::DirtyCellInterpreter & rFuncElem) Line 110 sclo.dll!sc::ProcessElements1<mdds::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52,svl::SharedString>,mdds::mtv::noncopyable_managed_element_block<53,EditTextObject>,mdds::mtv::noncopyable_managed_element_block<54,ScFormulaCell>>,sc::CellStoreEvent>,mdds::mtv::noncopyable_managed_element_block<54,ScFormulaCell>,`anonymous namespace'::DirtyCellInterpreter,sc::FuncElseNoOp<unsigned __int64,bool>>(const mdds::detail::mtv::iterator_base<mdds::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52,svl::SharedString>,mdds::mtv::noncopyable_managed_element_block<53,EditTextObject>,mdds::mtv::noncopyable_managed_element_block<54,ScFormulaCell>>,sc::CellStoreEvent>::iterator_trait,mdds::detail::mtv::private_data_forward_update<mdds::detail::mtv::iterator_value_node<unsigned __int64,mdds::mtv::base_element_block>>> & itPos, mdds::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52,svl::SharedString>,mdds::mtv::noncopyable_managed_element_block<53,EditTextObject>,mdds::mtv::noncopyable_managed_element_block<54,ScFormulaCell>>,sc::CellStoreEvent> & rStore, unsigned __int64 nStart, unsigned __int64 nEnd, `anonymous-namespace'::DirtyCellInterpreter & rFuncElem, sc::FuncElseNoOp<unsigned __int64,bool> & rFuncElse) Line 354 sclo.dll!sc::ProcessFormula<`anonymous namespace'::DirtyCellInterpreter>(const mdds::detail::mtv::iterator_base<mdds::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52,svl::SharedString>,mdds::mtv::noncopyable_managed_element_block<53,EditTextObject>,mdds::mtv::noncopyable_managed_element_block<54,ScFormulaCell>>,sc::CellStoreEvent>::iterator_trait,mdds::detail::mtv::private_data_forward_update<mdds::detail::mtv::iterator_value_node<unsigned __int64,mdds::mtv::base_element_block>>> & it, mdds::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52,svl::SharedString>,mdds::mtv::noncopyable_managed_element_block<53,EditTextObject>,mdds::mtv::noncopyable_managed_element_block<54,ScFormulaCell>>,sc::CellStoreEvent> & rStore, long nRow1, long nRow2, `anonymous-namespace'::DirtyCellInterpreter & rFuncElem) Line 33 sclo.dll!ScColumn::InterpretDirtyCells(long nRow1, long nRow2) Line 115 sclo.dll!ScTable::InterpretDirtyCells(short nCol1, long nRow1, short nCol2, long nRow2) Line 2504 sclo.dll!ScDocument::InterpretDirtyCells(const ScRangeList & rRanges) Line 3908 sclo.dll!ScMyOLEFixer::CreateChartListener(ScDocument * pDoc, const rtl::OUString & rName, const rtl::OUString & rRangeList) Line 101 sclo.dll!ScMyOLEFixer::FixupOLEs() Line 141 sclo.dll!ScMyTables::FixupOLEs() Line 77 sclo.dll!ScXMLImport::endDocument() Line 1700 expwraplo.dll!sax_fastparser::FastSaxParserImpl::parseStream(const com::sun::star::xml::sax::InputSource & rStructSource) Line 875 expwraplo.dll!sax_fastparser::FastSaxParser::parseStream(const com::sun::star::xml::sax::InputSource & aInputSource) Line 1373 mergedlo.dll!SvXMLImport::parseStream(const com::sun::star::xml::sax::InputSource & aInputSource) Line 488 sclo.dll!ScXMLImportWrapper::ImportFromComponent(const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> & xContext, const com::sun::star::uno::Reference<com::sun::star::frame::XModel> & xModel, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XParser> & xParser, com::sun::star::xml::sax::InputSource & aParserInput, const rtl::OUString & sComponentName, const rtl::OUString & sDocName, const rtl::OUString & sOldDocName, const com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aArgs, bool bMustBeSuccessfull) Line 189 sclo.dll!ScXMLImportWrapper::Import(ImportFlags nMode, ErrCode & rError) Line 513 sclo.dll!ScDocShell::LoadXML(SfxMedium * pLoadMedium, const com::sun::star::uno::Reference<com::sun::star::embed::XStorage> & xStor) Line 481 sclo.dll!ScDocShell::Load(SfxMedium & rMedium) Line 628 mergedlo.dll!SfxObjectShell::LoadOwnFormat(SfxMedium & rMedium) Line 3033 mergedlo.dll!SfxObjectShell::DoLoad(SfxMedium * pMed) Line 674 mergedlo.dll!SfxBaseModel::load(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & seqArguments) Line 1879 mergedlo.dll!`anonymous namespace'::SfxFrameLoader_Impl::load(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & rArgs, const com::sun::star::uno::Reference<com::sun::star::frame::XFrame> & _rTargetFrame) Line 680 mergedlo.dll!framework::LoadEnv::impl_loadContent() Line 1157 mergedlo.dll!framework::LoadEnv::start() Line 395 mergedlo.dll!framework::LoadEnv::startLoading(const rtl::OUString & sURL, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & lMediaDescriptor, const com::sun::star::uno::Reference<com::sun::star::frame::XFrame> & xBaseFrame, const rtl::OUString & sTarget, long nSearchFlags, LoadEnvFeatures eFeature) Line 300 mergedlo.dll!framework::LoadEnv::loadComponentFromURL(const com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> & xLoader, const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> & xContext, const rtl::OUString & sURL, const rtl::OUString & sTarget, long nSearchFlags, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & lArgs) Line 169 mergedlo.dll!framework::Desktop::loadComponentFromURL(const rtl::OUString & sURL, const rtl::OUString & sTargetFrameName, long nSearchFlags, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & lArguments) Line 613 unotest.dll!unotest::MacrosTest::loadFromDesktop(const rtl::OUString & rURL, const rtl::OUString & rDocService, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & rExtraArgs) Line 57 test_sc_uicalc.dll!ScUiCalcTest::createDoc(const char * pName) Line 64 test_sc_uicalc.dll!testTdf124815::TestBody() Line 138 test_sc_uicalc.dll!std::_Invoker_pmf_pointer::_Call<void (__cdecl testTdf124815::*)(void),testTdf124815 * &>(void(testTdf124815::*)() _Pmf, testTdf124815 * & _Arg1) Line 1579 test_sc_uicalc.dll!std::invoke<void (__cdecl testTdf124815::*&)(void),testTdf124815 * &>(void(testTdf124815::*)() & _Obj, testTdf124815 * & <_Args_0>) Line 1579 test_sc_uicalc.dll!std::_Invoker_ret<std::_Unforced,0>::_Call<void (__cdecl testTdf124815::*&)(void),testTdf124815 * &>(void(testTdf124815::*)() & <_Vals_0>, testTdf124815 * & <_Vals_1>) Line 1615 test_sc_uicalc.dll!std::_Call_binder<std::_Unforced,0,void (__cdecl testTdf124815::*)(void),std::tuple<testTdf124815 *>,std::tuple<>>(std::_Invoker_ret<std::_Unforced,0> __formal, std::integer_sequence<unsigned __int64,0> __formal, void(testTdf124815::*)() & _Obj, std::tuple<testTdf124815 *> & _Tpl, std::tuple<> && _Ut) Line 1402 test_sc_uicalc.dll!std::_Binder<std::_Unforced,void (__cdecl testTdf124815::*&)(void),testTdf124815 * &>::operator()<>() Line 1442 test_sc_uicalc.dll!std::_Invoker_functor::_Call<std::_Binder<std::_Unforced,void (__cdecl testTdf124815::*&)(void),testTdf124815 * &> &>(std::_Binder<std::_Unforced,void (__cdecl testTdf124815::*&)(void),testTdf124815 * &> & _Obj) Line 1579 test_sc_uicalc.dll!std::invoke<std::_Binder<std::_Unforced,void (__cdecl testTdf124815::*&)(void),testTdf124815 * &> &>(std::_Binder<std::_Unforced,void (__cdecl testTdf124815::*&)(void),testTdf124815 * &> & _Obj) Line 1579 test_sc_uicalc.dll!std::_Invoker_ret<void,1>::_Call<std::_Binder<std::_Unforced,void (__cdecl testTdf124815::*&)(void),testTdf124815 * &> &>(std::_Binder<std::_Unforced,void (__cdecl testTdf124815::*&)(void),testTdf124815 * &> & <_Vals_0>) Line 1598 test_sc_uicalc.dll!std::_Func_impl_no_alloc<std::_Binder<std::_Unforced,void (__cdecl testTdf124815::*&)(void),testTdf124815 * &>,void>::_Do_call() Line 927 test_sc_uicalc.dll!std::_Func_class<void>::operator()() Line 970 test_sc_uicalc.dll!CppUnit::TestCaller<testTdf124815>::runTest() Line 176 cppunitd_dll.dll!CppUnit::TestCaseMethodFunctor::operator()() Line 33 vclbootstrapprotector.dll!`anonymous namespace'::Protector::protect(const CppUnit::Functor & functor, const CppUnit::ProtectorContext & __formal) Line 46 cppunitd_dll.dll!CppUnit::ProtectorChain::ProtectFunctor::operator()() Line 21 unobootstrapprotector.dll!`anonymous namespace'::Prot::protect(const CppUnit::Functor & functor, const CppUnit::ProtectorContext & __formal) Line 79 cppunitd_dll.dll!CppUnit::ProtectorChain::ProtectFunctor::operator()() Line 21 unoexceptionprotector.dll!`anonymous namespace'::Prot::protect(const CppUnit::Functor & functor, const CppUnit::ProtectorContext & context) Line 61 cppunitd_dll.dll!CppUnit::ProtectorChain::ProtectFunctor::operator()() Line 21 cppunitd_dll.dll!CppUnit::DefaultProtector::protect(const CppUnit::Functor & functor, const CppUnit::ProtectorContext & context) Line 15 cppunitd_dll.dll!CppUnit::ProtectorChain::ProtectFunctor::operator()() Line 21 cppunitd_dll.dll!CppUnit::ProtectorChain::protect(const CppUnit::Functor & functor, const CppUnit::ProtectorContext & context) Line 86 cppunitd_dll.dll!CppUnit::TestResult::protect(const CppUnit::Functor & functor, CppUnit::Test * test, const std::string & shortDescription) Line 182 cppunitd_dll.dll!CppUnit::TestCase::run(CppUnit::TestResult * result) Line 91 cppunitd_dll.dll!CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult * controller) Line 65 cppunitd_dll.dll!CppUnit::TestComposite::run(CppUnit::TestResult * result) Line 24 cppunitd_dll.dll!CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult * controller) Line 65 cppunitd_dll.dll!CppUnit::TestComposite::run(CppUnit::TestResult * result) Line 24 cppunitd_dll.dll!CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult * result) Line 47 cppunitd_dll.dll!CppUnit::TestResult::runTest(CppUnit::Test * test) Line 150 cppunitd_dll.dll!CppUnit::TestRunner::run(CppUnit::TestResult & controller, const std::string & testPath) Line 96 cppunittester.exe!`anonymous namespace'::ProtectedFixtureFunctor::run() Line 316 cppunittester.exe!sal_main() Line 466 cppunittester.exe!main(int argc, char * * argv) Line 373 cppunittester.exe!invoke_main() Line 79 cppunittester.exe!__scrt_common_main_seh() Line 288 cppunittester.exe!__scrt_common_main() Line 331 cppunittester.exe!mainCRTStartup() Line 17 kernel32.dll!BaseThreadInitThunk() ntdll.dll!RtlUserThreadStart() ======================= It doesn't happen on Linux; opening the test file in Calc succeeds on Windows. We set stack size of soffice.bin to 10000 in desktop/Executable_soffice_bin.mk; let's do the same for cppunittester, that had the default stack of 1 M [1], which is obviously too small and does not match existing recursion control values in the code (see ScFormulaCell::Interpret). [1] https://docs.microsoft.com/en-us/windows/win32/procthread/thread-stack-size Change-Id: I30e6abaea120d6ed5bafb798628e7fc26a8dac59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90556 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-14tdf#130975 replace `rtl::math::isNan` with `std::isnan`.Yukio Siraichi
Change-Id: I5d53e6369d35093445b2efd8936bbf8c6775ff47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90451 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-14tdf#130974 replace `rtl::math::isSignBitSet` with `std::signbit`.Yukio Siraichi
Change-Id: I91235eee8c6a9d4a59c1933527b49141f64cd91b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90478 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-12tdf#130976 replace `rtl::math::isInf` with `std::inf`.Yukio Siraichi
Change-Id: Id0f0e07b324230d2d69cbf4ab07b0fff5b24474d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90377 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-12tdf#130977 replace `rtl::math::isFinite` with `std::isfinite`.Yukio Siraichi
- make all calls look like `std::isfinite`. - change the comments referring `rtl::math::isFinite`. Change-Id: I0cde9ceb9f20150467b454cddde5e62003cfde1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90234 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-12Revert "loplugin:constfields in reportdesign,sal,sax"Noel Grandin
This reverts commit d4d37662b090cb237585156a47cd8e1f1cbe2656. Now that we know that making fields has negative side effects like disabling assignment operator generation. Change-Id: Idef4937b89a83d2efbfaf0ab87d059a0143c0164 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90364 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-11Get rid of some SAL_MATH_FINITE useStephan Bergmann
Change-Id: I850efb6215c95d356d42e19e639c578c377d1507 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90316 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-03-04ofz#21036: Avoid UBSan signed-integer-overflow in external/dtoaStephan Bergmann
> workdir/UnpackedTarball/dtoa/src/dtoa.c:3624:12: runtime error: signed integer overflow: 10 * 858993459 cannot be represented in type 'int' > #0 in strtod_nolocale at workdir/UnpackedTarball/dtoa/src/dtoa.c:3624:12 (instdir/program/libuno_sal.so.3 +0x55286d) > #1 in double (anonymous namespace)::stringToDouble<char16_t>(char16_t const*, char16_t const*, char16_t, char16_t, rtl_math_ConversionStatus*, char16_t const**) at sal/rtl/math.cxx:976:20 (instdir/program/libuno_sal.so.3 +0x3b5f0e) > #2 in rtl_math_uStringToDouble at sal/rtl/math.cxx:1028:12 (instdir/program/libuno_sal.so.3 +0x3b1714) [...] Change-Id: If24fca1fb4829ddd763c9920a1af9a90dc2b138c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89966 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-27avoid memory leak in win32 sal::backtrace_get()Luboš Luňák
Running a presentation with OpenGL transitions with Skia+Vulkan as the VCL drawing very quickly runs out of memory in dbgutil builds. The trigger is svl/source/notify/lstner.cxx calling sal::backtrace_get() quite often. And that function calls SymInitialize() repeatedly even though its docs say not to do it, and that is also actually not necessary for CaptureStackBackTrace(), only for the symbol resolving Sym* functions. It actually still eventually aborts if called often enough, but this way it is triggered only by printing the backtrace and not just getting it. I have no idea why the problem is triggered only in these rather specific circumstances, e.g. Skia+raster seems to be fine. Also avoid the needless copy&paste while I'm at it. Change-Id: I50f9e0689b9b9b10bf54308db654aed6433085db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89626 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-02-27Related: tdf#130725: use strtod also in rtl::math::stringToDoubleMike Kaganski
Size of buffer on stack is 256 characters. Logging function usage in make check, of >1 100 000 invocations, the longest string was 80 characters, average being 4.6 characters. So heap allocation is unlikely in scenarios with intensive function usage. Several existing unit tests had to be fixed. Usually, the change is either minimal or getting closer to what Excel returns (for Calc tests). But in case of AMORDEGRC, I had to change rate value passed to the function from 0.3 to 0.31. It's because the closest double value for 0.3 is 0.29999999999999999, which is a bit less than 0.3; multiplied by 1.5, this gives 0.44999999999999996, and then rounding the result of multiplication of the latter by cost gave the result 1 less than before, when 0.3 was imported as 0.30000000000000004. Now the function returns a value 1 less than Excel for that set of arguments. I don't see how to fix that. Having rate slightly different gives consistent result between Calc and Excel. Change-Id: Icae5ce374fe0c31a1aa10cee815e65ef0014f382 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89422 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-12clang-analyzer-deadcode.DeadStoresNoel Grandin
Change-Id: Ifa384933569b27d0d08eb479bb95b799163ae386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88450 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-03loplugin:unsignedcompare (clang-cl)Stephan Bergmann
Change-Id: I69cc1b352221ca053ccd0c5b78e926480a8c9ccd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87884 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-03Remove unnecessary castStephan Bergmann
Change-Id: I675d9e0a87a54eb08abfca114864369b326fb128 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87882 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-01make update_pch also consider files in <module>/src/**/incLuboš Luňák
With --enable-pch=full there's not much difference between a "public" header in <module>/inc and a private one in <module>/src/somewhere/inc . And since the script searches recursively, this apparently helps to find even more headers for lower pch levels. Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-01-31clang-tidy modernize-concat-nested-namespaceNoel Grandin
Change-Id: Iab35a8b85b3ba1df791c774f40b037f9420a071a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-28loplugin:unsignedcompare (--enable-cipher-openssl-backend)Stephan Bergmann
Change-Id: Iab5ab11059437a595596e8ba3ec7aa45cec15f0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87617 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-28tdf#96505: Get rid of cargo cult long integer literalsOnur Yilmaz
I checked return values. Long variables didn't affect the calculation. Change-Id: Ia3713eedf275de71b1096d1fe7e22da012a7f94e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87493 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-28New loplugin:unsignedcompareStephan Bergmann
"Find explicit casts from signed to unsigned integer in comparison against unsigned integer, where the cast is presumably used to avoid warnings about signed vs. unsigned comparisons, and could thus be replaced with o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx) o3tl::make_unsigned requires its argument to be non-negative, and there is a chance that some original code like static_cast<sal_uInt32>(n) >= c used the explicit cast to actually force a (potentially negative) value of sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the cast to avoid a false "signed vs. unsigned comparison" warning in a case where n is known to be non-negative. It appears that restricting this plugin to non- equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=) is a useful heuristic to avoid such false positives. The only remainging false positive I found was 0288c8ffecff4956a52b9147d441979941e8b87f "Rephrase cast from sal_Int32 to sal_uInt32". But which of course does not mean that there were no further false positivies that I missed. So this commit may accidentally introduce some false hits of the assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan --enable-dbgutil) `make check && make screenshot`. It is by design that o3tl::make_unsigned only accepts signed integer parameter types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in include/oox/helper/helper.hxx is used with both signed and unsigned types, so needs a little oox::detail::make_unsigned helper function for now. (The ultimate fix being to get rid of the macro in the first place.) Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-27Use Linux gettid as available since glibc 2.30Stephan Bergmann
Change-Id: I793f91a1fe601cff367be7c178f4e712f0f97117 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87488 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-26tdf#124176: Use pragma once instead of include guardsBurak Bala
Change-Id: Ib2465f040f12413560b2cec1c742cf3558461309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87404 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-01-26cppcheck: shadowFunction in sal/file_urlJulien Nabet
Change-Id: I7454640278f4af0f71f429b45c9f1e40f7be0545 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87433 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2020-01-26cppcheck: shadowFunction in sal/osl_FileJulien Nabet
Change-Id: I7d264faad080428459e499c786f25b3e06a6700b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87434 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-25tdf#124176: Use pragma once instead of include guardsiakarsu
Change-Id: Ibf31d5b97017f875e62b609beef0ecdebd559502 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87391 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-01-25Change some #define to constexprStephan Bergmann
...plus loplugin:unnecessaryparen fallout in sw/source/uibase/docvw/edtwin.cxx. Each of the files contained at least one #define that would have caused warnings with upcoming loplugin:unsignedcompare. For consistency, I changed all #defines in those files (using a variable of a specific type if the original #define used a cast to that type, otherwise using 'auto'). Change-Id: I66f71b2d83394c9dc6952ae19df774cdd4d0b76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87374 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>