Commit Graph

605 Commits

Author SHA1 Message Date
a1ff2bb9a8 Include <algorithm> for std::min
Change-Id: I012027c38a6d2b06a4bb0cb53743d350b124ccf4
2014-07-28 09:46:17 +03:00
0d78ad871e DBG_ASSERT->assert when followed by dereference
Change-Id: Ic1c999ffdc391ea01be5711721e7c9e63179473e
2014-07-07 10:48:25 +01:00
281989007f Use standard library optimised routines for OUString/OString
..handling where possible.

Change-Id: I0b071988ed266cc2745a8ca9705c106a05edc557
Reviewed-on: https://gerrit.libreoffice.org/10020
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-07-04 09:04:05 +00:00
6da22e4148 coverity#1187696 Unintended sign extension
Change-Id: I8e56137ad4422381adbf13b179e2ae6f04edea6e
2014-07-03 14:52:23 +01:00
4f90623dba Clean up surrogates.hxx
Change-Id: I0eae089be1bde9db822a77bea482c10650c8a137
2014-07-01 23:21:17 +02:00
5ace3f3b4f clang scan-build: various warnings
Change-Id: I4bdfb074b3cf6fcb49765322308dfa4b9ed67713
2014-07-01 10:56:14 +01:00
547135c0dc It is useful to know what macros are we expanding, and to what.
Change-Id: If7704edc5baa9759abc680b8d2040b9cdfe92317
2014-06-30 14:48:05 +02:00
e5c20a785c sal/rtl: remove SAL_THROW macro
Change-Id: I70e41f087dbe188f8fc455150480faeae2b426ed
2014-06-05 08:17:48 +02:00
b5cb4935c2 Work around undef conversion of large double to float
...as flagged by -fsanitize=undefined.  But is it really undefined?
[conv.double] "If the source value is between two adjacent destination values,
the result of the conversion is an implementation-defined choice of either of
those values."  So if the double is between std::numeric_limits<float>::max()
and std::numeric_limits<float>::infinity()...

Change-Id: I6389c8ac4a922991e240638d231dd2a39e173882
2014-05-22 18:31:07 +02:00
a908e4eb41 Resolves: #i124896# [API CHANGE] remove obsoleted rtl/allocator.hxx
remove obsoleted sal-module-internal custom STL allocator

The SAL module avoided the heavy dependency on the stlport4-libraries by using
a custom allocator for its internal STL containers. With stlport4 removed these
dependencies are gone and the SAL-internal custom allocator is obsoleted.

(cherry picked from commit c6e0325df6efce45dbb2616a32b7745c449c6c58)

Conflicts:
	include/osl/diagnose.hxx
	include/rtl/allocator.hxx
	sal/osl/w32/procimpl.cxx
	sal/qa/osl/process/osl_process.cxx
	sal/rtl/bootstrap.cxx
	sal/rtl/source/hash.cxx
	sal/rtl/source/unload.cxx

Change-Id: I8515382828eda36aba1fec5f23e0f2a89aef7a33
2014-05-15 15:03:49 +01:00
2bd7767d01 Resolves fdo#70681: fixincludeguards.pl: all that's left
Change-Id: I3e51a62710bb46c8255fd228d41d9300c90a1fb5
Reviewed-on: https://gerrit.libreoffice.org/9360
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-05-15 12:50:46 +00:00
b0200601d4 Clean up unreferenced functions
Change-Id: Id9cb4dbeb6b3313974b881efd6a7c43cb5e314ce
2014-04-04 10:05:57 +02:00
9573cd6369 Fix ASCII-only check
...which did not work e.g. for broken single-byte input 0x80.

Change-Id: I4dff41e4f18dfce376695b438004c2af853cf4fa
2014-04-04 10:05:56 +02:00
335cd830b0 Kill superfluous vertical whitespace
Change-Id: I8c37b9ec45836f9c0e2dc0cf232f96f23c7c36d3
2014-04-03 10:00:55 +03:00
b6f4658003 Use boost::noncopyable
Change-Id: Ifeee0632f6e163037bea9ba2ee8d19f050f9a212
2014-04-03 08:20:19 +02:00
53851801c6 coverity#983373 Dereference before null check
Change-Id: Ie2a6b5e71f76ff2900ff078fcc098e66927458ef
2014-03-31 14:35:16 +01:00
11ea31b5e4 coverity#705205 Missing break in switch
Change-Id: Iaee3b73ceed5df9928514e55d00ac6292b8b2249
2014-03-28 13:14:02 +00:00
45d09ea271 "overflow" is one word
Change-Id: Ib36c2c5d55f86aff27081a0da554f6e8a81474ee
2014-03-11 17:17:39 +02:00
d739b01b9f Adapt rtl_uriConvertRelToAbs to RFC 3986
...which updates RFC 2396, removes the requirement that the base URI's path
starts with a slash, and clarifies how to treat excess "." and ".." segments.

