summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2017-05-09cleanup osl/diagnose.h includesJochen Nitschke
with command > git grep -l osl/diagnose.h *.cxx | xargs grep -L -w 'OSL_\w*' | xargs sed -i '/#include *\(<\|\"\)osl\/diagnose.h\(>\|\"\).*/d' headers need more work Change-Id: I906519ebbd47a04703b4fa5943b2f7abea7a97ab Reviewed-on: https://gerrit.libreoffice.org/37350 Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-05-07osl: remove comment cruft, whitespace cleanup of thread.cxxChris Sherlock
Change-Id: I4941e02b011b8e630b00d8a14703651d1f956563
2017-05-07osl: remove comment cruft, whitespace cleanup of process.cxxChris Sherlock
Change-Id: I9609306dfe70595e67ee6100ce236e849e7a3eca
2017-05-04Replace all OUString("") with OUString()Arnaud Versini
Change-Id: Ie14c4d76cb61cfbe0410103adfc1afc8ade0f3e0 Reviewed-on: https://gerrit.libreoffice.org/37146 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-03Work around GCC 7 mis-featureStephan Bergmann
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80354> "Poor support to silence -Wformat-truncation=1" Change-Id: I486f8a3a12896df3d9506f53bca44a318e23c991
2017-05-03remove empty commentsNoel Grandin
found with: git ls-files | xargs grep -Pzl '/\*\* (\*|\s| )*\*/' Change-Id: I1f47bcb94d5a7b290a6c622c6941195fbb578597 Reviewed-on: https://gerrit.libreoffice.org/37159 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-28loplugin:salunicodeliteral: salStephan Bergmann
Change-Id: I1b7c3f8de5b09c96e27aa9124096b00638afb3f3
2017-04-28loplugin:cppunitassertequals: salStephan Bergmann
Change-Id: I6ba9a18a1d227461e023259662635e3008ad7c9b
2017-04-27sal: cppunittester: verify that CPPUNIT_TEST_NAME contains a testMichael Stahl
Fail the test if CPPUNIT_TEST_NAME does not contain at least one existing test, which is much better than silently reporting OK(0). Change-Id: If2137764b24aa52dc35fe2368ee8fe38cb7dbece
2017-04-26loplugin:redundantcast (clang-cl)Stephan Bergmann
Change-Id: I5164bc1bfa1aaae0f648e0384227d92c8b2ff7a3
2017-04-26loplugin:useuniqueptr (clang-cl)Stephan Bergmann
Change-Id: I491fb1fdcc3f5f64e4adb7276217bbdc13a1fa19
2017-04-26-Werror,-Wunused-macros (clang-cl)Stephan Bergmann
Change-Id: I64fa44caecd3f86bd23dc625e72c134659610b1a
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-24clang-tidy readability-simplify-boolean-expr in oox..salNoel Grandin
Change-Id: I1e14e5b15d2dd9e35477f8189cbecf0b443b9381 Reviewed-on: https://gerrit.libreoffice.org/36875 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-21gbuild: Remove MSVC 2013 legacy codeDavid Ostrovsky
Uwinapi is discontinued. Change-Id: I063b4d0d8fab2d60de168e960a63b8181158ac01 Reviewed-on: https://gerrit.libreoffice.org/23198 Reviewed-by: David Ostrovsky <david@ostrovsky.org> Tested-by: David Ostrovsky <david@ostrovsky.org>
2017-04-21Make HASHID work whenever there is std::hash<pthread_t>Stephan Bergmann
Change-Id: I78aecfc7c0ea4ad4467417015bf41b809dbcda83
2017-04-20Simplify PTHREAD_VALUEStephan Bergmann
The distinction between MACOSX and other had been introduced with ed8110e101db5a8ea4dde43a3ec38fe40e6fe7e2 "Avoid reinterpret_cast to same type" to work around a GCC 4.6 bug that is fixed since GCC 4.7. Change-Id: I7948721d311de2622c1e08e2ee17b5ccc304b51b
2017-04-20Avoid loplugin:redundantcast on macOSStephan Bergmann
Change-Id: I5e9f2552f83e72d1f6eb1a12df19c0fdfa012e31
2017-04-16try to fix werror + pch build on linuxMarkus Mohrhard
This should fix RandomConfig tb run #396 Change-Id: Idd7984e3c4225b08db50b2451112135aaf2e1890 Reviewed-on: https://gerrit.libreoffice.org/36584 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-04-13Removed duplicated includesAndrea Gelmini
No automatic tools. Manual checked and tested. Change-Id: Ife260fa4e1d786cf81f2917a901664cc54943754 Reviewed-on: https://gerrit.libreoffice.org/36371 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-12clang-tidy: readability-else-after-returnNoel Grandin
run it against sal,cppu,cppuhelper I had to run this multiple times to catch all the cases in each module, and it requires some hand-tweaking of the resulting output - clang-tidy is not very good about cleaning up trailing spaces, and aligning things nicely. Change-Id: I00336345f5f036e12422b98d66526509380c497a Reviewed-on: https://gerrit.libreoffice.org/36194 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-06Improved loplugin:redundantcast, static_cast on arithmetic types: salStephan Bergmann
Change-Id: I7caadbc06b2266800666151de75d799c42148aca
2017-04-04ofz#770 JOHAB_73 table starts at 0xA not 0x2Caolán McNamara
the start value is out by one row Change-Id: I77ed154358516ccd47a090cf7ed45bb609bc81a3 Reviewed-on: https://gerrit.libreoffice.org/34992 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-04Finally switch MSVC to sal_Unicode = char16_t, tooStephan Bergmann
There is lots of (Windows-only) code that relied on sal_Unicode being the same as wchar_t, and the best change may be different in each case (and doing the changes may be somewhat error prone). So for now add SAL_U/SAL_W scaffolding functions to sal/types.h, remove their uses one by one again, and finally drop those functions again. Change-Id: I2cc791bd941d089901abb5f6fc2f05fbc49e65ea Reviewed-on: https://gerrit.libreoffice.org/36077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-30remove type decorations on char literalsJochen Nitschke
they are only needed where type deduction fails. left them in defines for now. Change-Id: I7f002dd6bc7acc083c73b6c64076de6dd28d0b09 Reviewed-on: https://gerrit.libreoffice.org/35893 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-30loplugin:loopvartoosmallStephan Bergmann
Change-Id: If714cafd9f2786610a03b1f5f6466a9ea06e46e6
2017-03-30loplugin:redundantcastStephan Bergmann
(only triggers on macOS, as on Linux unistd.h declares lseek with a return type of intermediary __off_t/__off64_t typedefs) Change-Id: I967e472a050ad624a6411947b10c962ac8f66bed
2017-03-25Fix typosAndrea Gelmini
Change-Id: I5fc62060e7d01c6b492a0e91323f753cc676bf71 Reviewed-on: https://gerrit.libreoffice.org/35639 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-24Various loplugin warnings (clang-cl)Stephan Bergmann
Change-Id: I7969250f330d2df02c4ea909115b3028fdc36223
2017-03-24Handle "POSIX" in parse_locale, 2nd attemptStephan Bergmann
...with the silly errors fixed past 61ecebe0d0febe8429d965355356a9f0f34b323b "Revert 'Handle 'POSIX' in parse_locale'" Change-Id: I0b8e4de0377b92b8cb96efa13e4b39316ffbf707
2017-03-23Remove unused #include <ctype.h>Stephan Bergmann
Change-Id: I8bf3e30687e20151a9e1936e69362abfe9b3a99d
2017-03-23Revert "Handle "POSIX" in parse_locale"Stephan Bergmann
This reverts commit 646cbbfbc67b07d5f58166228bca1ac710175cd0 for now. Appears that it made CppunitTest_sal_osl fail at least on some macOS builds, for reasons not yet clear to me
2017-03-23Handle "POSIX" in parse_localeStephan Bergmann
Change-Id: Ib3ce9efd2933170777689db152d35f586f5afe2d
2017-03-22Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char)Stephan Bergmann
Change-Id: I93eeb586310cb1896b067b7c665e1fdee92d47b4
2017-03-22Don't actually change OS-level locale with (unused) osl_setSystemLocaleStephan Bergmann
osl_setSystemLocale was introduced with af2938348bb539ccb27c92fe286b768d4143f662 "#88460# added osl_getProcessLocale and osl_setProcessLocale" but never actually used. So mark it as deprecated and, in the sal/osl/unx/ case, don't make it set the OS-level locale via imp_setProcessLocale (calling setlocale or setting the LC_ALL/LC_CTYPE/LANG env vars), same as in the sal/osl/w32/ case. Change-Id: I33348dba5de8ca80ca6fca210043286c0cfa9145
2017-03-22Prevent calls to rtl/character.hxx functions with (signed) char argumentsStephan Bergmann
...that would implicitly be sign extended (for plain char only if it is signed), so non-ASCII char values would trigger the isUnicodeCodePoint assert. Change-Id: Iaf8024ad509e64525558e882fe3fd078cfb4ea91 Reviewed-on: https://gerrit.libreoffice.org/35523 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-22Comment clean-up that was inadvertently missing from previous commitStephan Bergmann
Change-Id: I5eb0758f84495a8410260f61ff645a086efb1ca7
2017-03-22Use nl_langinfo_l instead of setlocale+nl_langinfoStephan Bergmann
...as the former is less of an MT nightmare (nl_langinfo_l can only conflict with calls to nl_langinfo in other threads, not with calls to nl_langinfo_l in other threads, so since this was the last remaining use of nl_langinfo in LO itself after a7cdba3a0e48360e2ed549e9d8996fe41460df70 "Use nl_langinfo_l with an explicitly created locale" things should be safer now; also, setlocale was an MT problem, of course, inadequately atempted to be addressed with that aLocaleMutex). Hopefully, all relevant platforms that support nl_langinfo also support nl_langinfo_l (where both are POSIX). Change-Id: I28a18bc4ffa930e3f2e949634dae161377e2911c
2017-03-21Argument to parse_locale is never nullStephan Bergmann
Change-Id: I610d3637f4a4520ef4eefed29851727f519de02c
2017-03-21On Linux etc., obtain locale value from env vars instead of setlocaleStephan Bergmann
setlocale has the drawbacks that it is racy and that it sets global state, so better avoid it. The way LC_ALL, LC_CTYPE, LANG are honoured is as suggested by SUSv4, then falling back to "C". Change-Id: I606ecc01d37a0a9067a90e6dcce098009094493c
2017-03-17cleanup double includes and declarationsJochen Nitschke
Change-Id: I770e09f48b1a3e8299f59a8e475ba3c18d436d7b Reviewed-on: https://gerrit.libreoffice.org/35312 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-03-16Fix typosAndrea Gelmini
Change-Id: I1488e2147fa0cd4a821eb5bfe172a58a4e396ace Reviewed-on: https://gerrit.libreoffice.org/35224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2017-03-15improve the breakpad signal handler in dbgutil buildsMarkus Mohrhard
Change-Id: I253058dbfc9e156bc778c23d491b642c538606f2 Reviewed-on: https://gerrit.libreoffice.org/35227 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-03-15workaround for breakpad signal handler on linuxMarkus Mohrhard
The breakpad signal handler is overwritten by our own signal handler during startup. As a workaround we use the same approach as in the windows code and add call the old signal handler if a crash was registered. Change-Id: I1179fd9cba851734aa1686168f231cf68de57c1a Reviewed-on: https://gerrit.libreoffice.org/35226 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-03-15tdf#106489 - Win32 version of osl_terminateProcess not "safe"Chris Sherlock
The current Win32 implementation of osl_terminateProcess calls directly upon the Win32 TerminateProcess() API function. When I looked up this function on MSDN I was a bit surprised to note that this is an asynchronous function that returns immediately before the process actually fully terminates, and does not necessarily succeed cleanly. As we are not checking that the process actually fully terminates, this is a bit of a problem, albeit one I think may well be somewhat obscure and non-obvious. In fact, it is better that we call on TerminateProcess() and use WaitForSingleObject() until the process actually fully terminates. If the termination ends abnormally, then we should pass a more appropriate exit status. Dr Dobbs magazine, bless its ancient archive, details a "safe" version of TerminateProcess(), which has been implemented it seems in dozens of projects already so it's basically at this point a pattern. The article can be found here: http://www.drdobbs.com/a-safer-alternative-to-terminateprocess/184416547 Thankfully, the flaws they point out are only valid due to the age of the article as the Windows 9x line of operating systems was still a thing way back then :-) Changes that are made: 1. If the PID is 0x0 then this can't be ended, so return an invalid status 2. We need to elevate access to the process handle to allow it to create a new thread in a potentially remote process, so we use DuplicateHandle to do so 3. The core change is to change from TerminateProcess() to ExitProcess(), I'm letting it timeout forever and the end user can kill off the process via a Windows process management tool if they need it killed entirely, hence WaitForSingleObject() has an infinite timeout. This way, the termination handler is now called and the attached dlls are notified that they are being detached from the process. Change-Id: Icfa7c60c35a088b8f9834351bc7953a910247fb8 Reviewed-on: https://gerrit.libreoffice.org/35071 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-03-06drop various _MSC_VER < 1900 conditionalsCaolán McNamara
Change-Id: I68d93b260db1f542bb3b44858b61b2d30ae93530 Reviewed-on: https://gerrit.libreoffice.org/34856 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-04Change sal/osl/w32/*.h -> *.hxxStephan Bergmann
...which are now only ever included from C++ code. Drop extern "C" where appropriate (i.e., generally everywhere) and fix the occasional ensuing loplugin warning. (But no further C++'ification for now.) Change-Id: I78830692888ee0ae0cac49878042effad2d6707f Reviewed-on: https://gerrit.libreoffice.org/34865 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-04Change sal/osl/w32/dllentry.c -> .cxxStephan Bergmann
Change-Id: I55f8bedd9b578053413b5e3404010301d01b7961 Reviewed-on: https://gerrit.libreoffice.org/34861 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-04Change sal/osl/w32/*.c -> *.cxxStephan Bergmann
...and fix any ensuing errors/warnings, but no further C++'ification. Not sure whether any parts of dllentry.c would need to be extern "C", so leaving that one alone for now. TODO: Put definition of _CRT_RAND_S into bin/update_pch, so it doesn't get removed again from sal/inc/pch/precompiled_sal.hxx. (For the surrounding #ifndef see 244d22a3d27b303d44f59296a19dc4cb31fd429d "Work around -Werror,-Wunused-macros with clang-cl".) Change-Id: I2ada3717845eb0be0c559465d68e00e3a7720156 Reviewed-on: https://gerrit.libreoffice.org/34860 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-03Remove redundant 'inline' keywordStephan Bergmann
...from function definitions occurring within class definitions. Done with a rewriting Clang plugin (to be pushed later). Change-Id: I9c6f2818a57ccdb361548895a7743107cbacdff8 Reviewed-on: https://gerrit.libreoffice.org/34874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>