summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2013-04-25Use InterlockedIncrement() and InterlockedDecrement() unconditionallyTor Lillqvist
Much simpler. Cherry-picked from commit 0a21cce0c90a639918d8e58ac5daa4b8f674666f and modified slightly to apply.
2013-02-15rhbz#908674: Adapt rtl::Allocator::construct to C++11Stephan Bergmann
...otherwise, at least with some --with-system-boost versions and C++11 compilers, like with Fedora's boost-1.50.0-4.fc18.x86_64 and gcc-c++-4.7.2-8.fc18.x86_64, using this to copy-construct an instance of boost::unordered::detail::ptr_node<std::pair<rtl::OUString,Bootstrap_Impl*>> in the call to p_bootstrap_map->insert(...) in rtl_bootstrap_args_open (sal/rtl/source/bootstrap.cxx) would memcopy the ptr_node and fail to call rtl_uString_acquire, leading to memory corruption later on when rtl_uString_release is called one time too often. It is not entirely clear to me whether this is a shortcoming of the given Boost version, but this patch solves the problem and brings rtl::Allocator::construct in line with the (changed) Allocator requirements of C++11 anyway. The problem potentially lurks with every use of rtl::Allocator, but only showed now begining with LO 4.0 where e5111574fd904b38a3980ca4ea3d21cfcb22dea6 "Revert 'sb140: sb140: #i116981# clean up memory upon exit'" re-introduced code into rtl_bootstrap_args_open that inserts into a boost::unordered_map that uses rtl::Allocator. (cherry picked from commit c91d353872b7d4e1a39192bff1444b46cab6e5eb) Conflicts: config_host/config_global.h.in ...solved by resorting to the old -DHAVE_CXX11_PERFECT_FORWARDING logic spread across various solenv/.../*.mk instead. Change-Id: I3be22f59a8eb49d31458480c27f3ce15803c7fd4 Reviewed-on: https://gerrit.libreoffice.org/2166 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2013-01-25OSQLParser::RuleIDToRule should not silently change s_aReverseRuleIDLookupLionel Elie Mamane
Change-Id: I2b408a23162b1200bbcd530be7acb42435388b04 Reviewed-on: https://gerrit.libreoffice.org/1826 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
2013-01-16fdo#58415: Don't ignore osl_getFileURLFromSystemPath failureStephan Bergmann
...in osl_getFileStatus et al, it would leave the relevant status string member unchanged (i.e., a null pointer) but would mark it as valid, so that later code to retrieve the allegedly valid string member would crash upon the null pointer. Change-Id: Ia8528f5dc27d94f3d14a2c416955a041b87863d3 (cherry picked from commit 588997f0ebc5696574680098b128e66eff54f00c) Reviewed-on: https://gerrit.libreoffice.org/1719 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2012-12-19don't use shared empty string if extra space is to be allocatedLuboš Luňák
fix crash for fdo#58306 when appending to OUStringBuffer initialised with ""
2012-12-10Do not fail for unset OSL_DEBUG_LEVEL (as happens in SDK)Stephan Bergmann
Change-Id: I0e9b8a251ed790d1505566ef4fa991309986522d (cherry picked from commit f2609cc70fa4bb62a7ae876e97a3c7003bc1e99b)
2012-12-06OUStringBuffer::remove( int ) -> truncate( int )Luboš Luňák
Although this may seem consistent with remove( int, int ), it is in fact rather misleading API. The biggest offender is most probably buffer.remove( 'a' ) , which definitely does not do what it suggests to do. Change-Id: I287619cd4b953228b93fa68fb381d66c344c3865 Reviewed-on: https://gerrit.libreoffice.org/1256 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2012-12-06API CHANGE: drop obsolete rtl/oustringostreaminserter.hxxStephan Bergmann
...its functionality moved directly into rtl/ustring.hxx Change-Id: I5a1af63a4fd61c71e6594f1fab0c17f503fdd1c5 (cherry picked from commit 43b8e719d22bd115ecbd71e48be8aae42ed61a0d)
2012-12-06Put stubs for removed functionality into compat.cxxStephan Bergmann
Change-Id: I634c6c699f8573113cdf0763c2cc83dcc04b0b0e (cherry picked from commit c4a8ba908cca0228336330ae72e5d7ad29a6ed2e)
2012-12-04LIBO_UDK_3.7 -> LIBO_UDK_4.0Luboš Luňák
There will be no 3.7. Change-Id: Ib2808aa259baaa7eac42c7ec7a640105fc8c07a1
2012-12-04sal: warning C4267: return: conversion from 'size_t' to 'int'...Michael Stahl
... possible loss of data. Minimal fix that inserts casts when calling strlen; other option would be to change all length() to return size_t... Change-Id: I5d1e0b0c7175a1957aad3acd89884fcd37089454
2012-12-04Fixup: putting back dummy methods for removed semaphoreThorsten Behrens
We don't want to change sal SONAME just yet. Change-Id: I3a9de9a53a4ba845c00a26450e281534ca5d97f6
2012-12-04API CHANGE: remove long-deprecated Semaphore & related stuff.Thorsten Behrens
osl::semaphore was not portable & thusly long-deprecated. Also killing further unused clients of that code in salhelper. Change-Id: Ie1c1924e06e8ce3be33fd1dc2c6933f2de8b5217
2012-12-04fix non-fast string operator+ debug buildLuboš Luňák
the asserts I've added need string.h , which was not available in that case Change-Id: If8dbedcb48400e5edd0bde0214640c2c392fde2b
2012-12-04Fix fast concat of empty stringsStephan Bergmann
Change-Id: Ice9c6974f44be3bc4c9b3533de2a9beb5b146ca5
2012-12-04mac gcc 4.0.1 does not support __attribute((warn_unused_result)) very wellNorbert Thiebaud
Change-Id: Ie8a6a06cd923192891453c9291f37709dfc15079
2012-12-03fix capacity in stringbuffersLuboš Luňák
rtl_stringbuffer_* functions silently allocate +16 extra for capacity, but rtl_string_* functions do not. As intuitive and obvious as ever. Change-Id: Ia0bb63dedf31f6ad5c687187221d7385043b5456
2012-12-03avoid unused warning in non-debug modeLuboš Luňák
Change-Id: I9687f5388a8c01075ee6e359ff9350edff296f4d
2012-12-03assert on strange lengths of string literalsLuboš Luňák
It's better to detect corner cases this way rather than get possibly incorrect results. And strlen() should be easy to optimize out for string literals. Change-Id: Id762e256207668a0cbefe4e13d5f2067f373e783
2012-12-03make sure fast string operator+ is used only by LO codeLuboš Luňák
Change-Id: Iaa8fc379e4d032931c0f60a3e3525783d8d28964
2012-12-03fixes for where fast string operator+ is not perfectly source compatibleLuboš Luňák
Change-Id: I80af0399037e4f68113338139e7f2ad2400e65ab
2012-12-03support for fast O(U)String concatenation using operator+Luboš Luňák
Operator+ now, instead of requiring O(U)String operands and returning another O(U)String object, keeps a track of the whole concatenation operation using temporary O(U)StringConcat objects and performs the whole operation only at the very end. Change-Id: I94b3348300a137498514d26e96459c1698328520
2012-12-03Improve English commentsNaser Sharifi
Corrected types and grammer errors in comments Change-Id: I47ce77a8d36d71677720be6dd80594ec76970376
2012-12-03VS2012 knows that std::abort() does what it says on the tin (WaE: ↵Tor Lillqvist
unreachable code)
2012-12-01Remove useless getpid implementation on Linux.Arnaud Versini
The new minimal target have a proper getpid implementation. Change-Id: I1cf209d8b4cb651866287c3a682ebd0806ab35b9 Reviewed-on: https://gerrit.libreoffice.org/1219 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2012-12-01unused variablesLuboš Luňák
Change-Id: Ia8b2ac25d3949508b132d1b0b05e5384633d935f
2012-12-01but back a unittest check about invalid char[] -> OUString(Buffer) conversionLuboš Luňák
It's invalid, so the additional ambiguity here doesn't matter, but I'd still prefer to check that it remains invalid. Change-Id: Ie05d393ad7f51738383bb98b911938506abd64fc
2012-12-01OUStringBuffer constructor from OUStringBuffer should use const argNorbert Thiebaud
Change-Id: I9f9e072c0a7ebde2de9be811f2378143b2b7abc6 Reviewed-on: https://gerrit.libreoffice.org/1209 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
2012-11-30eradicate all traces of OLocale and rtl/locale.hxxMichael Stahl
... damn language tags breaking builds left and right ... Change-Id: I73224cb3fb2bb98779fdcace700cad2a4fb7cd0e
2012-11-30ditched rtl::OLocaleEike Rathke
Change-Id: I3f4a09c82df1bc71759331705c502320f973d4bb
2012-11-30Find a more sensible place for cssStephan Bergmann
Change-Id: I33fe83c47954f62d8b678430e97cf711a98568d1
2012-11-30c++ API: use css alias in generated headers, adds global css declThorsten Behrens
This changes all generated API headers (.hpp and .hdl) to use a namespace alias 'css' instead of the pointlessly long com::sun::star Makes the change in cppumaker & associated tools, adds a global namespace alias definition in sal/types.h, and removes a kiloton of local, now pointless-to-harmful versions of that alias from all over the code. Change-Id: Ice5a644a6b971a981f01dc0589d48f5add31cc0f
2012-11-28We only support MSVC 2008 (_MSC_VER 1500) or laterTor Lillqvist
We can drop or simplify many conditionals. Change-Id: I37e820e515cc09845c30b62c89ddb3b6ff370f97
2012-11-28add SAL_WARN_UNUSED_RESULT in OString and OUString where appropriateNorbert Thiebaud
String used to do some operation by modifying itself whereas OUString never does that and when a modificaiton is needed it create a new copy. so it is very easy when one convert String code to OUString code to miss stuff like sString.ToUpperCase() which need to be converted into sString = sString.toAsciiUpperCase() and not sString.toAsciiUpperCase() This patch make the compiler generate a warning in that later _wrong_ case Change-Id: I4a9c0b4c7d0b75ad8850ac23b86e8508a334f5fe Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2012-11-28Clean up previous rtl::OUStringBuffer changesStephan Bergmann
The OUString assignment operator is less transactional than it could be, but is also not necessasry, as OUStringBuffer has a non-explicit conversion constructor from OUString. Added some missing @since tags. Change-Id: I830be93fde78422c5a7eff9437b53e2d2d70933a
2012-11-28Fix rtl::OUString::compareToIgnoreAsciiCaseStephan Bergmann
Change-Id: I40005ef4fad4d44314ec2fb2881fec82e926970e
2012-11-27OUString has a matchIgnoreAsciiCase but no compareTo version of itNorbert Thiebaud
Change-Id: Ie02dc3511e262a3b13df38ddbe0b3136f291ac9e
2012-11-27add API to OUStringBuffer to make assignment/copy more versatileNorbert Thiebaud
Change-Id: I95cd8e97044cd5a65500d3a674995f417c4f2e29
2012-11-27android folds libsal_textenc into libsalCaolán McNamara
Change-Id: I749238e38b64abde9b601fcee99bdd1f753cdcff
2012-11-27add dependency on sal_textenc dlopened libCaolán McNamara
Change-Id: I527536083d546afbb5673a16bc5527915ea9d3f7
2012-11-27warning C4309: '=' : truncation of constant valueStephan Bergmann
plus warning C4701: potentially uninitialized local variable 'cChar' used Change-Id: I41df38d0fe8e915cc2a366e0be509c4a0205b105
2012-11-27Make python3 work with custom VALGRIND_CFLAGSStephan Bergmann
Change-Id: Ia4b08a1b20bf46af4d06c0478ed8e795ee543703
2012-11-27implement a new iscii (devangari) <-> unicode converterCaolán McNamara
this time with support for the multi-byte encodings possible in ISCII Change-Id: I1dc09e8836676ab614b531e8dc10f91a90b7c4fd
2012-11-26get textencoding tests working againCaolán McNamara
Change-Id: Ia3e0b7be14800e1d50c3e785153b45d2b4a7dd6d
2012-11-26fix unicode to dingbats conversionCaolán McNamara
enabling the text encoding tests show that the unicode to dingbats conversion is wrong in two places. a) 0x27CF should be 0x25CF b) The unicode range starting at 0x2460 should map to 0xAB not 0xAC Change-Id: I3899e1bbfc3f20ef67eb75c703ad7f23abe81509
2012-11-26removal of ISCII code left a bogus hole in tableCaolán McNamara
Change-Id: I341e36a59172116c9f90c67c6ab23d9e4f2c5847
2012-11-22Add an $APP_DATA_DIR predefiend thingie in bootstrap ("rc") files for AndroidTor Lillqvist
It expands to what lo_get_app_data_dir() returns, i.e. the activity's getApplicationInfo().dataDir. Use it in the LibreOffice4Android app's rc files instead of a hardcoded (possibly device- and/or OS version dependent) path. Change-Id: I8145f2c86eeded39232fb251a79fa64f31f77f55
2012-11-22Add lo_get_app_data_dir()Tor Lillqvist
Change-Id: I13ab54ce5c6d67f1623b7f1923678091660d202d
2012-11-22create SAL_DEPRECATED_INTERNAL for annotating APIMichael Meeks
It flags methods that we don't want used externally, but havn't finished removing internally. Change-Id: I818ee0ea2bf5294be816256a0e7f1868f26806b8
2012-11-22Fail fastStephan Bergmann
Change-Id: I17d6ab71ec7bcf40dccb2c9ffe3d9f2e6b10f01c