Cleanup: rename as_needed -> if_needed

Follow the naming convention used elsewhere in the code.
This commit is contained in:
Campbell Barton
2025-10-01 16:01:48 +10:00
parent 7d67113a8a
commit 2107bd7326
3 changed files with 3 additions and 3 deletions

View File

@@ -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);

View File

@@ -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,

View File

@@ -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,