diff --git a/source/blender/blenkernel/intern/lib_override.cc b/source/blender/blenkernel/intern/lib_override.cc index b61eb71f834..cd2540cdfe1 100644 --- a/source/blender/blenkernel/intern/lib_override.cc +++ b/source/blender/blenkernel/intern/lib_override.cc @@ -2010,7 +2010,7 @@ static bool lib_override_library_resync(Main *bmain, id_override_new->override_library->flag = id_override_old->override_library->flag; - /* NOTE: Since `runtime.tag` is not copied from old to new liboverride, the potenial + /* NOTE: Since `runtime.tag` is not copied from old to new liboverride, the potential * `LIBOVERRIDE_TAG_RESYNC_ISOLATED_FROM_ROOT` is kept on the old, to-be-freed * liboverride, and the new one is assumed to be properly part of its hierarchy again. */ @@ -2196,7 +2196,7 @@ static bool lib_override_library_resync(Main *bmain, id->tag &= ~LIB_TAG_MISSING; } else if (id->override_library->runtime != nullptr) { - /* Cleanup of this temporary tag, since that somewhat broken liboverride is explicitely + /* Cleanup of this temporary tag, since that somewhat broken liboverride is explicitly * kept for now. */ id->override_library->runtime->tag &= ~LIBOVERRIDE_TAG_RESYNC_ISOLATED_FROM_ROOT; } diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index 0e3240e4b29..50b271dad6f 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -38,25 +38,22 @@ void BLI_setenv_if_new(const char *env, const char *val) ATTR_NONNULL(1); const char *BLI_getenv(const char *env) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; /** - * Converts `/foo/bar.txt` to `/foo/` and `bar.txt` - * - * - Won't change \a string. - * - Won't create any directories. - * - Doesn't use CWD, or deal with relative paths. + * Copies directory and file components from `filepath` into `dir` and `file`, e.g. + * `/foo/bar.txt` to `/foo/` and `bar.txt` */ -void BLI_path_split_dir_file(const char *string, +void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dirlen, char *file, size_t filelen) ATTR_NONNULL(1, 2, 4); /** - * Copies the parent directory part of string into `dir`, max length `dirlen`. + * Copies the parent directory part of filepath into `dir`, max length `dirlen`. */ -void BLI_path_split_dir_part(const char *string, char *dir, size_t dirlen) ATTR_NONNULL(1, 2); +void BLI_path_split_dir_part(const char *filepath, char *dir, size_t dirlen) ATTR_NONNULL(1, 2); /** - * Copies the leaf filename part of string into `file`, max length `filelen`. + * Copies the leaf filename part of filepath into `file`, max length `filelen`. */ -void BLI_path_split_file_part(const char *string, char *file, size_t filelen) ATTR_NONNULL(1, 2); +void BLI_path_split_file_part(const char *filepath, char *file, size_t filelen) ATTR_NONNULL(1, 2); /** * Returns a pointer to the last extension (e.g. the position of the last period). * Returns a pointer to the nil byte when no extension is found. diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index f07cb901fa8..9b24399f1be 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1478,43 +1478,43 @@ static size_t path_split_dir_file_offset(const char *string) } void BLI_path_split_dir_file( - const char *string, char *dir, const size_t dirlen, char *file, const size_t filelen) + const char *filepath, char *dir, const size_t dirlen, char *file, const size_t filelen) { #ifdef DEBUG_STRSIZE memset(dir, 0xff, sizeof(*dir) * dirlen); memset(file, 0xff, sizeof(*file) * filelen); #endif - const size_t lslash = path_split_dir_file_offset(string); + const size_t lslash = path_split_dir_file_offset(filepath); if (lslash) { /* +1 to include the slash and the last char. */ - BLI_strncpy(dir, string, MIN2(dirlen, lslash + 1)); + BLI_strncpy(dir, filepath, MIN2(dirlen, lslash + 1)); } else { dir[0] = '\0'; } - BLI_strncpy(file, string + lslash, filelen); + BLI_strncpy(file, filepath + lslash, filelen); } -void BLI_path_split_dir_part(const char *string, char *dir, const size_t dirlen) +void BLI_path_split_dir_part(const char *filepath, char *dir, const size_t dirlen) { #ifdef DEBUG_STRSIZE memset(dir, 0xff, sizeof(*dir) * dirlen); #endif - const size_t lslash = path_split_dir_file_offset(string); + const size_t lslash = path_split_dir_file_offset(filepath); if (lslash) { /* +1 to include the slash and the last char. */ - BLI_strncpy(dir, string, MIN2(dirlen, lslash + 1)); + BLI_strncpy(dir, filepath, MIN2(dirlen, lslash + 1)); } else { dir[0] = '\0'; } } -void BLI_path_split_file_part(const char *string, char *file, const size_t filelen) +void BLI_path_split_file_part(const char *filepath, char *file, const size_t filelen) { #ifdef DEBUG_STRSIZE memset(file, 0xff, sizeof(*file) * filelen); #endif - const size_t lslash = path_split_dir_file_offset(string); - BLI_strncpy(file, string + lslash, filelen); + const size_t lslash = path_split_dir_file_offset(filepath); + BLI_strncpy(file, filepath + lslash, filelen); } const char *BLI_path_extension_or_end(const char *filepath) diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 9bf4a4361a7..e2d839db436 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -1283,7 +1283,7 @@ static void sequencer_add_image_strip_load_files(wmOperator *op, { const bool use_placeholders = RNA_boolean_get(op->ptr, "use_placeholders"); /* size of Strip->dir. */ - char directory[768]; + char directory[FILE_MAXDIR]; BLI_path_split_dir_part(load_data->path, directory, sizeof(directory)); SEQ_add_image_set_directory(seq, directory); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 77ed865159c..73938f1d959 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1525,7 +1525,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) /* Save proportional edit settings. * Skip saving proportional edit if it was not actually used. - * Note that this value is being saved even if the operation is cancelled. This is to maintain a + * Note that this value is being saved even if the operation is canceled. This is to maintain a * behavior already used by users. */ if (!(t->options & CTX_NO_PET)) { if (t->flag & T_PROP_EDIT_ALL) { diff --git a/source/blender/geometry/intern/uv_pack.cc b/source/blender/geometry/intern/uv_pack.cc index 469c80d79f2..47e6823fdd6 100644 --- a/source/blender/geometry/intern/uv_pack.cc +++ b/source/blender/geometry/intern/uv_pack.cc @@ -943,7 +943,7 @@ class UVMinimumEnclosingSquareFinder { /** * Find the minimum bounding square that encloses the UVs as specified in `r_phis`. * If that square is smaller than `r_max_u` and `r_max_v`, then update `r_phis` accordingly. - * \return True iff `r_phis`, `r_max_u` and `r_max_v` are modified. + * \return True if `r_phis`, `r_max_u` and `r_max_v` are modified. */ static bool rotate_inside_square(const Span island_indices, const Span islands,