summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)AuthorFilesLines
2016-03-09tdf#98210 do not require R_OK for pipe dirHank Leininger1-2/+2
Also better error handling if pipe dirs are really not usable. Change-Id: I1c865b9a9f1f08d2cffd07343494feca585ec75e Reviewed-on: https://gerrit.libreoffice.org/22727 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> (cherry picked from commit 87c011134031374cf9104ec2fc39ef121d8a6802) Reviewed-on: https://gerrit.libreoffice.org/22829 Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-09sal: UNX: in oslDoCopy, rename into destination directory ...Michael Stahl1-1/+2
... not into the source one as that will likely fail with EXDEV if source and target are on different mounts => osl_File_E_EXIST. This broke the xmlsecurity test SigningTest::testOOXMLAppend(). Change-Id: I07ada1d5564fd72a059d588e127a5906a499aca4 (cherry picked from commit a2fb2cfd45452512fb1d3e79b3cc1f4c7cef2e77) Reviewed-on: https://gerrit.libreoffice.org/23014 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-02-22WaE vs2015: pointer to int castingNorbert Thiebaud1-1/+1
Change-Id: I3be393ef5a9d1ed732f44037cd1115960a6186d2 Reviewed-on: https://gerrit.libreoffice.org/22592 Reviewed-by: David Ostrovsky <david@ostrovsky.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> (cherry picked from commit 3496535a3754438f314b7b143e7223b498ca3ec9) Signed-off-by: Michael Stahl <mstahl@redhat.com>
2016-02-22WaE vs2015: int to pointer castingNorbert Thiebaud1-1/+1
Change-Id: I201e4b44e2a26ff0566f30c7e7c12c0df90a54e6 Reviewed-on: https://gerrit.libreoffice.org/22591 Reviewed-by: David Ostrovsky <david@ostrovsky.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> (cherry picked from commit eb4efbc15d25dd6d00c6b7ead02bdf197121623e) Signed-off-by: Michael Stahl <mstahl@redhat.com>
2016-01-15tdf#96918 display accurate integer double values up to (2^53)-1Eike Rathke2-0/+137
(cherry picked from commit 0f6203edf74832f84d8263d7a544d679203a4efc) unit test for tdf#96918 display accurate integer double values (cherry picked from commit a3f5f4f6369552a3da870de1ed4ea9d8c628c7a8) 619e0cb0fbbfd0dfba3b2fe9c3476be55a3eea8e sal: as always C++ is too stupid to deduce parameter types of min (cherry picked from commit 2d526a9ffbad7effaabb70f4e52904c09d0ab22b) b00f29a6024e22c65a30bf4a45332e550994f03f loplugin:defaultparams (cherry picked from commit 036b4a366ecc7ea343a3fedee268463d6576cb32) Keep MSVC happy (warning C4305 when converting 9007199254740993 from __int64 to double) (cherry picked from commit e5d393cf0edc5d871cfe1aea6acede482eecec84) handle negative decimal places for rounding, tdf#96918 related (cherry picked from commit fdf982f70b2944053d995baaa3d78c7cdc4bbc4b) unit test for negative decimal places rounding, tdf#96918 related (cherry picked from commit 5299400e5cce3060a0de85bb4dedd065b5ad1f41) use getN10Exp(x) instead of pow(10.0,x) (cherry picked from commit e6c9bdfdc181c95d5757b96b6194d639a0df3c79) use ::std::swap() to reverse buffer (cherry picked from commit f19b4826c44e9e5f54b968fef59a3fcd3007d522) 0e2b92a01ba5ae1824d609ee2e557f1a1cc85cbd fa423eabc64ead519c4f4a3370a06e88ea5c7466 b2f3ffaa7c4216b66479c750465c2beab927405a b7e49126cbffc510fa941c25a8d57222bad51c46 7e18e57636416f0a3ed96c2fa3adc004fb3ba013 507a16e1d87460dead79b78621202c68ee12c2c8 Change-Id: I42001583c72bc3faab94489a4eabfa183cab5ae2 Reviewed-on: https://gerrit.libreoffice.org/21429 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-11-24cppcheck: noExplicitConstructorCaolán McNamara2-10/+10
Change-Id: I1934441858baeeb41a46f694dbcef2d846b308b7
2015-11-17Don't assume sal_Unicode is unsigned shortStephan Bergmann1-1/+2
Change-Id: I27da462b553ef11e9d9ce7873e8fedc3af8c6041
2015-11-15Fast PCH generator and optimized PCH filesAshod Nakashian1-70/+30
Ported update_pch.sh to Python with improved performance and features. The new script is invoked from the same update_pch.sh which calls it for each library in parallel, although it can be invoked directly. The ported script (update_pch) updates all PCH files in ~15 seconds where the old script took ~4500 seconds. In addition, the new script supports 3-tiered headers (system, module, and local) and is very flexible to support other improvement. It has a per-library optimal configuration settings that can be updated using another new scripts (update_pch_autotune.sh) which finds optimal per-PCH settings. PCH files have been generated using the new scripts which builds significantly faster (2-3x, depending on module and configuration) and the intermediate binaries are noticably smaller (by several GBs). The new script stamps each generated PCH file with the command that generated it to make it trivial for users to update them, and also adds the command to invoke another script (update_pch_bisect) that helps find missing headers or conflicting headers that may break the build after updating the PCH. Finally update_pch has built-in unit-tests for makefile parsing and other core functionality. Change-Id: Ib933b50e50374d7e2e7e3e95ba8799b0cc8a27fa Reviewed-on: https://gerrit.libreoffice.org/19965 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-11-13cppcheck: noExplicitConstructorCaolán McNamara2-2/+2
Change-Id: Ife26f55c28c4631aec4ba4105225bfca72da8bff
2015-11-13-Werror,-Wunused-const-variableStephan Bergmann1-0/+2
Change-Id: I3ef314594b64a54aca389816fd9bf5ba0721b397
2015-11-12-Werror,-Wunused-functionStephan Bergmann1-0/+2
Change-Id: Ic12b2914b4f39a96d1455dc280c97d64639b9849
2015-11-12-Werror,-Wextern-initializerStephan Bergmann1-1/+1
Change-Id: I334c0a5004fa417f1cb3b1e768988644c712be7f
2015-11-12-Werror,-Wincompatible-pointer-typesStephan Bergmann1-1/+1
Change-Id: If126707fe637917a5f73950c751a97c30ad2e692
2015-11-12-Werror,-Wparentheses-equalityStephan Bergmann1-1/+1
Change-Id: I1c85127f02697d39f17d4d5f52cb997352886701
2015-11-12-Werror,-Wunused-functionStephan Bergmann1-6/+0
Change-Id: I7fd09e4595be82ebd292042b09cc4c3e96b59d66
2015-11-12-Werror,-Winconsistent-dllimportStephan Bergmann1-1/+1
> sal/systools/win32/uwinapi/legacy.c(21,14) : error: 'GetShortPathNameW' redeclared without 'dllimport' attribute: previous 'dllimport' ignored [-Werror,-Winconsistent-dllimport] > DWORD WINAPI GetShortPathNameW(LPCWSTR lpszLongPath,LPWSTR lpszShortPath,DWORD cchBuffer) > ^ > C:/PROGRA~2/WI3CF2~1/8.1/include/um\fileapi.h(780,1) : note: previous declaration is here > GetShortPathNameW( > ^ > C:/PROGRA~2/WI3CF2~1/8.1/include/um\fileapi.h(776,1) : note: previous attribute is here > WINBASEAPI > ^ > C:/PROGRA~2/WI3CF2~1/8.1/include/shared\apisetcconv.h(22,20) : note: expanded from macro 'WINBASEAPI' > #define WINBASEAPI DECLSPEC_IMPORT > ^ > C:/PROGRA~2/WI3CF2~1/8.1/include/um\winnt.h(175,36) : note: expanded from macro 'DECLSPEC_IMPORT' > #define DECLSPEC_IMPORT __declspec(dllimport) > ^ Change-Id: Ifb0d3179bca9da192afc0af4e731a799f6d392b2
2015-11-12Work around Coverity warnings about std::length_errorStephan Bergmann1-2/+8
...escaping from main or being unexpected, in various places, which started when 62dbe2e6eb30660f252b4e2c048f4aecf28e41c6 "Clean up osl_getSystemPathFromFileURL implementation" made osl_getSystemPathFromFileURL (indirectly) call rtl_uString_newConcatAsciiL, which can throw std::length_error. There is no ideal fix for this. "The distinguishing characteristic of logic errors [i.e., incl. std::length_error] is that they are due to errors in the internal logic of the program. In theory, they are preventable." ([std.exceptions]) That means that throwing a logic error is more akin to raising an assert than to throwing some other kind or exception that is intended to be handled by the program. Which in turn means that it would generally be more useful to cause such errors to cause calls to std::abort (and produce a core/backtrace), than to catch and try to somehow handle them. But there appears to be no way to tell Coverity not to emit warnings about uncaught logic errors, and it tends to emit quite a number of them for each signle "root cause," so be pragmatic for now and catch it close to the root. Change-Id: Iee71f50e3304954e9e88f326e0fa2167b6051ca2
2015-11-12Windows header sanitizationAshod Nakashian5-189/+189
Isolation of windows headers using prewin.h and postwin.h headers and making headers dependent on them more self contained. Conversion of TCHAR to WCHAR and LPCTSTR to LPCWSTR etc. and cleanup of unnecessary casts. Change-Id: I7eff5c477d9223a064bfb4d962ff6d61960ee69c Reviewed-on: https://gerrit.libreoffice.org/19901 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-11-10loplugin:nullptr (automatic rewrite; Mac-specific code)Stephan Bergmann7-31/+31
Change-Id: I4e6979a5c59ee8a6ad1d55484c0c3ad3c32adce6
2015-11-10Fix SAL_W32Stephan Bergmann1-0/+4
Change-Id: I60333e2b0f71c38aa13e6a6665c2a305e6dc08fa
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann99-5979/+5979
Change-Id: I1bc6c87fcd6e5e96362623be94c59be216a3b2b8
2015-11-09Prevent += called on temporary O[U]String instancesStephan Bergmann1-2/+8
...found regression e31205f3ec1f941ab5a188bfde6329edf2acc55b "EditUndoRemoveChars::GetStr must return a reference" and dubious code 0e23f7b0839df68d277186b4df54ba391ac3406a "Lets assume this doesn't want to update m_pForcedPrefix->GetText() anyway" in addition to the apparent sillies directly fixed in this commit. Introduces HAVE_CXX11_REF_QUALIFIER. Change-Id: I564e98254fd53c1dd9b34193d7057c59721ee24c
2015-11-06Remove additional empty line from license headerStephan Bergmann1-1/+0
Change-Id: Ic185d7bc3dc6f8a41c71b83d8bfa293ed4236937
2015-11-06rtl::Reference Add move construction/assignmentDaniel Robertson3-0/+135
Add move constructor and appropriately overloaded assignment operator to rtl::Reference, and add basic unit tests for the reference counting of rtl::Reference. Change-Id: Ia7ff5d786bdf3b17709cec06608c91e22379746c Reviewed-on: https://gerrit.libreoffice.org/19762 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2015-11-06loplugin:stringconstant: elide explicit ctor usage (manually due to macros)Stephan Bergmann1-3/+3
Change-Id: I9d67d5ddb9bf90e1b216a7282774543c9de874c3
2015-11-06loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)Stephan Bergmann2-12/+12
Change-Id: I95283ccf78e4ca699e88ea226d38153a8a92845a
2015-11-04Resurrect CppunitTest_sal_osl_getsystempathfromfileurlStephan Bergmann2-3/+248
Change-Id: I41007c46e945f4fe19a6dd197fded9fa503bf8c4 Reviewed-on: https://gerrit.libreoffice.org/19771 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2015-11-04Handle URLs with query or fragment (or containing NUL chars)Stephan Bergmann1-0/+5
Change-Id: Ib6ba723b59fb5af69b45456a19e1bff085a75c92 Reviewed-on: https://gerrit.libreoffice.org/19775 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2015-11-04Clean up osl_getSystemPathFromFileURL implementationStephan Bergmann1-119/+97
Change-Id: I2daa355c4a46c4edc73c30185f2b31852351c45f
2015-11-03Solved CID 1338058 and CID 1338057jan iversen1-0/+2
terminated buf correctly before calling printf. This should be done automatically but coverity does not see it. Change-Id: I0bcf8486b27dbfa9f7c49b338bbf483029b523cb Reviewed-on: https://gerrit.libreoffice.org/19751 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2015-11-02Clean up osl_getSystemPathFromFileURL handling of relative //... URLsStephan Bergmann1-2/+7
(i.e., starting with an authority component); treating input starting with a single slash (i.e., starting with an absolute path component) as a relative URL instead of as an absolute pathname would cause e.g. CppunitTest_sal_osl_file to fail Change-Id: Ie340881974c5e9451ab7e0a9bfb21176b8f5666d
2015-11-02Resolve OSLTEST_DECLARE, OSLTEST_DECLARE_UTF8 macrosStephan Bergmann2-71/+58
...and use something more direct than rtl::Uri::decode for the UTF8 case Change-Id: I2f37d371c425dff6b068e3120be485e71b8e9e12
2015-11-02Remove long-unused sal/qa/osl/socket/ test code for goodStephan Bergmann20-8932/+0
Change-Id: I2614e6c9f6d0a31866cb9821910da7f3e31377c6
2015-11-02loplugin:stringconstantNoel Grandin3-5/+5
Change-Id: Id051dd984c24fb34dcc89060ed11955fed61fd48
2015-11-02Fix CppunitTest_sal_osl_pipeStephan Bergmann1-0/+2
Change-Id: I8b092d7e5132e2462b7fe9981f81a41543ca8694
2015-10-30Fix osl_getSystemPathFromFileURL URL scheme checkStephan Bergmann1-7/+20
Change-Id: If7737b9eaf11333facd9ae3faf58e36ba76c3b05
2015-10-30sal: loplugin:salboolMichael Stahl1-4/+4
Change-Id: I8fa83df0bf5f6064dcdd3f830769d7626152c7ab
2015-10-30Combine individual gb_Module_add_check_targets, and sortStephan Bergmann1-20/+12
Change-Id: Ia625a33371d2278bd89274ed5ee18acb773810cf
2015-10-30CppunitTest_sal_osl_pipe can be added to gb_Module_add_check_targets nowStephan Bergmann1-5/+1
Change-Id: I13522370b2bd0ea1907660a55a74e830335ca4a4 Reviewed-on: https://gerrit.libreoffice.org/19686 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2015-10-30Various loplugin clean upStephan Bergmann1-69/+48
Change-Id: I94279c923624021c2420e893aac1aea5b9a802f9
2015-10-28com::sun::star->css in sal,saxNoel Grandin1-2/+2
Change-Id: I24e202b1f8071fe918e4e164b5fa1c08a561cb24 Reviewed-on: https://gerrit.libreoffice.org/19626 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-26Revert "see if including cmath instead of math.h satisfies Android-ARM"Eike Rathke1-1/+1
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 Rathke1-1/+1
Change-Id: Ie96f459dfe6d515ac92d89fcf6e6393a35bb97ac
2015-10-26Revert "attempted fix for android build"Stephan Bergmann1-1/+0
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 Vajna1-2/+0
This workaround is not needed after cc906ec47eaaad247e8fbed5c9e6f3604a8b64c7. This reverts commit d366d680cb62a2c5a7246e7290ef74c7e52eb04f.
2015-10-26sal: fix Android buildMiklos Vajna1-0/+2
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 Lillqvist1-4/+4
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 Grandin1-0/+1
Change-Id: I47e5e3ebbbf55ae1fbbf2df85f9efbdd8bca1322
2015-10-25tdf#39440: fix several warnings reported by cppcheckSerge Krot1-1/+1
Change-Id: I560d28b7cc67740c6479494d0e5aa62d2ac6ffae Reviewed-on: https://gerrit.libreoffice.org/19587 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2015-10-25replace implementation of rtl_math_expm1() and rtl_math_log1p()Eike Rathke1-59/+2
... 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>