summaryrefslogtreecommitdiff
path: root/sal/osl/w32
AgeCommit message (Collapse)Author
2019-12-03WIN accept single-backslash file URIsJan-Marek Glogowski
From all I could find, a single (back-)slash file URI is fine as a local file path. This includes the commit "WIN enable NoAuthority test" (cherry picked from commit f9fd9d4cd4f792cd4ec8e14df78f3193653dae67) Change-Id: I75e95c809894cdef88f708d0477cb98eb114a107 Reviewed-on: https://gerrit.libreoffice.org/83837 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 895cd72158fc8a455f705764ae4ae000b933eba4) Reviewed-on: https://gerrit.libreoffice.org/83952
2019-11-11simplify OUString constructionNoel Grandin
Change-Id: Ib91d77c578aa21af02beaf299d16b5d8c2942f00 Reviewed-on: https://gerrit.libreoffice.org/82447 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-23-Werror,-Wdeprecated-volatile (clang-cl)Stephan Bergmann
same as b89187aad86e2be000d2f4c9c380a95bf8430c2e "Simplify forced memory reads" in sal/osl/unx/file.cxx Change-Id: I31edbc72f88895e148609498d367a50e38723b11 Reviewed-on: https://gerrit.libreoffice.org/81408 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Remove some memset callsMike Kaganski
Replace them with default initialization or calloc Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1 Reviewed-on: https://gerrit.libreoffice.org/80805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01loplugin:data (clang-cl)Stephan Bergmann
Change-Id: Ib8b2bc1c5f7b27a646036ce23cae2b6a06edd038 Reviewed-on: https://gerrit.libreoffice.org/79922 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01loplugin:simplifyconstruct (clang-cl)Stephan Bergmann
Change-Id: I08da288a88c2bce1d4250ec77f17bd483e6bc09c Reviewed-on: https://gerrit.libreoffice.org/79911 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-06Fixing "...."Andrea Gelmini
Change-Id: I3424e17cfdfb563fdc5882942031deafae8689fe Reviewed-on: https://gerrit.libreoffice.org/78678 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-30Replace is_soffice_Impl hack with a better(?) hackStephan Bergmann
...that involves adding a second, one-off special meaning to the existing sal_detail_initialize function. This at least gets rid of the "osl_getExecutableFile contains 'soffice' substring" guesswork (and of the osl_systemPathGetFileNameOrLastDirectoryPart call there, which is what I'm actually after, for a different change to come). Change-Id: I4dd6eef1fd0411bf66943ffea415876c92d08526 Reviewed-on: https://gerrit.libreoffice.org/78291 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-20Fix typosAndrea Gelmini
Change-Id: I5db25074d42fa22f3e36969cb561ad64c1e96dc1 Reviewed-on: https://gerrit.libreoffice.org/77760 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-02Fix typosAndrea Gelmini
Change-Id: Ie183c445bf8a545f59aac7b0e29f72ab679a6cf3 Reviewed-on: https://gerrit.libreoffice.org/76852 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-08-01Sometimes static checks are enough.Mike Kaganski
Change-Id: I61e7a28c5beab8f0c619767545009cefae6ddcd9 Reviewed-on: https://gerrit.libreoffice.org/76772 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-07-30Fix typosAndrea Gelmini
It passed "make check" Change-Id: I50c3639ec258c7fb6d73104f8e777f96995aa8e3 Reviewed-on: https://gerrit.libreoffice.org/76543 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-09Optimize osl_getSystemTime on WindowsMike Kaganski
Make OffTime static const; don't cast from FILETIME to __int64 (see https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime for explanation: "it can cause alignment faults on 64-bit Windows"). Instead, cast in opposite direction: from 8-byte-aligned 64-bit integer to FILETIME. Change-Id: Iba61cc0198f8f25ef471d87e661c8801724b913d Reviewed-on: https://gerrit.libreoffice.org/75256 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-06-03tdf#67538 XTypeDetection::queryTypeByDescriptor poor performance, part4Noel Grandin
WPXSvInputStreamImpl was hammering on getFilePos pretty hard, and getFilePos uses a mutex, which is slow when it is called from every single read. So switch to using std::atomic to access position. This is specifically fixing the performance of queryTypeByDescriptor when called from a basic macro on a local test file. This takes my test macro from 8s to 4s. Change-Id: Iab707a374359e2ee0e92425b2d9a903d67cb53d4 Reviewed-on: https://gerrit.libreoffice.org/73377 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-10an is used before a vowel soundCaolán McNamara
not before vowels with a consonant sound so its a url not an url Change-Id: Ic27ff3bee67469284d460c31ced6f63cb3633db2 Reviewed-on: https://gerrit.libreoffice.org/72062 Reviewed-by: Jens Carl <j.carl43@gmx.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-17tdf#124776: don't use SearchPathW to get full path of executableMike Kaganski
... use GetModuleFileNameW() for that. We call SetDllDirectoryW and SetSearchPathMode to improve security of the process, and exclude some paths (including current directory) from search when using API that looks for binaries whose names are not fully qualified. So the sequence is this: 1. Program is started using relative executable path like "instdir\program\soffice"; 2. sal_detail_initialize is called, which calls the two mentioned hardening functions; 3. sal_detail_initialize calls osl_setCommandArgs, which in turn calls osl_createCommandArgs_Impl; 4. The latter uses SearchPathW with empty path and first program arg "instdir\program\soffice" to find fully qualified program path. That now naturally fails, because current path is not searched. But to find the process name, we need no search: we can simply use GetModuleFileNameW() with NULL passed as module handle. Let's use that. Note that we can't use _wpgmptr/_get_wpgmptr, because we don't use wide entry point like wmain. Change-Id: I7a0013a0505f7bdd38164b09b045bfade9686664 Reviewed-on: https://gerrit.libreoffice.org/70844 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-05Replace legacy dynamically-loaded functions with statically linked onesMike Kaganski
We don't need the dynamic load complexity for these now with baseline Windows version being Windows 7 SP1. Stuff used only for compatibility with older versions was dumped. Change-Id: I810f271796cfd875cfa18a3081c9ad444fe57b3e Reviewed-on: https://gerrit.libreoffice.org/70321 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-01tdf#120703 PVS: Silence V522 warningsMike Kaganski
V522 There might be dereferencing of a potential null pointer. Change-Id: Ie617b41a8f8d334022cf5313b242a236baedba48 Reviewed-on: https://gerrit.libreoffice.org/70017 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-31tdf#120703 PVS: Silence V575 warningsMike Kaganski
V575 The potential null pointer is passed into 'foo' function Add asserts to those cases that are related to OOM cases. There's nothing to be done if the assertions fail anyway. Change-Id: I92ac95d44f512aa1948b1552b0e1f6da695a9f92 Reviewed-on: https://gerrit.libreoffice.org/70008 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-27loplugin:typedefparam (clang-cl)Stephan Bergmann
Change-Id: I07604028845c49cc084927e21db7f21c5d053bab Reviewed-on: https://gerrit.libreoffice.org/69796 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-18tdf#96038 Make shell function work with paths containing spacesRoland Baudin
Explanation of the patch: in the Windows version of LibreOffice, when calling the basic Shell(...) function (located in basic/source/runtime/methods.cxx), a function is_batch_file() is called in turn, to check if the program file path to execute is a batch or an executable. The function is_batch_file() is located in sal/osl/w32/procimpl.cxx and simply checks if the file extension is equal to bat (or cmd or btm). This works as expected, except when the file path contains space characters. In that case, the file path is *quoted* before the call to is_batch_file() and for a batch file the file extension becomes bat" (note the quote) instead of bat, and thus the call to is_batch_file() wrongly returns false in that case. In this patch, the issue is fixed by changing the function get_file_extension() to make it return the correct extension (i.e. without the '"' character) when the file name is quoted. Change-Id: Ib6e74da87b23d64db925c17f8a26617f1a86a83d Reviewed-on: https://gerrit.libreoffice.org/69230 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-26loplugin:indentation (clang-cl)Stephan Bergmann
Change-Id: I94689e4eed290b4505d2caba2d9802ef7fb6cffd Reviewed-on: https://gerrit.libreoffice.org/68378 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-26loplugin:simplifybool (clang-cl)Stephan Bergmann
Change-Id: Ia10e08c04fb6dfc18597fcfba3fe52cf0ba7184c Reviewed-on: https://gerrit.libreoffice.org/68377 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-22-Werror,-Wsign-compare (clang-cl)Stephan Bergmann
Change-Id: I7e9a709fe36b38ee8842dd34ab06f9608f498ec8 Reviewed-on: https://gerrit.libreoffice.org/68197 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-22error: expected parentheses around type name in sizeof expression (clang-cl)Stephan Bergmann
Change-Id: Ia4814242cc20fbfe35eaff95ddd64dd94e6d69af Reviewed-on: https://gerrit.libreoffice.org/68196 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-07Make osl_getLocalHostname thread-safeStephan Bergmann
Change-Id: I82b8c49fcbbec161bf968573e28992fa5737b45b Reviewed-on: https://gerrit.libreoffice.org/67508 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-05Improve osl_getLocalHostname on WindowsStephan Bergmann
...returning a non-dotted result obtained from gethostname in case trying via osl_createHostAddrByName doesn't work either. The code had been like this ever since its introduction with 74f3ed51f1e3fa7a199210fd6ffc69d78a535c08 "made socket and pipe refcounted, added blocking read write methods, added direct access methods for struct sockaddr", but there appears to be no good reason not to return the non-dotted gethostname value as a fallback (and it may just have been an oversight not to do so; and on e.g. Linux we simply return whatever a successful call to gethostname provides, be it dotted or not, ever since at least ebd00f5c46707e0dfcdd074f581ae86c0576e69b "socket.cxx -> socket.c", too). (Calls to osl_getLocalHostname are few across the code base, so this change in behavior is unlikely to cause any regressions. I came across this wile looking into <https://bugs.documentfoundation.org/show_bug.cgi?id=107461> "Does not support 'file://' scheme with actual hostname", but this change is unrelated to any potential fix for that issue. It just felt right to get this fixed in passing.) Change-Id: I78e59140579b9d37ee435a8f121e58544d2235eb Reviewed-on: https://gerrit.libreoffice.org/67390 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-31loplugin:unnecessaryparen (clang-cl)Stephan Bergmann
Change-Id: I0cd14e0ace9c9d2fcd880477b0485295e3010b71 Reviewed-on: https://gerrit.libreoffice.org/67138 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-30loplugin:redundantinline (clang-cl)Stephan Bergmann
Change-Id: Ib6320ddc049e93cca4c5931ad28d1873d34bd8b4 Reviewed-on: https://gerrit.libreoffice.org/67137 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-15tdf#98343 follow-up: don't fail on UNC prefixesMike Kaganski
Previously, it used to use FindFirstFile on initial parts of UNC paths, and failed, failing the whole path. Change-Id: Ibc4442e28da17625676695070ed7ddba619f9082 Reviewed-on: https://gerrit.libreoffice.org/65191 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-14tdf#98343: ensure PathRemoveFileSpec does not remove UNC's "\\"Mike Kaganski
PathRemoveFileSpec is used exclusively in GetCaseCorrectPathName(Ex). The GetCaseCorrectPathName function is only called for absolute or relative paths, not some arbitrary that chunks. So initial double backslashes are only possible for UNC paths. This change fixes handling of UNC paths by the functions. Previously, the UNC path was recursively shortened until it only consisted of a single "\"; then, if bCheckExistence was requested, testing this path failed, which resulted in the whole recursion to return empty result; else when returning from the recursion, original path components were appended, but initial double backslashes were never restored. This led to transformation "\\SERVER\Path\file.ext" to "\SERVER\Path\file.ext". The GetCaseCorrectPathName itself is only used in two places: osl_getSystemPathFromFileURL_() and osl_getFileStatus(). osl_getSystemPathFromFileURL_ only calls GetCaseCorrectPathName for paths longer than 248 characters; bCheckExistence is false. In that case, the resulting wrong path (missing one initial backslash) was then processed in /* it should be an UNC path, use the according prefix */ branch, where two initial characters of it were stripped, one of which being the first character of SERVER name. So, all the following manipulations with resulting path were incorrect. This code path was the reason for the bug. osl_getFileStatus calls GetCaseCorrectPathName always; it requires to check existence. This led to 0 returned from GetCaseCorrectPathName, then osl_getFileStatus continued with copying the original string, thus ignoring the error. Change-Id: If7409afa2c0dd6dd001c79e719acbfd271a6ab72 Reviewed-on: https://gerrit.libreoffice.org/65158 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-04tdf#34171: check foreign lockfiles to tell who has locked documentMike Kaganski
MS Office (Word/Excel/PowerPoint) lockfiles are supported now. Note that Excel does *not* create lockfiles for pre-OOXML files. This changes osl_openFile implementation on Windows, to treat osl_File_OpenFlag_NoLock to also include FILE_SHARE_DELETE flag for CreateFileW. This is required to allow opening files created with FILE_FLAG_DELETE_ON_CLOSE flag, such as Excel's owner files. The shange should be consistent with the overall meaning of the osl_File_OpenFlag_NoLock to not impose any locking constraints to the file being opened. Change-Id: I7b99012f4bd60ab3821fb91d5166a286031b7e93 Reviewed-on: https://gerrit.libreoffice.org/64496 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-22improve function-local statics in salNoel Grandin
Change-Id: I0853cf13162bae44cf8a5c44a4546a73f05772d9 Reviewed-on: https://gerrit.libreoffice.org/63780 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-10tdf#120703 PVS: silence a V555Mike Kaganski
V555 The expression '(curpos - bufpos) > 0' will work as 'curpos != bufpos'. Change-Id: I432c10c9c5ecc99293ec3f03f6e1a660e1c47e28 Reviewed-on: https://gerrit.libreoffice.org/63236 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-03tdf#120703 PVS: V547 Expression is always true/falseMike Kaganski
Change-Id: I27bf92770431f6a1f35e1c8224c0847555a8d43f Reviewed-on: https://gerrit.libreoffice.org/62819 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-28tdf#120703 PVS: V547 Expression is always true/falseMike Kaganski
Change-Id: Iaa1a1811b638aadfe6b06b3465a182cb675031b5 Reviewed-on: https://gerrit.libreoffice.org/62476 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-24remove more rtl::OUString and OString prefixesNoel Grandin
which seem to have snuck back in since the great rounds of removals. Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1 Reviewed-on: https://gerrit.libreoffice.org/62229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-21tdf#120703 (PVS): handle failed calloc/reallocMike Kaganski
V522 There might be dereferencing of a potential null pointer 'pProfile'. Check lines: 215, 213. V522 There might be dereferencing of a potential null pointer 'pFile'. Check lines: 1081, 1068. V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer 'pProfile->m_Lines' is lost. Consider assigning realloc() to a temporary pointer. V522 There might be dereferencing of a potential null pointer 'pProfile->m_Lines'. Check lines: 1328, 1324. V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer 'pProfile->m_Lines' is lost. Consider assigning realloc() to a temporary pointer. V522 There might be dereferencing of a potential null pointer 'pProfile->m_Lines'. Check lines: 1365, 1362. V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer 'pSection->m_Entries' is lost. Consider assigning realloc() to a temporary pointer. V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer 'pProfile->m_Sections' is lost. Consider assigning realloc() to a temporary pointer. V522 There might be dereferencing of a potential null pointer 'pProfile->m_Sections'. Check lines: 1540, 1536. Change-Id: Ib6c2c79c372120268f6101f639a3ed085534cca0 Reviewed-on: https://gerrit.libreoffice.org/62116 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-21tdf#120703 (PVS)Mike Kaganski
V522 There might be dereferencing of a potential null pointer 'pSecImpl'. Check lines: 81, 79. Check lines: 116, 114. Check lines: 175, 173. V522 There might be dereferencing of a potential null pointer 'pSecImpl->m_pNetResource'. Check lines: 176, 175. V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer 'pInfoBuffer' is lost. Consider assigning realloc() to a temporary pointer. V724 Converting type 'BOOL' to type 'sal_Bool' can lead to a loss of high-order bits. Non-zero value can become 'FALSE'. V522 There might be dereferencing of a potential null pointer 'Ident'. Check lines: 345, 340. V614 Potentially uninitialized buffer 'Name' used. Consider checking the second actual argument of the 'rtl_uString_newFromStr' function. Change-Id: Ieadc914d0f15e9c01621f8d7b5a7f8c0778c4498 Reviewed-on: https://gerrit.libreoffice.org/62090 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-09-27tdf#119238: keep replaced file's identity when renaming docfileMike Kaganski
Regression from 2157a3536f97ff5ae7c82611a801fef7e3708983 sfx2 store: try rename before copying Rename is cheaper then copying the content over manually, so try that first. On Windows, we need to keep the file's dentity, including metadata (e.g., creation time, which is kept in FS). WinAPI has ReplaceFileW specifically for this, and it keeps ACLs of the original file, and otherwise makes the changed file not a separate entry, but updated old file from system's PoV. Eventually, we could try to restructure creating backup copies (e.g., for documents when configured so) to take advantage of this function being able to do that. Change-Id: I6001a2a3af5e10bc010f5ef129f4bb6f83ee1581 Reviewed-on: https://gerrit.libreoffice.org/60163 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2018-09-24loplugin:external (clang-cl)Stephan Bergmann
Including: * expanding STDAPI to its definition (as per <https://msdn.microsoft.com/library/ms686631(vs.85).aspx> "STDAPI"), to add __declspec(dllexport) into its middle, in extensions/source/activex/so_activex.cxx; as discussed in the comments at <https://gerrit.libreoffice.org/#/c/60691/> "Get rid of Windows .def files in setup_native, use __declspec(dllexport)", having a function both listed in a .def file EXPORTS and marking it dllexport is OK, and the latter helps the heuristics of loplugin:external; however, the relevant functions in extensions/source/activex/so_activex.cxx probably don't even need to be exported in the first place? * follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191 Reviewed-on: https://gerrit.libreoffice.org/60938 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-08-Werror,-Wformat (clang-cl)Stephan Bergmann
...%d vs. DWORD aka unsigned long, but no need for sprintf anyway Change-Id: I7e97ada40abf7785a0678c76c76b547d6571f497 Reviewed-on: https://gerrit.libreoffice.org/60160 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-07Cppcheck: release the handle that CreateThread returnsMike Kaganski
Change-Id: I4d6d04873d69d2ff1e5409372b353e0bb9a5d68d Reviewed-on: https://gerrit.libreoffice.org/60120 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-08-29Use ConvertSidToStringSidW instead of composing SID string manuallyMike Kaganski
Change-Id: I0dc22130b5dec5eb2250c9625773b6c9720182a9 Reviewed-on: https://gerrit.libreoffice.org/59740 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-08-27directly use malloc/free in sal, instead of rtl_allocateMemory/etcNoel Grandin
now that those functions are entirely malloc/free based, we can skip a function call layer. Change-Id: Ib091de0bdf4cdd58cee45185df17d96d3e8af402 Reviewed-on: https://gerrit.libreoffice.org/59576 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-20Simplify containers iterations, tdf#96099 follow-upArkadiy Illarionov
Use range-based loop or replace with std::any_of, std::find and std::find_if where applicable. Change-Id: I2f80788c49d56094c29b102eb96a7a7c079567c6 Reviewed-on: https://gerrit.libreoffice.org/59143 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-06Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') in files formerly omitted for oversight or non-cxx extension Change-Id: I327c573f44076c6ccfecf737eafccba2da72e1bd Reviewed-on: https://gerrit.libreoffice.org/58600 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-01Replace rtl_cache_alloc/free with rtl_allocate/freeMemoryStephan Bergmann
...as with the combination of old ce906b8096081dee15dc8cc96e570d5b0b587955 "skip tricky allocators on G_SLICE=always-malloc" and recent bc6a5d8e79e7d0e7d75ac107aa8e6aa275e434e9 "Disable custom allocator", rtl_cache unconditionally just uses malloc/free now (see also db354dfad541fe2edd64a618a2d7cc83a6be2b9e "the custom SAL allocator is no longer used" and df6ba650469a6f2fda06ef1c2e107ccdd3570505 "Remove 'officially dead now' rtl_cache slab allocator mechanism"). So simplify the code. Change-Id: Ia665fd381ee4757e2c8b3d0460363bd34efd373a Reviewed-on: https://gerrit.libreoffice.org/58424 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-31the custom SAL allocator is no longer usedNoel Grandin
ever since commit bc6a5d8e79e7d0e7d75ac107aa8e6aa275e434e9 Date: Wed Nov 15 16:52:44 2017 +0530 Disable custom allocator which makes FORCE_SYSALLOC redundant which makes SYS_ALLOC redundant Change-Id: I42e1d651473e7601e2280d9fb0662c89808c88f6 Reviewed-on: https://gerrit.libreoffice.org/58263 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>