summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)AuthorFilesLines
2015-10-01remove old standalone Sun bug numbersNoel Grandin1-1/+0
Sun bug numbers without any accompanying text are completely useless. Fixed with git grep -lP '//\s*#\d+#\s*$' | xargs perl -i -ne'/\/\/\s*#\d+#\s*$/d or print' And then hand-checking the result to restore places where it deleted code. And then some more grepping and hand-editing to kill the others. Change-Id: Ia96ce4466db8bb8da363ebf41f0ae7f45f28bf29 Reviewed-on: https://gerrit.libreoffice.org/19023 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-01Revert "by default use the system memory allocator"Markus Mohrhard1-5/+1
It seems that even on Linux the system allocator is worse than our internal allocator. e.g: http://perf.libreoffice.org/perf_html/chitest_of_cppu_sc_on_vm139.details.html This reverts commit 006d30b1a29e2c471a96c0f4658beea8cb86b338.
2015-09-30Avoid unhelpful -Wunused-variableStephan Bergmann1-0/+31
...at least from "g++ (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)" with --disable-debug, when a namespace-scope const variable with a "complex" initializer declared in an include file remains unused. Avoid that warning via SAL_CONSTEXPR, which in turn requires large parts of o3tl::is_typed_flags to be SAL_CONSTEXPR, which in turn requires a new HAVE_CXX14_CONSTEXPR to allow assert in constexpr functions, which in turn requires using -std=c++14 instead of -std=c++11 where available, which in turn (a) requires to /not/ use -std=c++14 if it would run into a bug between Clang and libstdc++ discussed at <https://llvm.org/bugs/show_bug.cgi?id=24115> "llvm-nm fails to build with gcc 5.1's libstdc++" (and which hits us in sfx2/source/control/thumbnailview.cxx), and (b) requires a new HAVE_CXX14_SIZED_DEALLOCATION to work around GCC 5.1 -Werror=sized-deallocation (where Clang >= 3.7 only supports C++14 sized deallocation when explictly enabled via -fsized-deallocation, btw). This effectively reverts ff6462e6307e6924dc6c8178043ae9032f4b4152 "avoid unused variable warning:" again. Change-Id: I424e3561452a3e6d8c8a9604d6c737cab49840c4 Reviewed-on: https://gerrit.libreoffice.org/18918 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2015-09-30Fix typosAndrea Gelmini9-24/+24
Change-Id: Ia41f4f0ca30ae3346d0720271478ec5bcdab797b Reviewed-on: https://gerrit.libreoffice.org/18967 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2015-09-28Remove bogus unreliable testStephan Bergmann1-24/+0
Change-Id: I33ac62e10030a3d975f7644406025dbb5deb711e
2015-09-28by default use the system memory allocatorMarkus Mohrhard1-1/+5
Anything except an unset G_SLICE or the value always-malloc results in the custom allocator. We might revert that change if it causes issues but currentlz it looks like our custom allocator performs quite badly in some situations. Change-Id: Ib867f7ba0de4d599aa045c28aaab9b644d619beb
2015-09-23Better fail with E_EXIST if rename(3) failsStephan Bergmann1-1/+1
...it leads to better handling of the failure downstream, if e.g. this is an attempt to copy a file from the presets to an existing file of a previously partly generated UserInstallation, and the presets and the UserInstallation are on different drives and rename(3) fails with EXDEV. (Without this fix, removing the UserInstallation's registrymodifications.xcu caused restarting soffice to fail with "User installation could not be completed" in this case; regression introduced with 6edbcc1b231feb02f304ff646c323b5df051d9a4 "cid#1242936 handle rename failure.") Change-Id: I409698c4e2e6cc6ccd8b2be80a393c9657b5125d
2015-09-18valgrind: memleak in randompoolCaolán McNamara1-1/+1
regression from commit 91457fb326dda7bd1fc6d9e1b3afe0667425121c Author: Norbert Thiebaud <nthiebaud@gmail.com> Date: Tue Apr 21 20:55:15 2015 -0500 use osl_get_system_random data in rtlRamdomPool Change-Id: Ib5ff6b7fbd08869d9a6dbc1f4df883d701cf765c
2015-09-11Useless cargo cult?Stephan Bergmann1-34/+0
Change-Id: I0bb5582a6aef51ac65466531115d67c6dbad1fcd Reviewed-on: https://gerrit.libreoffice.org/18493 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2015-09-10Add OString::startsWithIgnoreAsciiCaseStephan Bergmann2-0/+93
...analogous to the existing OUString::startsWihtIgnoreAsciiCase, to be used in the next commit Change-Id: Iad6989c16e1bda6b2b0a58e6c768f7852560bb00
2015-09-03sal: actually that uwinapi stuff doesn't include sal headers?Michael Stahl1-1/+1
Change-Id: I1812b7050af725ee754c9e41b9b635319eead33a
2015-09-03sal: actually export the legacy function for VS 2015Michael Stahl2-4/+6
Change-Id: I29e43f865133b030bbe76d5a9fe90c978228ed96 Reviewed-on: https://gerrit.libreoffice.org/18294 Reviewed-by: David Ostrovsky <david@ostrovsky.org> Tested-by: Jenkins <ci@libreoffice.org>
2015-09-03Fix some perl shebangs.Pedro Giffuni7-7/+7
Most important perl scripts already use a portable method but fix these nevertheless. (cherry picked from commit 93496a6c1e5b2ae1756dc9b8043e2267209387da) Change-Id: Id8b5e974356701e66f9dd8a6bd7a58fd4f5633ae
2015-09-02Don't redefine snprintf as VS 2015 supports ISO standardDavid Ostrovsky2-1/+6
Make the workaround in snprintf.h conditional on older MSVC version. Investigation reveals that the GetShortPathNameW is presumably used by legacy Duden extension that was built by Sun in a setsolar environment. The uwinapi.lib was never part of the SDK, so ordinary extensions cannot link against it. The PRIVATE export of the symbol that is only possible with DEF file therefore does not matter much. With VC2015 there is no need for LO code to use uwinapi.dll at all and gb_UWINAPI can be unset in this case. Change-Id: I23a5636db9431b0fa4350b665a6a69613d625264 Reviewed-on: https://gerrit.libreoffice.org/16677 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-08-31sal: oops, forgot to commit that bitMichael Stahl1-1/+1
Change-Id: Iee85958a6589624bc9a61242fca41214bdd1df85
2015-08-31sal: don't use --target as parameter to cppunittesterMichael Stahl1-4/+8
CppunitTest_libreofficekit_tiledrendering hangs because the soffice_main exits due to the unrecognized command line arg --target. Use a -env:VARIABLE argument instead, which is filtered out by rtl_getAppCommandArg() so does not reach the soffice_main code. (regression from 87514b0907dfbb479e2646b5ff951c68babf3417) Change-Id: I2c801305398dccfb447e4e5c44726f42bf2a72ef
2015-08-31sal: loplugin:stringconstantMiklos Vajna1-1/+1
Change-Id: Ib4e7f4f71494abd654a70cf8ba8b0ca0afcd7df1
2015-08-31log resource usage of unit tests on UNX platformsMarkus Mohrhard1-0/+50
Change-Id: I3788eae60f73bc42488bf2e4961922962f7e505b Reviewed-on: https://gerrit.libreoffice.org/18155 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2015-08-23tdf#39440 cppcheck: redundantAssignmentMichael Weghorn2-5/+2
This addresses some of cppcheck's "redundantAssignment" warnings ("Variable '<varName>' is reassigned a value before the old one has been used"). Change-Id: I8fd2950d5aa1a3f4bd9e1c4c336abe465d1f657e Reviewed-on: https://gerrit.libreoffice.org/17926 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-08-22tdf#39440 reduce scope of local variablesMichael Weghorn2-3/+2
This addresses some cppcheck warnings. Change-Id: Ie492fb9c106b37c3fe7b0105236ad6315f4f159e Reviewed-on: https://gerrit.libreoffice.org/17921 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2015-08-21tdf#93569 - restore ACT_ABORT distinction.Michael Meeks1-1/+1
In order to handle signals, we need to have ACT_ABORT in place and distinct from ACT_SYSTEM. cf. if (Signals[i].Action != ACT_SYSTEM) during setup. Change-Id: I8c69d48244ba462f2e2385a530cbbf4740ccee9a Reviewed-on: https://gerrit.libreoffice.org/17889 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-18no need for pre/postmac in osl/unx/system.hNorbert Thiebaud1-3/+0
Change-Id: Id96cc357ae4d8d064bb297a17d9033ffe8643df3 Reviewed-on: https://gerrit.libreoffice.org/17821 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2015-08-11new loplugin: defaultparamsNoel Grandin1-3/+3
find places where we do not need to be passing a parameter to a function, because that function has a default value which matches the value we are passing. Change-Id: I04d1fd6275204dd4925e6563282464f461123632
2015-08-06sal: fix assert in osl_joinWithThread()Michael Stahl1-5/+7
e3a74864a02d2ed362f7bfb82c5ce6068b908101 was subtly wrong: in a --enable-online-update build, the assertion triggered with nonsensical stacks like: 4 in osl_joinWithThread(oslThread) at /sal/osl/unx/thread.cxx:441 5 in osl::Thread::join() at /include/osl/thread.hxx:111 6 in (anonymous namespace)::UpdateCheckJob::notifyTermination(com::sun::star::lang::EventObject const&) at /extensions/source/update/check/updatecheckjob.cxx:312 7 in framework::Desktop::impl_sendNotifyTerminationEvent() at /framework/source/services/desktop.cxx:1665 8 in framework::Desktop::terminate() at /framework/source/services/desktop.cxx:307 ... 14 in binaryurp::(anonymous namespace)::request(void*) at /binaryurp/source/reader.cxx:85 15 in cppu_threadpool::JobQueue::enter(long, bool) at /cppu/source/threadpool/jobqueue.cxx:115 16 in cppu_threadpool::ORequestThread::run() at /cppu/source/threadpool/thread.cxx:171 The problem is that the early-return case is (accidentally) doing the right thing for an attempt to join a thread that has already terminated normally, but the assertion must not trigger when the terminated thread's ID is re-used by a later thread. Change-Id: I2a6764d2ec189d96ccb366db14395029bb8e73ad
2015-08-06sal: make osl_joinWithThread() a little more consistentMichael Stahl1-0/+1
If the Win32 implementation deadlocks on a self-join, at least assert in the same situation on UNIX. Change-Id: I1b9e3da95837d456e6933e8fd9a256869cb4bde9
2015-08-04sal,rsc,oox: inline some use-once typedefsNoel Grandin1-5/+3
Change-Id: I91bebe06c5c5f3ebe5fbeec83dcf3f5bdf563201
2015-07-30tdf#60381: Accessing Sharepoint share using UNC path does not work.Giuseppe Castagno1-0/+2
Added two Windows API missing errors. The errors added: ERROR_FILE_CHECKED_OUT returned when trying to access a file that is locked by another user. ERROR_INVALID_NAME returned when trying to access a local file with the wrong chars in the path or file name. Mapped to existent osl_File_E_.... for compatibility. Change-Id: I0bea1ff2727729c569b0a2cb6befd0d38289b8a2 Reviewed-on: https://gerrit.libreoffice.org/17412 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2015-07-27inline a bunch of use-once macrosNoel Grandin1-4/+1
no point in having a macro unless it's actually going to reduce the number of lines of code Change-Id: Ic8760d6506cf272d7bd088f7b3b4dcbf288099fc
2015-07-23coverity#1312138 Resource leakCaolán McNamara1-0/+1
Change-Id: Ib3f5665f336fb933fbfa88a1032d76d881b38196
2015-07-21loplugin:cstylecastNoel Grandin1-1/+1
Change-Id: If877cd61000fe6b82083a9fff79c25364d49e721
2015-07-20use osl_get_system_random data in rtlRamdomPoolNorbert Thiebaud1-9/+30
substitute as much as possible getting directly random data from the system rather than mixing our own pseudo-random numbers Fall back on the home-grown method if for some reason system random does not work. (on windows rand_s() is said to be able to return errors, beyond EINVAL, but they are just not listed.. so who knows) Change-Id: I71e88e097a9f3587086a710e9a785d61c560785e Reviewed-on: https://gerrit.libreoffice.org/15474 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-07-20add an internal api to osl to collect 'native' random numbersNorbert Thiebaud4-0/+136
use /dev/urandom on unixes and rand_s() on windows Change-Id: Iccd6e01706f16d82f23cda0f0a410953c32fbc02 Reviewed-on: https://gerrit.libreoffice.org/15473 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-07-16loplugin:simplifyboolStephan Bergmann1-1/+1
Change-Id: I9c4be053a8e39683e0d557a7a6be109507374d70
2015-07-15Log the actual string, not the rtl_uString pointer valueTor Lillqvist1-4/+5
Change-Id: I51938f4801436aff31b51fd36c89582062f83b9a
2015-07-13Make content of OSL_ASSERT, DBG_ASSERT, etc. visiblie in non-debug buildsStephan Bergmann1-4/+2
...to avoid lots of loplugin:staticmethods warnings. Also enables DBG_ASSERT etc. also for --enable-debug builds in addition to --enable-dbgutil builds. Change-Id: Ib89ecd9ab8ce7abb2c64790ace248b31f9d2b64d
2015-07-10cleanup some unnecessary direct usage of the OString/OUString C API.Noel Grandin3-8/+3
Change-Id: I6edee95aae1c169ce70063562a0c1b287e0c4735 Reviewed-on: https://gerrit.libreoffice.org/16861 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-09Do not call SAL_N_ELEMENTS on empty arrayStephan Bergmann1-0/+2
Change-Id: I8b73c61a9662079927344029eb9872c6a19aad76
2015-07-08Fix typosAndrea Gelmini3-4/+4
Change-Id: I020c7ce4d9aa93cb0292378a410cdb9f7788e920 Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-07-07performance tuning of rtl_ustr_indexOfAscii_WithLength()Norbert Thiebaud1-6/+18
lcov over make check showed 98 4699997 : sal_Int32 rtl_ustr_indexOfAscii_WithLength( 99 : sal_Unicode const * str, sal_Int32 len, 100 : char const * subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C() 101 : { 102 4699997 : assert(len >= 0); 103 4699997 : assert(subLen >= 0); 104 4699997 : if (subLen > 0 && subLen <= len) { 105 : sal_Int32 i; 106 54014537 : for (i = 0; i <= len - subLen; ++i) { 107 51036513 : if (rtl_ustr_asciil_reverseEquals_WithLength( 108 51036523 : str + i, subStr, subLen)) 109 : { 110 205482 : return i; 111 : } 112 : } 113 : } 114 4494505 : return -1; 115 : } so 1/ in 95% of the cases the result is not-found.. _that_ is the hot path 2/ we are calling rtl_ustr_asciil_reverseEquals_WithLength close to 11 times per call.. (average ~ len - subLen, due to the high miss ratio) so let's first search for the first byte of the substring to optimize the 'miss' case, which is the most common one. Change-Id: I20ef0821db2ff0db5935dd562844a947a14aff64 Reviewed-on: https://gerrit.libreoffice.org/16763 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2015-07-06Clarify treatment of double slashes in rtl::Uri::convertRelToAbsStephan Bergmann1-1/+5
Change-Id: I71d0ded04b35472f14e4764a47212c73ac500814
2015-07-04Fix typosAndrea Gelmini2-2/+2
Change-Id: Iddcc22f62ea134ea797292daa02e47042d52d0d1 Reviewed-on: https://gerrit.libreoffice.org/16710 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2015-06-30Coverity 1308555, 1308562, 1308600: Drop some SAL_THROW_EXTERN_CStephan Bergmann1-7/+6
...from most rtl/bootstrap.h functions. They are effectively only called from C++ code (there is no plain C UNO binding), so it should be fine to let std exceptions (like bad_alloc or length_error) propagate from their implementations to call sites. (The exception is rtl_bootstrap_args_close, which is typically called from C++ dtors, so should not throw anyway.) This would strictly speaking be an [API CHANGE], but it should make no practical difference whether a process terminates abruptly because an exception cannot pass through a SAL_THROW_EXTERN_C() nothrow specification or because legacy client code does not expect exceptions to be thrown from functions from which SAL_THROW_EXTERN_C() has now been removed. Change-Id: I08e8479e9c5731e46021aadd6a725c1793024d10
2015-06-28Fix typosAndrea Gelmini1-1/+1
Change-Id: I80995af6459af9f647e66d1c85da2eedad2647b9 Reviewed-on: https://gerrit.libreoffice.org/16523 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2015-06-26loplugin:stringconstant: handle OUString+=OUString(literal)Stephan Bergmann4-20/+14
Change-Id: Ia304622214c47d35387dd0393db8e9afa55118f2
2015-06-26Add optimized OUString += literal overloadStephan Bergmann3-0/+33
Change-Id: Ib34196185f90204a71598f2c659c3fddce7a0e4d
2015-06-25Revert "Revert "Generalize OUStringLiteral1""Stephan Bergmann1-0/+14
This reverts commit 5cba714b4d03ed54debf71534ad8c8edc383a01e, now including a workaround for <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53658> "internal compiler error -- segmentation fault." Change-Id: I31f6d9ddcb0b884134703df2b9dc1800ba0a84be
2015-06-25Do not forget to actually set newStr to an empty stringStephan Bergmann2-3/+22
Change-Id: I745b09d8a248f08afdd3387f4cfcf69d71ec3c39
2015-06-24Revert "Generalize OUStringLiteral1"Stephan Bergmann1-14/+0
This reverts commit 4d4f3512db0cf0bf47c2ba1b39c3813842903ef7, at least "gcc version 4.8.3 20140627 [gcc-4_8-branch revision 212064] (SUSE Linux)" fails with "include/rtl/stringutils.hxx:175:49: internal compiler error: Segmentation fault."
2015-06-24Generalize OUStringLiteral1Stephan Bergmann1-0/+14
...by making all places that accept a string literal via ConstCharArrayDetector also accept an OUStringLiteral1 via ConstCharArrayDetector (which required some tweaking of the ConstCharArrayDetector internals). That removes the need for special-purpose OUStringLiteral1 overloads, and will allow OUStringLiteral1 to be used in more places. Change-Id: I370de8480e02f8423cde5677dd38479b81bccdb2
2015-06-23Revert "Typo: iff->if"Julien Nabet1-1/+1
This reverts commit cf92da3d6e1de14756efe3f1ee79f393a2f3787d. iff can mean "if and only if" so not a typo