summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)AuthorFilesLines
2018-01-17sal: use snprintf for sal logThorsten Behrens1-5/+7
Change-Id: I0fe7029991052a59ee56cef1897cf6688bfa24b9 Reviewed-on: https://gerrit.libreoffice.org/48083 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-17WNT: allow to set log level/path from fileSamuel Mehrbrodt1-14/+76
Expects a file logging.ini in the program/ directory with the keys LogFilePath and LogLevel, e.g.: LogFilePath=C:\log.txt LogLevel=info Note: This is Windows-only for now. En passant remove extraneous newlines from syslog and android log calls. Change-Id: I35c730469e4079139da908aa287b989dc98e0f9d
2018-01-17tdf#114939: Verify rtl_digest_SHA1 computes broken results, by designStephan Bergmann1-24/+11
This replaces the known-failing test from 8d2da0b94ac5d679ef697683cacb2c83498cc497 "sal: Add rtl_digest_SHA1 which shows wrong sha1 calculation" with the known-succeeding one (though producing wrong results) from tdf#114939 "rtl_digest SHA1 and MD5 code both have an off by 1 bug". Change-Id: Ib4e8210e1889e5ebf4979d7b1f28f1cfb13ebab9 Reviewed-on: https://gerrit.libreoffice.org/48033 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-17tdf#114939 sal: document the bug in endSHA()Michael Stahl1-0/+2
Change-Id: I58df3705c1e07737747b6f8e3ce91d5278018cbb
2018-01-17Missing includes (Windows --disable-pch)Stephan Bergmann1-0/+1
Change-Id: I5cd3297cff31b88c53cd04232bed40cbf04fa2f6 Reviewed-on: https://gerrit.libreoffice.org/48028 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-16sal: try to fix Android build, no std::roundMichael Stahl1-0/+1
Change-Id: I58bc7c9099cd2a3a90f92efbd179d0f3abce02a6
2018-01-16tdf#114939 sal: fix endMD5() off-by-oneMichael Stahl2-1/+93
Because of the odd non-standard rtl_digest_rawMD5() API that is apparently necessary for MS Office interop, and there not being any good reason for bug-compatibility here, just fix the bug. Change-Id: Iaa0f0af4e24a5ddb9113c1ebd126f9822b5af1f6
2018-01-16tdf#96821 fix corner cases for Calc function ROUND.Winfried Donkers1-0/+3
For very large integer numbers, e.g. 2^52+1, ROUND produced incorrect results because rtl::math::round uses floor( number + 0.5 + small_correction_value ), which reduces the maximum possible mantissa resolution.a Correction of several unit test documents (Calc functions) with rounding errors that only became apparent with this fix. Change-Id: I1769c9939a3d6118d3bfbfdf8e41dd4619997232 Reviewed-on: https://gerrit.libreoffice.org/47179 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2018-01-16Missing includeStephan Bergmann1-0/+4
Change-Id: I3bcc4ff11e37afe29b847ff65f722c7b0ba2c0b0 Reviewed-on: https://gerrit.libreoffice.org/47929 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-15More loplugin:cstylecast: salStephan Bergmann1-4/+4
Change-Id: I1ca982dc8c35c7a2762572d7bb47066ead8e6c89
2018-01-15fix android buildNoel Grandin1-1/+1
Change-Id: Id53f9d2a5adf126db9abeab620bb92b8720425f7
2018-01-15convert a<b?a:b to std::min(a,b)Noel Grandin8-8/+10
with something like git grep -nP '(.*)\s*<\s*(.*)\s*\?\s*\g1\s*:\s*\g2' -- *.?xx Change-Id: Id5078b35961847feb78a66204fdb7598ee63fd23 Note: we also convert a>b?b:a Reviewed-on: https://gerrit.libreoffice.org/47736 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-13sal: remove no longer needed CheckTokenMembership_StubChris Sherlock1-33/+8
CheckTokenMembership_Stub was added in commit ce20f0702 because there was a problem with patching/replacing UWINAPI on Windows ME. To resolve this, CheckTokenMembership was not exported to stay compatible which is no longer an issue. Change-Id: I654a5f5ececa918f844eca541942b9d552fcfa7f Reviewed-on: https://gerrit.libreoffice.org/47217 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-12More loplugin:cstylecast: salStephan Bergmann43-363/+359
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I7d89b011464ba5d2dd12e04d5fc9f65cb4daebde
2018-01-11convert (a>b?a:b) to std::max(a,b)Noel Grandin2-2/+2
with something like: git grep -nP '(.*)\s*>\s*(.*)\s*\?\s*\g1\s*:\s*\g2' Change-Id: I60b9a3a2a09162bc0de4c13fdde2c209696e5413 Reviewed-on: https://gerrit.libreoffice.org/47602 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-09loplugin:convertlong in ucb,sotNoel Grandin1-1/+1
Change-Id: I6fa355448834701f11b84584649dfcdecd0f7b2c Reviewed-on: https://gerrit.libreoffice.org/47596 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-04ofz#4886 Integer-overflowCaolán McNamara1-3/+5
sal/rtl/math.cxx:1106:29: runtime error: signed integer overflow: 15 - -2147483648 cannot be represented in type 'int' Change-Id: Ia81eca9da1fe7cc1a5c5319742b32bd742fb817e Reviewed-on: https://gerrit.libreoffice.org/47329 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-02Remove broken testStephan Bergmann2-26/+0
...introduced with 26be5f21cebfe9acad088a1086f97eebdb437b7c "unotools: don't go belly-up if temp dir is wrong or empty". At least Flatpak builds can create a /not/found/dir directory just fine. Change-Id: I73115ac99498ac584be77153ef66bba3036392c3 Reviewed-on: https://gerrit.libreoffice.org/47267 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-02Unused return value of rtl_cache_constructorStephan Bergmann1-8/+6
Change-Id: I1e8b8ae65d9989683dde8f642f3c19355d10a571 Reviewed-on: https://gerrit.libreoffice.org/47238 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-01sal: (win32) readd comment explaining about buffer size decisionChris Sherlock1-0/+5
Readd comment explaining why we allocate a large buffer for GetEnvironmentVariableW which was removed in commit f78a2bcce88dd5c12052ae3e55c561cdd48b05fe: re-base on ALv2 code. Includes: Patch contributed by Herbert Duerr: #i118662# remove berkeleyDB from module xmlhelp (author=orwitt) http://svn.apache.org/viewvc?view=revision&revision=1213188 #i119141# remove ISCII converter for now http://svn.apache.org/viewvc?view=revision&revision=1306246 make exceptions for cppunittester verbose http://svn.apache.org/viewvc?view=revision&revision=1174831 Patches contributed by Pedro Giffuni: Avoid some uses of non portable #!/bin/bash in shell scripts. http://svn.apache.org/viewvc?view=revision&revision=1235297 Patch contributed by Oliver-Rainer Wittmann 88652: applied patch, remove unicows deps http://svn.apache.org/viewvc?view=revision&revision=1177585 drop OS/2 code, remove in-line assembler ARM atomics, and obsolete armarch header. Change-Id: I75a222393e202e40d78f10fc97f5eb4aad2df743 Reviewed-on: https://gerrit.libreoffice.org/47018 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-30Support for tcmalloc and jemalloc is long deadStephan Bergmann1-1/+1
When it was originally added to --with-alloc (tcmalloc: f63ffaf3667e218be3538e84e6becc18d5de4334, 54efc5ed83890f0a1166ece3b1e4942bb7922ff7, 0abd71b44144220d2aeec58601929fd0cd1914d6 708b6d4246de915ac960c7b90ee8bb2d966c7d17 "INTEGRATION: CWS configure14: #i59160# allow usage of tcmalloc and system-malloc"; jemalloc: 826a90d68a4dc458585c6d2e647bec17971e9193 "configure25: #i111045# jemalloc"), the old build system's solenv/inc/unxlng*.mk added corresponding -l switches to linker command lines, but it appears that was never carried over into the new build system. And even if the AC_CHECL_LIB calls in configure.ac prior to e612f026de6ca1153c57fb10f0fa75725425a301 "Ensure AC_CHECK_LIB/AC_SEARCH_LIBS do not poison LIBS" would have extended LIBS with the correpsonding -l switches, there appears to be no mechanism in the new build system that would have depended on letting that have any effect on which alloc lib to link against. So the only remaining effect of --with-alloc={tcmalloc,jemalloc} is to set FORCE_SYSALLOC in Library_sal.mk, same as --with-alloc=system does. So whoever still uses the former configure switches should just switch to the latter. (Also adapt the documentation of --with-alloc to reality, "internal" instead of "oo".) Change-Id: Iac0e302c5f9602daf5f8452a0fc1887dc55ee27b Reviewed-on: https://gerrit.libreoffice.org/47178 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-29loplugin:unnecessaryparen improve return checkNoel Grandin1-1/+1
Change-Id: I8128aa4b5fc60efd1dbf5971cdde11e588f5f64b Reviewed-on: https://gerrit.libreoffice.org/47167 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-29PRIu64 is unusedStephan Bergmann1-11/+0
...since 2d9beb7854bdfa6e6140e78ab754414340725e38 "OSL_TRACE in sal/rtl/source/alloc_*.cxx leads to deadlock..." Change-Id: I7ede71b8257fa402f5f174dfb9c12fa5e648a017 Reviewed-on: https://gerrit.libreoffice.org/47177 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-28rtl: support start/stop threads around pre-initAshod Nakashian4-18/+53
This is necessary to avoid having extra threads while forking. After forking, the second stage of pre-init is started and so we start the stopped rtl threads. The comment for rtl_alloc_preInit_phase_t has more details. Change-Id: I1a3f7be74d4b04d0b2fc4a72b02124c2faa3c047 Reviewed-on: https://gerrit.libreoffice.org/47060 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2017-12-27sal: fix typo in tcvtmb.cxx and remove comment cruftChris Sherlock1-13/+1
Change-Id: I1617900cd2df096d46a2cba75ef2fe1373c0ab63 Reviewed-on: https://gerrit.libreoffice.org/46948 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-22unotools: don't go belly-up if temp dir is wrong or emptyJuergen Funk2-0/+26
When a wrong temp directory was set (e.g. wrong path in xcu ist set), you get a assert in the LO-Debug Version, this patch avoid this assertion. Change-Id: I192f682860ad9cddf907e4b239eff36b4bd6072d Reviewed-on: https://gerrit.libreoffice.org/46846 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-12-20Don't use -I$(SRCDIR), people have various strange stuff in the SRCDIR.Jan Holesovsky2-2/+1
For me, the build failed because of a file named 'new' ;-) Change-Id: I1816ff16b1b76a833ded2b6f332553b768916cad Reviewed-on: https://gerrit.libreoffice.org/46776 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2017-12-19Clang 3.5 has -Wreturn-type-c-linkageStephan Bergmann1-3/+0
Change-Id: I9d4b8aef3877f46c537937f7cb04c7654f057fa2 Reviewed-on: https://gerrit.libreoffice.org/46789 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-19inline use-once typedefsNoel Grandin1-2/+1
Change-Id: I5c3ffc03c26b3428f1f336e6ecba7838a1cf1157 Reviewed-on: https://gerrit.libreoffice.org/46764 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-17Fix typosAndrea Gelmini1-1/+1
Change-Id: I4630ba4a93a32c47753422b29535c36b53ff3d5e Reviewed-on: https://gerrit.libreoffice.org/46635 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-15Fix typosAndrea Gelmini1-1/+1
Change-Id: I061839727b3fd078284117fca3ea53413af7bcf0 Reviewed-on: https://gerrit.libreoffice.org/46574 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-15loplugin:salcall (clang-cl)Stephan Bergmann9-18/+18
Change-Id: Idda630320bb5e02e1ea675b3b3786c9ec6ac166b Reviewed-on: https://gerrit.libreoffice.org/46504 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-15sal: add pre-initialization scheme for allocations.Michael Meeks11-9/+211
This saves several megabytes of dirtied pages for each LOK client of Online. Change-Id: I425a2e7896879f0a64d71fcc0655e9e1fa1256aa
2017-12-15loplugin:salcall (macOS)Stephan Bergmann2-2/+2
Change-Id: I297ac09358ce948acae9b73e8ed605964520c73b Reviewed-on: https://gerrit.libreoffice.org/46437 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-11loplugin:salcall fix functionsNoel Grandin19-75/+75
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-06Function LookupAccountSidW takes number of characters, not bytesMike Kaganski1-2/+2
Change-Id: Ie01feea2c5025f64a7888b85cb5de0c8f6c6f5c2 Reviewed-on: https://gerrit.libreoffice.org/45955 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-12-04Condition for definition of LastIdent must match condition for its useStephan Bergmann1-1/+1
Change-Id: Iccc58d396d8c80a717e9d33ed8d872aadea08afa Reviewed-on: https://gerrit.libreoffice.org/45829 Reviewed-by: Rene Engelhard <rene@debian.org> Tested-by: Rene Engelhard <rene@debian.org>
2017-12-04new loplugin salcall: remove unnecessary SAL_CALLNoel Grandin1-1/+1
In this first commit, I use the plugin to verify the consistency of our SAL_CALL annotations. The point being to make the next commit more mechanical in nature, purely using the rewriter. There are various chunks of unix-only code that have never had to be compiled by MSVC, hence the inconsistencies. In bridges, I had to inline some typedefs to make the verification code happy, since it cannot see into typedefs. Change-Id: Iec6e274bed857febf7295cfcf5e9f21fe4a34da0 Reviewed-on: https://gerrit.libreoffice.org/45502 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-03Replace lists by vectors in bootstrap (sal)Julien Nabet1-24/+22
Change-Id: I9e37a3794fd2880aadab53b7fad3051a4dd8d49a Reviewed-on: https://gerrit.libreoffice.org/45744 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-11-30loplugin:unnecessaryparen: signed numeric literalsStephan Bergmann1-1/+1
Change-Id: I75c8224452ca9c3711a2ccaca9ecf549fa59cb64 Reviewed-on: https://gerrit.libreoffice.org/45549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-30sal: check for HAVE_GCC_BUILTIN_ATOMIC only once in interlckMiklos Vajna1-17/+9
Change-Id: Iaddc79cee0c06f72f636a3d35959922fd78f4e20
2017-11-29loplugin:unnecessaryparen (clang-cl)Stephan Bergmann2-2/+2
Change-Id: I3a2b7ed3fdef3b77c0a052b10f88918aa616779e Reviewed-on: https://gerrit.libreoffice.org/45469 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-28Revert loplugin:unnecessaryparen warning around integer literalsStephan Bergmann1-1/+1
...as those may be used to silence Clang -Werror,-Wunreachable-code (as happens in sal/osl/unx/file_volume.cxx for Android, where OSL_detail_STATFS(...) always expands to (1)). Change-Id: I85d280c1315b4447362255d17f13f437d3c4af92
2017-11-27loplugin:unnecessaryparen (clang-cl)Stephan Bergmann1-3/+3
Change-Id: I5452235287fd5986de25ee542edd57bf1abded52 Reviewed-on: https://gerrit.libreoffice.org/45338 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-27loplugin:unnecessaryparen: Warn about parentheses around literalsStephan Bergmann2-2/+2
...that are not composed of multiple tokens, like ("foo" "bar"). Also don't yet warn about Boolean literals, which are sometimes wrapped in parentheses to silence unreachable-code warnings. To avoid multiple warnings about code like f((0)) switch to generally using a set of ParenExpr to keep track of which occurrences have already been handled. Change-Id: I036a25a92836ec6ab6c56ea848f71bc6d63822bc Reviewed-on: https://gerrit.libreoffice.org/45317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-23loplugin:simplifybool can't invert conditions involving float typesNoel Grandin1-1/+1
so revert some of the changes from commit 7a1c21e53fc4733a4bb52282ce0098fcc085ab0e loplugin:simplifybool for negation of comparison operator Change-Id: I937d575b86c1e418805d399b0dc16ae91876b4fe Reviewed-on: https://gerrit.libreoffice.org/45130 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-23loplugin:simplifybool for negation of comparison operatorNoel Grandin3-11/+11
Change-Id: Ie56daf560185274754afbc7a09c432b5c2793791 Reviewed-on: https://gerrit.libreoffice.org/45068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-22ofz#4366 Divide-by-zeroStephan Bergmann1-2/+10
Change-Id: I3d0eb3bb6a69d09e71ce8bf91051f66e204eb0df Reviewed-on: https://gerrit.libreoffice.org/45098 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-22Make loplugin:unnecessaryparen warn about (x) ? ... : ... after allStephan Bergmann1-1/+1
...which had been left out because "lots of our code uses this style, which I'm loathe to bulk-fix as yet", but now in <https://gerrit.libreoffice.org/#/c/45060/1/> "use std::unique_ptr" would have caused an otherwise innocent-looking code change to trigger a loplugin:unnecessaryparen warning for pFormat = (pGrfObj) ? ... (barring a change to ignoreAllImplicit in compilerplugins/clang/unnecessaryparen.cxx similar to that in <https://gerrit.libreoffice.org/#/c/45083/2> "Make not warning about !! in loplugin:simplifybool consistent", which should also have caused the warning to disappear for the modified code, IIUC). Change-Id: I8bff0cc11bbb839ef06d07b8d9237f150804fec2 Reviewed-on: https://gerrit.libreoffice.org/45088 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-21Disable custom allocatorDennis Francis1-1/+1
This has big positive effect on software interpreter threading performance scaling. Change-Id: I8fbb6bf8f7ed410fd53278acee63bf65f13bac38