Age | Commit message (Collapse) | Author |
|
|
|
Pattern used:
find . -name "*.cxx" -exec sed -i 's/\( *\)\(else if\|if\) *( *\([^!()|&]*\)\.equalsAsciiL( *RTL_CONSTASCII_STRINGPARAM *( *\([^)]*\)) *) *) *{$/\1\2 ( \3 == \4 ) {/' \{\} \;
|
|
|
|
Seeing 791f27683311e487947b0464a0cb132b19fd0e12 I've changed my mind,
some embedded \0 can be actually well hidden:
struct foo { const char txt[3]; };
const foos[] = { { "a" }, { "bb" }};
If somebody wants an embedded \0 in a string literal, they need to
say it explicitly by specifying the size.
|
|
This saves 1% of string allocation / destruction on startup.
|
|
Avoid ref/unref pair in makeStringAndClear, hook into the
stringbuffer-like 'String' class to expose it's conversion to
immutable strings, and fixup misc. missing instrumentation.
|
|
String literals should be reasonably short, and if memory is so low
that they trigger allocation failure, something else would would
trip over very soon anyway.
|
|
Having done this on a temporary basis a couple of times before,
it'd be good to avoid having to do the instrumentation again.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Since OString already has a ctor accepting const char*, I cannot
find out a way to distinguish string literals other than using
a template, otherwise const char* somehow takes precedence
(all of gcc, clang, msvc). But the template requires
the Substitution Is Not A Failure Idiom to actually create
only wanted instances. And the compiler can try evaluate
the OString ctor as a possibility when comparing an int to
an anonymous enum, and anonymous enum as a type without linkage
cannot be a template argument before C++11. SFINAE should still
work, but not with gcc older than 4.0.2 (which we right now
use only on macs). So for that case disable the string literal
ctors, which means macs will have one extra strlen call,
and also that embedded \0's in string literals will be
inconsistent. The tiny performance problem shouldn't matter that
much and will eventually go away, the \0 problem should not
matter, since before string literal ctors were introduced
\0's had not been included anyway unless RTL_CONSTASCII_STRINGPARAM
was used. So we should be safe and when removing the CONSTASCII
macros \0 cases should be handled by explicitly mentioning
the length.
|
|
|
|
Drop the recently introduced rtl_uString_newFromAscii_WithLength()
and replace it with this one. The name fits better and it'll be also
a distinct function that specifically includes embedded \0's
(because that's what OUString supports and if a string literal
explicitly includes it, it makes sense to copy it as such).
|
|
|
|
|
|
http://lists.freedesktop.org/archives/libreoffice/2012-February/025662.html
|
|
Added:
* rtl::OString::matchL
* rtl::OString::endsWith
* rtl::OString::endsWithL
* rtl::OString::indexOfL
* rtl::OString::replaceFirst
* rtl::OString::replaceAll
* rtl::OString::getToken
* rtl::OUString::endsWith
* rtl::OUString::replaceFirst
* rtl::OUString::replaceFirstAsciiL
* rtl::OUString::replaceFirstAsciiLAsciiL
* rtl::OUString::replaceAll
* rtl::OUString::replaceAllAsciiL
* rtl::OUString::replaceAllAsciiLAsciiL
* rtl::OUString::getToken
plus underlying C functions where necessary
Deprecated:
* comphelper::string::remove
* comphelper::string::getToken
Removed:
* comphelper::string::searchAndReplaceAsciiL
* comphelper::string::searchAndReplaceAllAsciiWithAscii
* comphelper::string::searchAndReplaceAsciiI
* comphelper::string::replace
* comphelper::string::matchL
* comphelper::string::matchIgnoreAsciiCaseL
* comphelper::string::indexOfL
Also fixed some apparent misuses of RTL_CONSTASCII_USTRINGPARAM ->
RTL_CONSTASCII_STRINGPARAM.
|
|
SAL_UNUSED_PARAMETER (expanding to __attribute__ ((unused)) for GCC)
is used to annotate legitimately unused parameters, so that static
analysis tools can tell legitimately unused parameters from truly
unnecessary ones. To that end, some patches for external modules
are also added, that are only applied when compiling with GCC and
add necessary __attribute__ ((unused)) in headers.
|
|
|
|
Please find attached a partial fix for Easy Hack FDO43460
Part XXVII
Modules
padmin, pyuno, rdbmaker, regexp, registry, rsc, sal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
...with SAL_LOG=+INFO due to std::ostringstream in log.cxx using global operator
new, which potentially calls rtl_allocateMemory.
|
|
|
|
|
|
|
|
|
|
A compile time check ensures the common case of streaming just a plain
C-style string literal still produces reasonably compact call-site code.
The format-string variants are still available in sal/detail/log.h, but
only to be used in obsolete osl/diagnose.h etc., and going to be removed
again eventually.
|
|
|
|
* New SAL_INFO..., SAL_WARN... macros.
* New SAL_STREAM supersedes OSL_FORMAT.
* oustringostreaminserter.hxx moved from unotest to rtl (and always UTF-8 now).
* TODO to enable GCC __attribute__((format)) in sal/log.h (requires call-site
cleanup).
* Further functionality in tools/debug.hxx (DBG_MEMTEST, DBG_CTOR, etc.) not yet
addressed.
* Some replacements tools String -> rtl::OUString.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"-Wunused-but-set-variable".
See <https://bugs.kde.org/show_bug.cgi?id=284384> "clang 3.1 -Wunused-value
warnings in valgrind.h, memcheck.h" for a way to silence these warnings when
building with clang.
|
|
|