diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2017-12-07 22:19:53 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-12-07 22:19:53 +0000 |
commit | ce6979f8d064507300fe0b3a856687fb958c9a5c (patch) | |
tree | ca2528c70c84954fd6c99faeb183be7ba08b7380 /core/fxcrt/widestring.h | |
parent | 67454716002f2f5eae85cef4d382ecfc0e9b266d (diff) | |
download | pdfium-ce6979f8d064507300fe0b3a856687fb958c9a5c.tar.xz |
Add WARN_UNUSED_RESULT to more static methods in (Byte|Wide)String.
Also fixes some usages that were not working as intended after the
conversion to static.
Change-Id: I18c18369754f6ca165f98999b5b80eecf6c76973
Reviewed-on: https://pdfium-review.googlesource.com/20590
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fxcrt/widestring.h')
-rw-r--r-- | core/fxcrt/widestring.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/core/fxcrt/widestring.h b/core/fxcrt/widestring.h index 14621ec1a1..728ab35090 100644 --- a/core/fxcrt/widestring.h +++ b/core/fxcrt/widestring.h @@ -33,8 +33,9 @@ class WideString { using const_iterator = const CharType*; using const_reverse_iterator = std::reverse_iterator<const_iterator>; - static WideString Format(const wchar_t* lpszFormat, ...); - static WideString FormatV(const wchar_t* lpszFormat, va_list argList); + static WideString Format(const wchar_t* lpszFormat, ...) WARN_UNUSED_RESULT; + static WideString FormatV(const wchar_t* lpszFormat, + va_list argList) WARN_UNUSED_RESULT; WideString(); WideString(const WideString& other); @@ -58,13 +59,15 @@ class WideString { ~WideString(); - static WideString FromLocal(const ByteStringView& str); - static WideString FromCodePage(const ByteStringView& str, uint16_t codepage); + static WideString FromLocal(const ByteStringView& str) WARN_UNUSED_RESULT; + static WideString FromCodePage(const ByteStringView& str, + uint16_t codepage) WARN_UNUSED_RESULT; - static WideString FromUTF8(const ByteStringView& str); - static WideString FromUTF16LE(const unsigned short* str, size_t len); + static WideString FromUTF8(const ByteStringView& str) WARN_UNUSED_RESULT; + static WideString FromUTF16LE(const unsigned short* str, + size_t len) WARN_UNUSED_RESULT; - static size_t WStringLength(const unsigned short* str); + static size_t WStringLength(const unsigned short* str) WARN_UNUSED_RESULT; // Explicit conversion to C-style wide string. // Note: Any subsequent modification of |this| will invalidate the result. |