Eina: Fixed usage of EINA_CONST, the lack of EINA_PURE and EINA_WARN_UNUSED_RESULT and formatting in the following headers:

1. eina_unicode.h
2. eina_strbuf.h eina_ustrbuf.h
3. eina_stringshare.h eina_ustringshare.h eina_binshare.h


SVN revision: 51128
This commit is contained in:
Tom Hacohen 2010-08-15 09:01:16 +00:00
parent 3686e9d295
commit 063d8ffd64
6 changed files with 36 additions and 37 deletions

View File

@ -68,10 +68,10 @@
EAPI Eina_Bool eina_binshare_init(void);
EAPI Eina_Bool eina_binshare_shutdown(void);
EAPI const void *eina_binshare_add_length(const void *obj,
unsigned int olen) EINA_WARN_UNUSED_RESULT;
unsigned int olen) EINA_PURE EINA_WARN_UNUSED_RESULT;
EAPI const void *eina_binshare_ref(const void *obj);
EAPI void eina_binshare_del(const void *obj);
EAPI int eina_binshare_length(const void *obj) EINA_CONST EINA_WARN_UNUSED_RESULT;
EAPI int eina_binshare_length(const void *obj) EINA_WARN_UNUSED_RESULT;
EAPI void eina_binshare_dump(void);
/**

View File

@ -152,8 +152,7 @@ EAPI Eina_Bool eina_strbuf_append_char(Eina_Strbuf *buf, char c) EINA_ARG_NON
*
* @see eina_strbuf_append()
*/
EAPI Eina_Bool eina_strbuf_append_printf(Eina_Strbuf *buf, const char *fmt, ...) EINA_ARG_NONNULL(1, 2)
EINA_PRINTF(2, 3);
EAPI Eina_Bool eina_strbuf_append_printf(Eina_Strbuf *buf, const char *fmt, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 3);
/**
* @brief Append a string to a buffer, reallocating as necessary.
*
@ -395,7 +394,7 @@ EAPI Eina_Bool eina_strbuf_remove(Eina_Strbuf *buf, size_t start, size_t
*
* @see eina_strbuf_string_steal()
*/
EAPI const char * eina_strbuf_string_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
EAPI const char *eina_strbuf_string_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
* @brief Steal the contents of a string buffer.
*
@ -427,7 +426,7 @@ EAPI void eina_strbuf_string_free(Eina_Strbuf *buf) EINA_ARG_NONNULL
*
* This function returns the length of @p buf.
*/
EAPI size_t eina_strbuf_length_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
EAPI size_t eina_strbuf_length_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Bool eina_strbuf_replace(Eina_Strbuf *buf, const char *str, const char *with, unsigned int n) EINA_ARG_NONNULL(1, 2, 3);
/**

View File

@ -69,12 +69,12 @@
EAPI const char * eina_stringshare_add_length(const char *str, unsigned int slen) EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_add(const char *str) EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_printf(const char *fmt, ...) EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_printf(const char *fmt, ...) EINA_WARN_UNUSED_RESULT EINA_PRINTF(1, 2);
EAPI const char * eina_stringshare_vprintf(const char *fmt, va_list args) EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_nprintf(unsigned int len, const char *fmt, ...) EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_nprintf(unsigned int len, const char *fmt, ...) EINA_WARN_UNUSED_RESULT EINA_PRINTF(2, 3);
EAPI const char * eina_stringshare_ref(const char *str);
EAPI void eina_stringshare_del(const char *str);
EAPI int eina_stringshare_strlen(const char *str) EINA_CONST EINA_WARN_UNUSED_RESULT;
EAPI int eina_stringshare_strlen(const char *str) EINA_PURE EINA_WARN_UNUSED_RESULT;
EAPI void eina_stringshare_dump(void);
static inline Eina_Bool eina_stringshare_replace(const char **p_str, const char *news) EINA_ARG_NONNULL(1);

View File

@ -42,21 +42,21 @@ typedef unsigned int Eina_Unicode;
EAPI extern const Eina_Unicode *EINA_UNICODE_EMPTY_STRING;
EAPI size_t eina_unicode_strlen(const Eina_Unicode *ustr) EINA_ARG_NONNULL(1) EINA_PURE;
EAPI size_t eina_unicode_strnlen(const Eina_Unicode *ustr, int n) EINA_ARG_NONNULL(1) EINA_PURE;
EAPI size_t eina_unicode_strlen(const Eina_Unicode *ustr) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
EAPI size_t eina_unicode_strnlen(const Eina_Unicode *ustr, int n) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
EAPI Eina_Unicode *eina_unicode_strdup(const Eina_Unicode *text) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
EAPI int eina_unicode_strcmp(const Eina_Unicode *a, const Eina_Unicode *b) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
EAPI int eina_unicode_strcmp(const Eina_Unicode *a, const Eina_Unicode *b) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
EAPI Eina_Unicode *eina_unicode_strcpy(Eina_Unicode *dest, const Eina_Unicode *source);
EAPI Eina_Unicode *eina_unicode_strcpy(Eina_Unicode *dest, const Eina_Unicode *source) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Unicode *eina_unicode_strstr(const Eina_Unicode *haystack, const Eina_Unicode *needle) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
EAPI Eina_Unicode *eina_unicode_strstr(const Eina_Unicode *haystack, const Eina_Unicode *needle) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
EAPI Eina_Unicode *eina_unicode_strncpy(Eina_Unicode *dest, const Eina_Unicode *source, size_t n);
EAPI Eina_Unicode *eina_unicode_strncpy(Eina_Unicode *dest, const Eina_Unicode *source, size_t n) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Unicode *eina_unicode_escape(const Eina_Unicode *str);
EAPI Eina_Unicode *eina_unicode_escape(const Eina_Unicode *str) EINA_ARG_NONNULL(1) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
/**
* @}

View File

@ -361,7 +361,7 @@ eina_ustrbuf_remove(Eina_UStrbuf *buf, size_t start, size_t end) EINA_ARG_NONNUL
* @see eina_ustrbuf_string_steal()
*/
EAPI const Eina_Unicode *
eina_ustrbuf_string_get(const Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
eina_ustrbuf_string_get(const Eina_UStrbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
* @brief Steal the contents of a string buffer.
*
@ -396,7 +396,7 @@ eina_ustrbuf_string_free(Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
* This function returns the length of @p buf.
*/
EAPI size_t
eina_ustrbuf_length_get(const Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
eina_ustrbuf_length_get(const Eina_UStrbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
* @}
*/

View File

@ -70,7 +70,7 @@ EAPI const Eina_Unicode *eina_ustringshare_add_length(const Eina_Unicode *str, u
EAPI const Eina_Unicode *eina_ustringshare_add(const Eina_Unicode *str) EINA_WARN_UNUSED_RESULT;
EAPI const Eina_Unicode *eina_ustringshare_ref(const Eina_Unicode *str);
EAPI void eina_ustringshare_del(const Eina_Unicode *str);
EAPI int eina_ustringshare_strlen(const Eina_Unicode *str) EINA_CONST EINA_WARN_UNUSED_RESULT;
EAPI int eina_ustringshare_strlen(const Eina_Unicode *str) EINA_PURE EINA_WARN_UNUSED_RESULT;
EAPI void eina_ustringshare_dump(void);
static inline Eina_Bool eina_ustringshare_replace(const Eina_Unicode **p_str, const Eina_Unicode *news) EINA_ARG_NONNULL(1);