This nicely allows handling of those odd vnd.sun.star.Package URLs as intended
now, so that making <foo> absolute relative to base URL
<vnd.sun.star.Package:Pictures/bar> yields <vnd.sun.star.Package:Pictures/foo>
instead of provoking a MalformedUriException.

Change-Id: Ice84303a57698a2c05d3a45541fe78b67450fa3c
2014-03-01 19:28:15 +01:00
4133c3e6ff Remove visual noise from sal
Change-Id: Idf07c7d31c0a523f929aded9ff3183a3f01b16b9
Reviewed-on: https://gerrit.libreoffice.org/8297
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-03-01 05:35:12 -06:00
51f73a9be8 Simplify string construction
Change-Id: Ib46a64d8438dcaba37a234460d1a4113707e8c43
2014-02-28 17:49:58 +01:00
9aab0e9ac6 Fix typo: s/Alined/Aligned
Change-Id: I248d002d2ed0e61f97a35ea0d329c64832252ad7
2014-02-28 08:27:17 +02:00
03f7a34201 Ensure that numeric array storage is aligned to 256-byte boundary.
OpenCL devices require this else we would get a performance hit.

Change-Id: I6b1db6320fa84f933b6446022a0fd02ba267bf21
2014-02-27 21:19:36 -05:00
0ce0c369aa Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23 03:38:49 +00:00
042725a5da Stick to a single O[U]String hash function
8f8bc0dcf3bc253ae49159d52db049767f476ced "Move string hash function into String
class" had introduced a new getHash64 that, besides returning sal_uInt64 instead
of just sal_Int32, didn't do sampling of only a handful of characters, but
always computed the hash over all characters (as the usage in SfxItemSet and
SdPage appears to require for either performance or approximated correctness).

However, it would be advantageous to keep the stable URE interface as small as
possible.  Now, O(1) sampling was apparently considered state of the art when
the rtl string classes were first created, closely copying java.lang.String,
which at that time demanded sampling for hashCode(), too---but never sampling
more than 15 characters, with the obvious (in hindsight, at least) performance
catastrophes, so they changed it to O(n) somewhere along the way.

Based on that, this commit changes the existing hash functions to not do
sampling any more, and removes the newly introduced -64 variants again.  (Where
the extended value range of sal_uInt64 compared to sal_Int32 was hopefully not
vital to the existing uses.)

The old implementation used sampling only for strings of length >= 256, so I did
a "make check" build with an instrumented hash function that flagged all uses
with inputs of length >= 256, and grepped workdir/{Cppunit,Junit,Python}Test for
hits.  Of the 2849 hits encountered, 2845 where in the range from 256 to 295
characters, and only the remaining four where of 2472 characters.  Those four
were from CppunitTest_sc_subsequent_filters_test, importing long text into a
cell, causing ScDocumentImport::setStringCell to call
svl::SharedStringPool::intern, which internally uses an unordered_set.  These
results appear to justify the change.

Change-Id: I78fcc3b0f07389bdf36a21701b95a1ff0a0d970f
2014-02-18 13:08:58 +01:00
d84cf2de01 sal: sal_Bool -> bool
Change-Id: I071a931660dafc1ee5950da527b042fb175255b8
2014-02-17 17:55:16 +01:00
2d3030b1fa Revert "sal: fix some clang warning about implicit bool conversion"
This reverts commit 56ff07a795aca516106bfde80cb32860065690a6, the correct fix is
d19598b56c8bec688d1944cd167f32a369344100 "Adapt ImplicitBoolConversion to 32-bit
builds (where sal_Int32 is long)."
2014-02-13 10:51:49 +01:00
8f8bc0dcf3 Move string hash function into String class.
hashCode() seems to do sampling while creating the hash.
hashCode64() will not.

Change-Id: Id30f5a2a774cf5244dbc00da9649e95a532484be
2014-02-13 13:13:53 +05:30
56ff07a795 sal: fix some clang warning about implicit bool conversion
Change-Id: I5ecaf73922c6a30add6e270b8abdfdb5c28fe4a5
2014-02-12 20:26:40 +01:00
ff5a48439c Do not do RTL_LOG_STRING_NEW on null pointer
Change-Id: Ie972599650620324fa7af5ed2b2843bfc1f34c43
2014-02-10 09:30:24 +01:00
bd4053f895 bool improvements
Change-Id: I7ae2b02e435d21390843c6c56877a8ce3a73f9f2
2014-01-28 20:26:24 +01:00
a3f32769fc Fix bogus mass-conversion equalsAsciiL -> startsWith
3af99e4d59d89c343965a928681a30f36b1007d2 "convert equalsAsciiL calls to
startsWith calls" should rather have converted to oprator ==.

