Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-01-10 21:13:38 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-01-10 21:15:49 +0300
commit5357474ad8b81ce0e41907d99e9636fcc7c3a6f6 (patch)
tree76291a130ec317cbee9911a43cd21992ad79a033
parentab3f037ccc3f5969a44120d60c7e44ab405ef935 (diff)
Fix building with very strict flags, use size_t rather than int for string length.
Reported on bf-committers.
-rw-r--r--source/blender/blenlib/BLI_string.h2
-rw-r--r--source/blender/blenlib/intern/string.c6
-rw-r--r--source/blender/editors/animation/keyframes_general.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h
index 54eb76490b8..c4853e37398 100644
--- a/source/blender/blenlib/BLI_string.h
+++ b/source/blender/blenlib/BLI_string.h
@@ -86,7 +86,7 @@ int BLI_str_index_in_array_n(const char *__restrict str, const char **__restrict
int BLI_str_index_in_array(const char *__restrict str, const char **__restrict str_array) ATTR_NONNULL();
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, int length) 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();
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index f7ac8442b8b..cc5a90dbc39 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -773,9 +773,9 @@ int BLI_str_index_in_array(const char *__restrict str, const char **__restrict s
return -1;
}
-bool BLI_strn_endswith(const char *__restrict str, const char *__restrict end, int slength)
+bool BLI_strn_endswith(const char *__restrict str, const char *__restrict end, size_t slength)
{
- int elength = strlen(end);
+ size_t elength = strlen(end);
if (elength < slength) {
const char *iter = &str[slength - elength];
@@ -798,7 +798,7 @@ bool BLI_strn_endswith(const char *__restrict str, const char *__restrict end, i
*/
bool BLI_str_endswith(const char *__restrict str, const char *end)
{
- int slength = strlen(str);
+ const size_t slength = strlen(str);
return BLI_strn_endswith(str, end, slength);
}
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index 6d73cd0c04c..6acff134a97 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -747,7 +747,7 @@ static tAnimCopybufItem *pastebuf_match_index_only(FCurve *fcu, const short from
static void do_curve_mirror_flippping(tAnimCopybufItem *aci, BezTriple *bezt)
{
if (aci->is_bone) {
- int slength = strlen(aci->rna_path);
+ const size_t slength = strlen(aci->rna_path);
bool flip = false;
if (BLI_strn_endswith(aci->rna_path, "location", slength) && aci->array_index == 0)
flip = true;