diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-25 11:47:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-26 10:35:30 +0200 |
commit | 24b2c636a230c04ab4b9c6ed7d041f6420f959f1 (patch) | |
tree | 400edf162c26e51817c2ade75bbd259ae320d99f /include/rtl | |
parent | 59793d67d4c0324730e30d71d94ba5173643d79c (diff) |
create SAL_RETURNS_NONNULL annotation
and apply it to some methods in OString and OUString
Change-Id: I30e91f961b6d310799d3641f68b7ed54b3080f3a
Reviewed-on: https://gerrit.libreoffice.org/38020
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/rtl')
-rw-r--r-- | include/rtl/strbuf.hxx | 4 | ||||
-rw-r--r-- | include/rtl/string.hxx | 2 | ||||
-rw-r--r-- | include/rtl/ustrbuf.hxx | 4 | ||||
-rw-r--r-- | include/rtl/ustring.hxx | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx index 791eb142f9dc..eb5d4f738568 100644 --- a/include/rtl/strbuf.hxx +++ b/include/rtl/strbuf.hxx @@ -441,7 +441,7 @@ public: /** Return a null terminated character array. */ - const sal_Char* getStr() const { return pData->buffer; } + const sal_Char* getStr() const SAL_RETURNS_NONNULL { return pData->buffer; } /** Access to individual characters. @@ -709,7 +709,7 @@ public: @since LibreOffice 4.4 */ - char * appendUninitialized(sal_Int32 length) { + char * appendUninitialized(sal_Int32 length) SAL_RETURNS_NONNULL { sal_Int32 n = getLength(); rtl_stringbuffer_insert(&pData, &nCapacity, n, NULL, length); return pData->buffer + n; diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx index 37876983cd1b..2753713fc66f 100644 --- a/include/rtl/string.hxx +++ b/include/rtl/string.hxx @@ -432,7 +432,7 @@ public: @return a pointer to a null-terminated byte string representing the characters of this string object. */ - const sal_Char * getStr() const { return pData->buffer; } + const sal_Char * getStr() const SAL_RETURNS_NONNULL { return pData->buffer; } /** Access to individual characters. diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx index 04ba896b9b48..9dbc2621a7ae 100644 --- a/include/rtl/ustrbuf.hxx +++ b/include/rtl/ustrbuf.hxx @@ -474,7 +474,7 @@ public: /** Return a null terminated unicode character array. */ - const sal_Unicode* getStr() const { return pData->buffer; } + const sal_Unicode* getStr() const SAL_RETURNS_NONNULL { return pData->buffer; } /** Access to individual characters. @@ -885,7 +885,7 @@ public: @since LibreOffice 4.4 */ - sal_Unicode * appendUninitialized(sal_Int32 length) { + sal_Unicode * appendUninitialized(sal_Int32 length) SAL_RETURNS_NONNULL { sal_Int32 n = getLength(); rtl_uStringbuffer_insert(&pData, &nCapacity, n, NULL, length); return pData->buffer + n; diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index 50f3be69bbbd..8b1cd3a1404f 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -662,7 +662,7 @@ public: @return a pointer to the Unicode characters buffer for this object. */ - const sal_Unicode * getStr() const { return pData->buffer; } + const sal_Unicode * getStr() const SAL_RETURNS_NONNULL { return pData->buffer; } /** Access to individual characters. |