Change-Id: Id4a8836c5d6d570e54661c40be7214632e202b21
2014-01-21 15:54:52 +01:00
20cf2d93fb Use bool
Change-Id: I46c30a62fb39c2223a369f91010a860372efc72f
2014-01-10 17:11:47 +01:00
66397a4fd2 fdo#72598 Remove SunStudio cruft from code base
Change-Id: I5150eec33228e18e274a8ae4effd3f185851b7f4
Reviewed-on: https://gerrit.libreoffice.org/7103
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2013-12-16 20:52:39 +00:00
3b2f956ba6 Drop duplicate #include
Change-Id: Ife8ebbb5e46704c5d2ff46cc345b4ed926e7dc12
2013-12-02 01:02:06 +09:00
a39d07e134 Unwind occurrences of deprecated sal_sChar, sal_uChar
Change-Id: I76be464200d486efef9c8a7e957c310c9adae3b8
2013-11-27 12:52:32 +01:00
73342dbb82 remove unnecessary RTL_CONSTASCII_STRINGPARAM
A final pass through the code, converting code to use the new
OUString and OString methods that can detect string literals.

Change-Id: Ifa6382335e5650a1c67e52006b26354e0692c710
2013-11-22 08:07:19 +02:00
3af99e4d59 convert equalsAsciiL calls to startsWith calls
Convert code like:
    aStr.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ActiveConnection" ) )
to
    aStr.startsWith( "ActiveConnection" )
which compiles down to the same machine code.

Change-Id: Id4b0c5e0f9afe716a468d3afc70374699848dc33
2013-11-20 10:07:31 +02:00
7377aaa1ae Use rtl::Static
Change-Id: I391e027b2567c4239c1d02e132c6508b3f49d381
2013-11-14 10:15:16 +01:00
c24b4dcff1 -Werror,-Wunused-member-function
Change-Id: I5dd8f718cb96c4442e2fce08a8dc4130e934c68d
2013-11-14 10:14:56 +01:00
1110e66521 -Werror,-Wunused-member-function
Change-Id: Id218a6123037bf624044a6297edaede924bd4a9a
2013-11-14 10:14:55 +01:00
d366c9b20e remove unnecessary sal_Unicode casts in various places
Change-Id: Ibf04062ca86ed866202d748c3b62a210d30ed6ec
2013-11-14 08:17:32 +02:00
1db1d9ecad document the use of the strtmpl.cxx and remove unnecessary macro usage
Document the "calling" macros for the strtmpl.cxx template file.
And remove unnecessary use of those macros in the calling file.

Change-Id: I20e0dd74150773363b9fb557884b84692ce22f11
Reviewed-on: https://gerrit.libreoffice.org/6504
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2013-11-12 16:16:46 +00:00
ebf5e56e20 Name threads for debug purpose
Change-Id: Id99ba394b898b7da0057d4a145ce8dce46122782
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2013-11-07 09:33:06 +01:00
47c6eef773 Related: fdo#69641 convert OSL_ASSERT into assert
Change-Id: I63c32289c7ac6a428c8c50e49650fbac98c8c5e3
2013-10-28 15:52:29 +00:00
7bbd58eafc fdo#70319 "exponent followed by at least on digit" also for special case 0.0
Change-Id: I07e7917417b8a22cf6d64f2b7a447f9084b9fa2d
2013-10-17 18:01:59 +02:00
f20feba4c4 resolved fdo#70319 exponent must be followed by at least one digit
Change-Id: Icdd22fa0f1efcdd18cfea7cb48e1cbf2cf8d3533
2013-10-14 14:57:38 +02:00
57a28dc955 Fail fast at least in debug builds
Change-Id: I266d5cf5b98827617f7ed65c94a772e28808f386
2013-10-09 21:02:11 +02:00
45ffc53a90 Revert "Don't ignore -env: command line parameters in some cases"
This was the wrong way to fix the problem. The root cause was a static
initialiser in the OpenCL code, and that code should not even have been
built for iOS.

This reverts commit 261f1439e5516f6d60317a675d261af330a9a74c.
2013-10-09 13:46:43 +03:00
261f1439e5 Don't ignore -env: command line parameters in some cases
Happened at least in the experimental iOS app.

Change-Id: I725dde2f40ae9e64406e7a1b1dd5dc0da0a9ebd4
2013-10-08 20:39:10 +03:00