[Bf-blender-cvs] [fb330dd1109] master: Cleanup: remove unused BLI_strncat_utf8

Campbell Barton noreply at git.blender.org
Wed Mar 4 05:33:38 CET 2020


Commit: fb330dd11098b9df379d84fe181ce7966d89674c
Author: Campbell Barton
Date:   Wed Mar 4 15:24:06 2020 +1100
Branches: master
https://developer.blender.org/rBfb330dd11098b9df379d84fe181ce7966d89674c

Cleanup: remove unused BLI_strncat_utf8

Behaves differently to strncat,
BLI_strncpy_utf8_rlen can be used for a similar purpose.

===================================================================

M	source/blender/blenlib/BLI_string_utf8.h
M	source/blender/blenlib/intern/string_utf8.c

===================================================================

diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h
index 1db4cdfecd6..8d986d45a17 100644
--- a/source/blender/blenlib/BLI_string_utf8.h
+++ b/source/blender/blenlib/BLI_string_utf8.h
@@ -32,8 +32,6 @@ char *BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t
     ATTR_NONNULL();
 size_t BLI_strncpy_utf8_rlen(char *__restrict dst, const char *__restrict src, size_t maxncpy)
     ATTR_NONNULL();
-char *BLI_strncat_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy)
-    ATTR_NONNULL();
 ptrdiff_t BLI_utf8_invalid_byte(const char *str, size_t length) ATTR_NONNULL();
 int BLI_utf8_invalid_strip(char *str, size_t length) ATTR_NONNULL();
 
diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c
index 027afba1f5e..bf08ad6975b 100644
--- a/source/blender/blenlib/intern/string_utf8.c
+++ b/source/blender/blenlib/intern/string_utf8.c
@@ -288,22 +288,6 @@ size_t BLI_strncpy_utf8_rlen(char *__restrict dst, const char *__restrict src, s
   return (size_t)(dst - r_dst);
 }
 
-char *BLI_strncat_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy)
-{
-  while (*dst && maxncpy > 0) {
-    dst++;
-    maxncpy--;
-  }
-
-#ifdef DEBUG_STRSIZE
-  memset(dst, 0xff, sizeof(*dst) * maxncpy);
-#endif
-
-  BLI_STR_UTF8_CPY(dst, src, maxncpy);
-
-  return dst;
-}
-
 #undef BLI_STR_UTF8_CPY
 
 /* --------------------------------------------------------------------------*/



More information about the Bf-blender-cvs mailing list