diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-12 10:33:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-12 10:33:21 +0400 |
commit | 0d36225dd1e8ded87949d157fedb07f9d949cb30 (patch) | |
tree | 7ee65f80bc76e4d7d1e19c0ac352be957b8b69b1 /source/blender/blenlib/intern/string.c | |
parent | 7b707fff56209d8997a2d52dde6f38e67be56c31 (diff) |
quiet sign conversion warnings and reduce sign conversion for BLI_string, and BLF.
Diffstat (limited to 'source/blender/blenlib/intern/string.c')
-rw-r--r-- | source/blender/blenlib/intern/string.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index ed11d122e93..aba73936975 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -43,6 +43,10 @@ #include "BLI_utildefines.h" +#ifdef __GNUC__ +# pragma GCC diagnostic error "-Wsign-conversion" +#endif + /** * Duplicates the first \a len bytes of cstring \a str * into a newly mallocN'd string and returns it. \a str @@ -146,7 +150,7 @@ size_t BLI_vsnprintf(char *__restrict buffer, size_t count, const char *__restri BLI_assert(count > 0); BLI_assert(format != NULL); - n = vsnprintf(buffer, count, format, arg); + n = (size_t)vsnprintf(buffer, count, format, arg); if (n != -1 && n < count) { buffer[n] = '\0'; @@ -459,7 +463,7 @@ static int left_number_strcmp(const char *s1, const char *s2, int *tiebreaker) /* same number of digits, compare size of number */ if (numdigit > 0) { - int compare = strncmp(p1, p2, numdigit); + int compare = (int)strncmp(p1, p2, (size_t)numdigit); if (compare != 0) return compare; |