diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-06-27 12:00:47 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-06-27 12:00:47 +0300 |
commit | e170d6be7fb3f7853fac6e8b2bf0142347a5dcf9 (patch) | |
tree | 9742b42055d7c1865334bb5d47902daba7175fa7 /source/blender/blenlib | |
parent | ecb6a6df52a9f3852c9bec12e63b4ab8b06fe5f4 (diff) |
Cleanup: all params of BLI_str partition funcs can be const...
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_string.h | 6 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_string_utf8.h | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/string.c | 8 | ||||
-rw-r--r-- | source/blender/blenlib/intern/string_utf8.c | 6 |
4 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index a94777d278b..c8491f4c8f1 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -90,10 +90,10 @@ int BLI_str_index_in_array(const char *__restrict str, const char **__restrict s bool BLI_str_endswith(const char *__restrict str, const char *__restrict end) ATTR_NONNULL(); bool BLI_strn_endswith(const char *__restrict str, const char *__restrict end, size_t length) ATTR_NONNULL(); -size_t BLI_str_partition(const char *str, const char delim[], char **sep, char **suf) ATTR_NONNULL(); -size_t BLI_str_rpartition(const char *str, const char delim[], char **sep, char **suf) ATTR_NONNULL(); +size_t BLI_str_partition(const char *str, const char delim[], const char **sep, const char **suf) ATTR_NONNULL(); +size_t BLI_str_rpartition(const char *str, const char delim[], const char **sep, const char **suf) ATTR_NONNULL(); size_t BLI_str_partition_ex( - const char *str, const char *end, const char delim[], char **sep, char **suf, const bool from_right) + const char *str, const char *end, const char delim[], const char **sep, const char **suf, const bool from_right) ATTR_NONNULL(1, 3, 4, 5); #ifdef __cplusplus diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h index 18eff6737c8..0740b574c1a 100644 --- a/source/blender/blenlib/BLI_string_utf8.h +++ b/source/blender/blenlib/BLI_string_utf8.h @@ -67,10 +67,10 @@ int BLI_wcswidth(const wchar_t *pwcs, size_t n) ATTR_NONNULL(); int BLI_str_utf8_char_width(const char *p) ATTR_NONNULL(); /* warning, can return -1 on bad chars */ int BLI_str_utf8_char_width_safe(const char *p) ATTR_NONNULL(); -size_t BLI_str_partition_utf8(const char *str, const unsigned int delim[], char **sep, char **suf) ATTR_NONNULL(); -size_t BLI_str_rpartition_utf8(const char *str, const unsigned int delim[], char **sep, char **suf) ATTR_NONNULL(); +size_t BLI_str_partition_utf8(const char *str, const unsigned int delim[], const char **sep, const char **suf) ATTR_NONNULL(); +size_t BLI_str_rpartition_utf8(const char *str, const unsigned int delim[], const char **sep, const char **suf) ATTR_NONNULL(); size_t BLI_str_partition_ex_utf8( - const char *str, const char *end, const unsigned int delim[], char **sep, char **suf, const bool from_right) + const char *str, const char *end, const unsigned int delim[], const char **sep, const char **suf, const bool from_right) ATTR_NONNULL(1, 3, 4, 5); #define BLI_UTF8_MAX 6 /* mem */ diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index 0dcb84c9c6e..3177bc659b2 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -854,7 +854,7 @@ bool BLI_str_endswith(const char *__restrict str, const char *end) * \param suf Return value, set to next char after the first delimiter found (or NULL if none found). * \return The length of the prefix (i.e. *sep - str). */ -size_t BLI_str_partition(const char *str, const char delim[], char **sep, char **suf) +size_t BLI_str_partition(const char *str, const char delim[], const char **sep, const char **suf) { return BLI_str_partition_ex(str, NULL, delim, sep, suf, false); } @@ -868,7 +868,7 @@ size_t BLI_str_partition(const char *str, const char delim[], char **sep, char * * \param suf Return value, set to next char after the first delimiter found (or NULL if none found). * \return The length of the prefix (i.e. *sep - str). */ -size_t BLI_str_rpartition(const char *str, const char delim[], char **sep, char **suf) +size_t BLI_str_rpartition(const char *str, const char delim[], const char **sep, const char **suf) { return BLI_str_partition_ex(str, NULL, delim, sep, suf, true); } @@ -885,7 +885,7 @@ size_t BLI_str_rpartition(const char *str, const char delim[], char **sep, char * \return The length of the prefix (i.e. *sep - str). */ size_t BLI_str_partition_ex( - const char *str, const char *end, const char delim[], char **sep, char **suf, const bool from_right) + const char *str, const char *end, const char delim[], const char **sep, const char **suf, const bool from_right) { const char *d; char *(*func)(const char *str, int c) = from_right ? strrchr : strchr; @@ -916,7 +916,7 @@ size_t BLI_str_partition_ex( } if (tmp && (from_right ? (*sep < tmp) : (!*sep || *sep > tmp))) { - *sep = (char *)tmp; + *sep = tmp; } } diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 85306ccbdd7..96033615cf5 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -734,18 +734,18 @@ char *BLI_str_prev_char_utf8(const char *p) } /* end glib copy */ -size_t BLI_str_partition_utf8(const char *str, const unsigned int delim[], char **sep, char **suf) +size_t BLI_str_partition_utf8(const char *str, const unsigned int delim[], const char **sep, const char **suf) { return BLI_str_partition_ex_utf8(str, NULL, delim, sep, suf, false); } -size_t BLI_str_rpartition_utf8(const char *str, const unsigned int delim[], char **sep, char **suf) +size_t BLI_str_rpartition_utf8(const char *str, const unsigned int delim[], const char **sep, const char **suf) { return BLI_str_partition_ex_utf8(str, NULL, delim, sep, suf, true); } size_t BLI_str_partition_ex_utf8( - const char *str, const char *end, const unsigned int delim[], char **sep, char **suf, const bool from_right) + const char *str, const char *end, const unsigned int delim[], const char **sep, const char **suf, const bool from_right) { const unsigned int *d; const size_t str_len = end ? (size_t)(end - str) : strlen(str); |