summaryrefslogtreecommitdiff
path: root/sal/rtl
AgeCommit message (Collapse)Author
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-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>
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-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-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-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-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-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-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-21Disable custom allocatorDennis Francis
This has big positive effect on software interpreter threading performance scaling. Change-Id: I8fbb6bf8f7ed410fd53278acee63bf65f13bac38
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-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-10-25ofz#3789 Integer-overflowCaolán McNamara
with input 69e9223372036854775807 Change-Id: Iaf5a85170d144be2db5604340d784a8982754e08 Reviewed-on: https://gerrit.libreoffice.org/43815 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-23loplugin:includeform: salStephan Bergmann
Change-Id: I539ca8b9dee5edc5fc2282a2b9b0ffd78bad8b11
2017-10-23overload std::hash for OUString and OStringNoel Grandin
no need to explicitly specify it anymore Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec Reviewed-on: https://gerrit.libreoffice.org/43567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-20Comment some values that 16 doesn't workEike Rathke
One of them was removed with e6611cc2ef5960e9f32c56da44fafd02446f53e6, reintroduce to prevent running into a dead end again. 16 or 17 digits will need some different approach. Change-Id: Iec213ed857121e323e13ee83763c51fa563c794f
2017-10-19tdf#113211: fix calculations with big integersMike Kaganski
... and munbers with few fractional bits Change-Id: I86c3e8021e803fed498fae768ded9c9e5337c8bd Reviewed-on: https://gerrit.libreoffice.org/43477 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-09-27SAL: use more Unicode on WindowsMike Kaganski
Change-Id: I9f54c8e8c4e617cc1ed6b436ca8c162d381ecab3 Reviewed-on: https://gerrit.libreoffice.org/42828 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-13New rtl::isUnicodeScalarValue, rtl::isSurrogateStephan Bergmann
There are apparently various places that want to check for a Unicode scalar value rather than for a Unicode code point. Changed those uses of rtl::isUnicodeCodePoint where that was obvious. (For changing svtools/source/svrtf/svparser.cxx see 8e0fb74dc01927b60d8b868548ef8fe1d7a80ce3 "Revert 'svtools: HTML import: don't put lone surrogates in OUString'".) Other uses of rtl::isUnicodeCodePoint might also want to use rtl::isUnicodeScalarValue instead. As a side effect, this change also introduces rtl::isSurrogate, which is useful in a few places as well. Change-Id: I9245f4f98b83877145a4d392f0ddb7c5d824a535
2017-09-04loplugin:unnecessaryparen include c++ castsNoel Grandin
Change-Id: I132d3c66f0562e2c37a02eaf4c168d06c2b473eb Reviewed-on: https://gerrit.libreoffice.org/41874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17remove UL/L suffixes from integer constants on the RHS of expressionsNoel Grandin
Change-Id: I899a8126c9d971601fea6c77eca165718aea0ac5 Reviewed-on: https://gerrit.libreoffice.org/41237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17remove UL/L suffixes from shift-by-constant expressionsNoel Grandin
Change-Id: Ia470f643e3eefeccc14183133603db260460bd53 Reviewed-on: https://gerrit.libreoffice.org/41212 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-11convert std::map::insert to std::map::emplace IINoel Grandin
Change-Id: Ief8bd59c903625ba65b75114b7b52c3b7ecbd331 Reviewed-on: https://gerrit.libreoffice.org/41019 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-23rtl: cleanup equality conditions in uuid.cxxChris Sherlock
Change-Id: I8918cd97f9ab89f0a2f7f95cd59b706ca5a55e2b
2017-07-23rtl: cleanup uri.cxxChris Sherlock
Change-Id: Ic9ddcaa7c699830216e157bd9dfc09d30b50b3e6
2017-07-23rtl: cleanup rtl_process.cxxChris Sherlock
Change-Id: I8640da0d5f44d69b9b628ac2076aec50b8e62ceb
2017-07-23rtl: remove comments, cleanup equality conditions in random.cxxChris Sherlock
Change-Id: I915aafe5a0df39b19e1f5bdc701cb9175dabb5ed
2017-07-23rtl: cleanup equality conditions in math.cxxChris Sherlock
Change-Id: I13d898479d883f7905d834c82dc778a9e4078375
2017-07-23rtl: cleanup equality conditions in locale.cxxChris Sherlock
Change-Id: I25833b65f89cc24ec2b62d4836f6c7c230c418aa
2017-07-23rtl: remove comment cruft from locale.cxxChris Sherlock
Change-Id: I0db5f31a85e03a0f262f22977dfd7a98090839c7
2017-07-23rtl: cleanup equality conditions in hash.cxxChris Sherlock
Change-Id: I163e1018009d4da49a15457e2cd2f433fd069a73
2017-07-23rtl: fix equality conditions in crc.cxx and digest.cxxChris Sherlock
Change-Id: I3408c2800a5cc41026e5fec8ef99c408e64d69ea
2017-07-23rtl: cleanup cipher.cxx equality conditionsChris Sherlock
Change-Id: I0b8084adea65f8c6a6e5e46b6628297fbd9eda9b
2017-07-23rtl: remove comment cruft from cipher.cxxChris Sherlock
Change-Id: I65d394d2947246b9919e072b06888dd744ef13f0
2017-07-23followup b714ba73c - remove excessive bracesChris Sherlock
Change-Id: I59fe131c6d14d9058fedaf89a2e9d5ceca444aa5
2017-07-22rtl: fix bootstrap formatting, comparison to nullptrChris Sherlock
Change-Id: I8d00e616a56cc3edac6ba2149fd6f9ae44c23a95
2017-07-22rtl: remove comparisons against nullptr from RTL mem filesChris Sherlock
Change-Id: Ic0ae0378d5b46b3d11c99aef2e845796ad0a9c71
2017-07-22rtl: remove comment cruft from alloc filesChris Sherlock
Change-Id: Ibac120af6879739091aacefef5c773649e222f85
2017-07-21migrate to boost::gettextCaolán McNamara
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-17RTL_UNICODETOTEXT_INFO_{DEST|SCR}BUFFERTOSMALL should use TOO, not TOChris Sherlock
I have kept the old mispelled constant for backwards compatibility Change-Id: I128a2eec76d00cc5ef058cd6a0c35a7474d2411e Reviewed-on: https://gerrit.libreoffice.org/39995 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-07-13use more OUString::operator== in forms..salNoel Grandin
Change-Id: I70d7e50f8c1e019524ccad915f0cca912c5035dc Reviewed-on: https://gerrit.libreoffice.org/39899 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-10teach unnecessaryparen loplugin about identifiersNoel Grandin
Change-Id: I5710b51e53779c222cec0bf08cd34bda330fec4b Reviewed-on: https://gerrit.libreoffice.org/39737 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-07loplugin:unnecessaryparen handle parens inside call exprNoel Grandin
stick to single-arg function calls, sometimes parens in multi-arg calls might be there for clarity Change-Id: Ib80190c571ce65b5d219a88056687042de749e74 Reviewed-on: https://gerrit.libreoffice.org/39676 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-06loplugin unnecessaryparan improvementsNoel Grandin
Change-Id: I73e945d6ec53537a0da45f6b6291018c7f251a7e Reviewed-on: https://gerrit.libreoffice.org/39587 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>