summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2018-01-13sal: remove no longer needed CheckTokenMembership_StubChris Sherlock
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 Bergmann
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 Grandin
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 Grandin
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 McNamara
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 Bergmann
...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 Bergmann
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 Sherlock
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 Bergmann
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 Grandin
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 Bergmann
...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 Nakashian
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 Sherlock
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 Funk
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 Holesovsky
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 Bergmann
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 Grandin
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 Gelmini
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 Gelmini
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 Bergmann
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 Meeks
This saves several megabytes of dirtied pages for each LOK client of Online. Change-Id: I425a2e7896879f0a64d71fcc0655e9e1fa1256aa
2017-12-15loplugin:salcall (macOS)Stephan Bergmann
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 Grandin
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 Kaganski
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 Bergmann
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 Grandin
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 Nabet
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 Bergmann
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 Vajna
Change-Id: Iaddc79cee0c06f72f636a3d35959922fd78f4e20
2017-11-29loplugin:unnecessaryparen (clang-cl)Stephan Bergmann
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 Bergmann
...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 Bergmann
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 Bergmann
...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 Grandin
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 Grandin
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 Bergmann
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 Bergmann
...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 Francis
This has big positive effect on software interpreter threading performance scaling. Change-Id: I8fbb6bf8f7ed410fd53278acee63bf65f13bac38
2017-11-21Fix typosAndrea Gelmini
Change-Id: I40b3a46d46f0586d086bdbe41876c088f8c1cb58 Reviewed-on: https://gerrit.libreoffice.org/45007 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
2017-11-20look for =() in loplugin:unnecessaryparenNoel Grandin
Change-Id: I4f9b71ff7767e90987bb40358fc46ed5d1d571d0 Reviewed-on: https://gerrit.libreoffice.org/44944 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-13Fix typosAndrea Gelmini
Change-Id: I677512213d97d01832bebe162fbf7de2998bf4d0 Reviewed-on: https://gerrit.libreoffice.org/44664 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-11-13IsValidFilePath: fix correction of double path delimitersMike Kaganski
Wuthout this fix, it had always tried to replace in original path, thus second occurence of double path delimiter, like in C:\dir1\\dir2\dir3\\file would result in invalid path reported. Change-Id: I63ce97b620229601e18f10016a759275aceeec4d Reviewed-on: https://gerrit.libreoffice.org/44675 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-13Fix typosAndrea Gelmini
Change-Id: Ia544298334364ece3b3963a4adc00c5e01189b91 Reviewed-on: https://gerrit.libreoffice.org/44654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-11-11Avoid using O[U]StringConcat lvalues containing dangling refs to temporariesStephan Bergmann
...in code accidentally using auto like > auto const aURL = uri->getUriReference() + "/" > + INetURLObject::encode( > m_sEmbeddedName, INetURLObject::PART_FPATH, > INetURLObject::EncodeMechanism::All); > > uno::Reference<uno::XInterface> xDataSource(xDatabaseContext->getByName(aURL), uno::UNO_QUERY); in <https://gerrit.libreoffice.org/#/c/44569/1> "Properly construct vnd.sun.star.pkg URL" did (causing hard to debug test failures there). So make functions taking O[U]StringConcat take those by rvalue reference. Unfortunately, that also needed adaption of various functions that just forward their arguments. And some code in sc/qa/unit/ucalc_formula.cxx used CPPUNIT_ASSERT_EQUAL on OUStringConcat arguments in cases where that happened to actually compile (because the structure of the two OUStringConcats was identical), which needed adaption too (but which would arguably better use CPPUNIT_ASSERT_EQUAL_MESSAGE, anyway). Change-Id: I8994d932aaedb2a491c7c81c167e93379d4fb6e3 Reviewed-on: https://gerrit.libreoffice.org/44608 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-10rtl: change nullptr comparisonChris Sherlock
Change-Id: I0c356b100b732e259646d4ebb5d0aedd4dc4bcdd Reviewed-on: https://gerrit.libreoffice.org/44302 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-11-04Make Windows error reporting more robustMike Kaganski
https://msdn.microsoft.com/en-us/library/ms679351 describes that "it is unsafe to take an arbitrary system error code returned from an API and use FORMAT_MESSAGE_FROM_SYSTEM without FORMAT_MESSAGE_IGNORE_INSERTS" Previously in case when an error string would contain inserts, function returned error, so the error message wasn't shown (at least it didn't crash, thanks to nullptr as the function's last argument). As the function may fail, we now pre-nullify the buffer pointer to avoid dereferencing uninitialized pointer later (though at least for some Windows versions, the function nullifies the pointer in case of FORMAT_MESSAGE_ALLOCATE_BUFFER, but there's no explicit guarantee of this). Also release of allocated buffer is changed to recommended use of HeapFree. The code that doesn't make use of OUString is left directly calling FormatMessage, to avoid introducing new dependencies. Where it makes sense, we now use WindowsErrorString from <comphelper/windowserrorstring.hxx> Change-Id: I834c08eb6d92987e7d3d01e2c36ec55e42aea848 Reviewed-on: https://gerrit.libreoffice.org/44206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-11-02Avoid warning thrashStephan Bergmann
...between "error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]" (in some builds, for the original code) and "error: fallthrough annotation in unreachable code [-Werror,-Wimplicit-fallthrough]" (in other builds, after adding SAL_FALLTHROUGH). Change-Id: I75bbefd69c81f43f22117f8ad110237de24e18af
2017-11-02Clean up oslTranslateFileErrorStephan Bergmann
Change-Id: I004bcba518ead9c149f1671d62aa94986a38945d
2017-11-02coverity#1420539: dead codeStephan Bergmann
...after 0b413caadfbe68b278ca5ba33b6d204687586ea9 "loplugin:constantparam in sal,sax" Change-Id: Idf000bd1e0a261eac9ec0afbd2fb6f4c4ef8c7dc
2017-11-01-I$(dir $(3)) in gb_CObject__command_pattern is no longer neededStephan Bergmann
...at least in com_GCC_class.mk (com_MSC_class.mk will be addressed in a follow- up commit), after the recent loplugin:includeform clean-up. Two static libraries built from external sources needed adjustment, two compilerplugin tests needed adjustment (which wasn't found by loplugin:includeform, by design), and one more adjustment in sal/textenc/generate/. Change-Id: Idad5ae355a02ae130369a9a45b5f5925ab48ffef Reviewed-on: https://gerrit.libreoffice.org/44174 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>