From 2107bd73260f1ec16ef5d2e024370a3552f5a187 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 1 Oct 2025 16:01:48 +1000 Subject: [PATCH] Cleanup: rename as_needed -> if_needed Follow the naming convention used elsewhere in the code. --- source/blender/blenlib/BLI_string_utf8.h | 2 +- source/blender/blenlib/intern/string_utf8.cc | 2 +- source/blender/windowmanager/intern/wm_window.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h index d82d8314f45..1142a94b756 100644 --- a/source/blender/blenlib/BLI_string_utf8.h +++ b/source/blender/blenlib/BLI_string_utf8.h @@ -59,7 +59,7 @@ int BLI_str_utf8_invalid_substitute(char *str, size_t str_len, const char substi * \note This is intended for situations when the string is expected to be valid, * where copying and substituting values is typically not needed. */ -[[nodiscard]] const char *BLI_str_utf8_invalid_substitute_as_needed( +[[nodiscard]] const char *BLI_str_utf8_invalid_substitute_if_needed( const char *str, size_t str_len, const char substitute, char *buf, const size_t buf_maxncpy) ATTR_NONNULL(1, 4); diff --git a/source/blender/blenlib/intern/string_utf8.cc b/source/blender/blenlib/intern/string_utf8.cc index 056d04e5a1a..37333a229aa 100644 --- a/source/blender/blenlib/intern/string_utf8.cc +++ b/source/blender/blenlib/intern/string_utf8.cc @@ -328,7 +328,7 @@ int BLI_str_utf8_invalid_substitute(char *str, size_t str_len, const char substi return tot; } -const char *BLI_str_utf8_invalid_substitute_as_needed(const char *str, +const char *BLI_str_utf8_invalid_substitute_if_needed(const char *str, const size_t str_len, const char substitute, char *buf, diff --git a/source/blender/windowmanager/intern/wm_window.cc b/source/blender/windowmanager/intern/wm_window.cc index 75c8ce90425..184f3388e4d 100644 --- a/source/blender/windowmanager/intern/wm_window.cc +++ b/source/blender/windowmanager/intern/wm_window.cc @@ -574,7 +574,7 @@ void WM_window_title(wmWindowManager *wm, wmWindow *win, const char *title) * from the server - exiting immediately. */ const char *filepath = (OS_MAC || OS_WINDOWS) ? filepath_as_bytes : - BLI_str_utf8_invalid_substitute_as_needed(filepath_as_bytes, + BLI_str_utf8_invalid_substitute_if_needed(filepath_as_bytes, strlen(filepath_as_bytes), '?', _filepath_utf8_buf,