summaryrefslogtreecommitdiff
path: root/sal/rtl
AgeCommit message (Collapse)Author
2016-01-26Bin leftover cruftTor Lillqvist
Change-Id: I15a4237a1ab6d7c180b52c3f8d2834c0e034b7db
2016-01-14use ::std::swap() to reverse bufferEike Rathke
Change-Id: I7e18e57636416f0a3ed96c2fa3adc004fb3ba013
2016-01-14use getN10Exp(x) instead of pow(10.0,x)Eike Rathke
Change-Id: Ib7e49126cbffc510fa941c25a8d57222bad51c46
2016-01-14handle negative decimal places for rounding, tdf#96918 relatedEike Rathke
Change-Id: Ifa423eabc64ead519c4f4a3370a06e88ea5c7466
2016-01-13sal: as always C++ is too stupid to deduce parameter types of minMichael Stahl
Change-Id: Ib00f29a6024e22c65a30bf4a45332e550994f03f
2016-01-13tdf#96918 display accurate integer double values up to (2^53)-1Eike Rathke
Change-Id: I42001583c72bc3faab94489a4eabfa183cab5ae2
2016-01-06tdf#39631 - branch hints: comment, and tweak variously, also use.Michael Meeks
Find a few million mis-predicted branches (according to callgrind) and annotate them. Mark string acquire/release as hot, and a number of deprecated methods as cold. Change-Id: I678b3981794221c97f9ebb70fd0161c0fda5dceb
2015-12-17OString/OUString: move constructors and operator=Noel Grandin
Change-Id: Icdc5f7137cca8360f116d5d4c7b0bf4a4c526e1d Reviewed-on: https://gerrit.libreoffice.org/20712 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-12-10More loplugin:nullptr automatic rewrite (within templates)Stephan Bergmann
Change-Id: I9bc06cfb5eeb38fd7ae7fb25f876ea9f96e4a65a
2015-11-10Fix SAL_W32Stephan Bergmann
Change-Id: I60333e2b0f71c38aa13e6a6665c2a305e6dc08fa
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I1bc6c87fcd6e5e96362623be94c59be216a3b2b8
2015-11-06loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)Stephan Bergmann
Change-Id: I95283ccf78e4ca699e88ea226d38153a8a92845a
2015-10-26Revert "see if including cmath instead of math.h satisfies Android-ARM"Eike Rathke
This reverts commit 6f9e272da724237e52f2f93f235ae78c5344a21a. A f*cking mess. See 1cdf6ade0eeac9515ed88ae0cd802fe119dd4249 Change-Id: Ia66edb96c9c34742300e882c2796870bfd9919d1
2015-10-26see if including cmath instead of math.h satisfies Android-ARMEike Rathke
Change-Id: Ie96f459dfe6d515ac92d89fcf6e6393a35bb97ac
2015-10-26Revert "attempted fix for android build"Stephan Bergmann
This reverts commit c3acead32e1d844b81e3e90c72549281d4bc73a2, now that cc906ec47eaaad247e8fbed5c9e6f3604a8b64c7 "The Android NDK for some reason don't have these math functions in std::" uses all the declarations from <math.h> instead of <cmath>.
2015-10-26Revert "sal: fix Android build"Miklos Vajna
This workaround is not needed after cc906ec47eaaad247e8fbed5c9e6f3604a8b64c7. This reverts commit d366d680cb62a2c5a7246e7290ef74c7e52eb04f.
2015-10-26sal: fix Android buildMiklos Vajna
Similar to 9a93277b869caca4db054385db59fc7b7d541570 (vcl: fix Android build, 2015-03-06), where the Android has a broken C++ library, having some functions in the global namespace instead of the std one. Work around the problem by using the std namespace till it gets fixed on the Android side. Change-Id: I3d423f42b4e8e325beb3661c1780378e5edf962d
2015-10-26The Android NDK for some reason don't have these math functions in std::Tor Lillqvist
Not even if one includes <cmath> instead of <math.h>. So just use the C functions then. Change-Id: Ic8499bc7bcd5c84b6e52e1d5dc799f9f058db816
2015-10-26attempted fix for android buildNoel Grandin
Change-Id: I47e5e3ebbbf55ae1fbbf2df85f9efbdd8bca1322
2015-10-25replace implementation of rtl_math_expm1() and rtl_math_log1p()Eike Rathke
... with ::std::expm1() and ::std::log1p() of C++11 Change-Id: I0d119958152ea372c136d28705686b44b39015bf Reviewed-on: https://gerrit.libreoffice.org/19588 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2015-10-24replace implementation of rtl_math_erf() and rtl_math_erfc()Eike Rathke
... with ::std::erf() and ::std::erfc() of C++11 Change-Id: I8ccc86ec4d6d71a92409770fc119f72e7084073a Reviewed-on: https://gerrit.libreoffice.org/19583 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2015-10-24implement Inf and NaN handling for rtl_math_expm1() and rtl_math_log1p()Eike Rathke
Change-Id: Ie424a6f038107ef8b574d0422efaf49b441c110f
2015-10-24implement proper Inf and NaN handling in rtl_math_erf() and rtl_math_erfc()Eike Rathke
Change-Id: Ib96d7123a3c483e9a1c78666bf042396510d733f
2015-10-24prevent endless recursion through rtl_math_erf* for Inf or NaNEike Rathke
Change-Id: If6eb273bc4d76f85da0844caea4bd697c6263013
2015-10-01remove old standalone Sun bug numbersNoel Grandin
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 Mohrhard
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-28by default use the system memory allocatorMarkus Mohrhard
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-18valgrind: memleak in randompoolCaolán McNamara
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-07-21loplugin:cstylecastNoel Grandin
Change-Id: If877cd61000fe6b82083a9fff79c25364d49e721
2015-07-20use osl_get_system_random data in rtlRamdomPoolNorbert Thiebaud
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-07performance tuning of rtl_ustr_indexOfAscii_WithLength()Norbert Thiebaud
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-06-30Coverity 1308555, 1308562, 1308600: Drop some SAL_THROW_EXTERN_CStephan Bergmann
...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-26loplugin:stringconstant: handle OUString+=OUString(literal)Stephan Bergmann
Change-Id: Ia304622214c47d35387dd0393db8e9afa55118f2
2015-06-26Add optimized OUString += literal overloadStephan Bergmann
Change-Id: Ib34196185f90204a71598f2c659c3fddce7a0e4d
2015-06-25Do not forget to actually set newStr to an empty stringStephan Bergmann
Change-Id: I745b09d8a248f08afdd3387f4cfcf69d71ec3c39
2015-06-23Implement full set of OUString::replaceFirst/All literal overloadsStephan Bergmann
Change-Id: I5f525d91ce24d1d2653a6855f1c4fffc039ae398
2015-06-08loplugin:cstylecast: deal with remaining pointer castsStephan Bergmann
Change-Id: Ibd373cddb1e25f05528e627349953b5f7d115330
2015-06-02-fsanitize=nonnull-attribute in memcpy callStephan Bergmann
Change-Id: If1f852ce4ef3419d663d4e2f4bdb4a57cc61e799
2015-05-29loplugin:redundantcast: Work around OS X memchr bugStephan Bergmann
...where in C++ memchr does not have exactly the two overloads void const * memchr(void const *, int, size_t) void * memchr(void *, int, size_t) but rather the C void * memchr(void const *, int, size_t) shining through (see bugreport.apple.com issue 21128245 "non-conforming memchr in C++"), which gets in the way of the upcoming improved redundant const_cast check in loplugin:redundantcast. Change-Id: I7001e74e03429ef23682d52da28fca435130d775
2015-04-20Clean up new rtl/surrogates.hStephan Bergmann
Change-Id: Iec781bdbbf216cb14c9ba5be5955123273d7699c
2015-04-20duplicate surrogate codeCaolán McNamara
Change-Id: I9fad024e4b5c8a4ca272f2387df07351198cf5dc
2015-03-31Use OUString::unacquiredStephan Bergmann
found with git grep -E '\* *\<reinterpret_cast\>[^>]+\<OUString\>' Change-Id: I9306d4ad8e3b1664f54cb7df86f2d79bfd3c6cb9
2015-03-31loplugin:redundantcastStephan Bergmann
Change-Id: I6c405287266572598a86b534552ed2f7bdff7fa2
2015-03-31V597: introduce a rtl_secureZeroMemoryCaolán McNamara
Change-Id: Id28046eb318cd3b2ed0b813fd266617547cf6ee2
2015-03-31Reduce to static_cast any reinterpret_cast from void pointersStephan Bergmann
Change-Id: Ic03728b2824eb59b9b6351a88ec355bfb93154cb
2015-03-28Clean up C-style casts from pointers to voidStephan Bergmann
Change-Id: I5e370445affbcd32b05588111f74590bf24f39d6
2015-03-26const_cast: convert some C-style casts and remove some redundant onesStephan Bergmann
Change-Id: I03e43d219a65aa270f73a91896e0e7a567d424bc
2015-03-02Turn function-like macro into true functionStephan Bergmann
Change-Id: I70330b1f4844f33779f814377afaf90e0a219b1d
2015-03-02typoStephan Bergmann
Change-Id: Ifc03631b126ec19cb98cb42a258ca4880e868385
2015-02-23tdf#88835 Calc: General format: 2 digits in exponentLaurent Balland-Poirier
Create 4 new formats enums rtl_math_StringFormat: rtl_math_StringFormat_E1, rtl_math_StringFormat_E2, rtl_math_StringFormat_G1, rtl_math_StringFormat_G2 to 1 or 2 digits in exponent for scientific notation. Set General format to use rtl_math_StringFormat_E2. Set trendline equation in status bar to use rtl_math_StringFormat_E1 Change-Id: I41466a6d4ba808ba5b9b38ba252b37c6b4560f12 Reviewed-on: https://gerrit.libreoffice.org/14562 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>