[Bf-blender-cvs] [5c9ab3e003d] master: Cleanup: use term 'filepath' for full file paths
Campbell Barton
noreply at git.blender.org
Tue May 17 05:13:27 CEST 2022
Commit: 5c9ab3e003d2cdca46c078c33c946ec1d7ab7626
Author: Campbell Barton
Date: Tue May 17 11:38:05 2022 +1000
Branches: master
https://developer.blender.org/rB5c9ab3e003d2cdca46c078c33c946ec1d7ab7626
Cleanup: use term 'filepath' for full file paths
===================================================================
M source/blender/blenkernel/BKE_customdata_file.h
M source/blender/blenkernel/BKE_icons.h
M source/blender/blenkernel/intern/appdir.c
M source/blender/blenkernel/intern/blender_undo.c
M source/blender/blenkernel/intern/customdata_file.c
M source/blender/blenkernel/intern/icons.cc
M source/blender/blenkernel/intern/pointcache.c
M source/blender/blenloader/BLO_readfile.h
M source/blender/blenloader/BLO_undofile.h
M source/blender/blenloader/intern/readblenentry.c
M source/blender/blenloader/intern/undofile.c
M source/blender/compositor/intern/COM_Debug.cc
M source/blender/editors/io/io_cache.c
M source/blender/editors/render/render_preview.cc
M source/blender/editors/space_file/filelist.c
M source/blender/editors/space_file/fsmenu.c
M source/blender/editors/space_file/fsmenu.h
M source/blender/editors/util/ed_util_ops.cc
M source/blender/imbuf/IMB_thumbs.h
M source/blender/imbuf/intern/cineon/cineon_dpx.c
M source/blender/imbuf/intern/cineon/cineonlib.c
M source/blender/imbuf/intern/cineon/cineonlib.h
M source/blender/imbuf/intern/cineon/dpxlib.c
M source/blender/imbuf/intern/cineon/dpxlib.h
M source/blender/imbuf/intern/cineon/logImageCore.c
M source/blender/imbuf/intern/cineon/logImageCore.h
M source/blender/imbuf/intern/indexer.c
M source/blender/imbuf/intern/readimage.c
M source/blender/imbuf/intern/thumbs.c
M source/blender/imbuf/intern/thumbs_font.c
M source/blender/io/usd/intern/usd_capi_export.cc
M source/blender/io/usd/intern/usd_capi_import.cc
M source/blender/io/usd/usd.h
M source/blender/makesdna/intern/makesdna.c
M source/blender/python/intern/bpy_interface.c
M source/blender/python/intern/bpy_library_load.c
M source/blender/sequencer/intern/disk_cache.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_customdata_file.h b/source/blender/blenkernel/BKE_customdata_file.h
index 9d45d28bd18..6972dcb8681 100644
--- a/source/blender/blenkernel/BKE_customdata_file.h
+++ b/source/blender/blenkernel/BKE_customdata_file.h
@@ -25,17 +25,17 @@ void cdf_free(CDataFile *cdf);
/* File read/write/remove */
-bool cdf_read_open(CDataFile *cdf, const char *filename);
+bool cdf_read_open(CDataFile *cdf, const char *filepath);
bool cdf_read_layer(CDataFile *cdf, CDataFileLayer *blay);
bool cdf_read_data(CDataFile *cdf, unsigned int size, void *data);
void cdf_read_close(CDataFile *cdf);
-bool cdf_write_open(CDataFile *cdf, const char *filename);
+bool cdf_write_open(CDataFile *cdf, const char *filepath);
bool cdf_write_layer(CDataFile *cdf, CDataFileLayer *blay);
bool cdf_write_data(CDataFile *cdf, unsigned int size, void *data);
void cdf_write_close(CDataFile *cdf);
-void cdf_remove(const char *filename);
+void cdf_remove(const char *filepath);
/* Layers */
diff --git a/source/blender/blenkernel/BKE_icons.h b/source/blender/blenkernel/BKE_icons.h
index db45e405e79..8d9351806c4 100644
--- a/source/blender/blenkernel/BKE_icons.h
+++ b/source/blender/blenkernel/BKE_icons.h
@@ -172,7 +172,7 @@ bool BKE_previewimg_id_supports_jobs(const struct ID *id);
/**
* Trigger deferred loading of a custom image file into the preview buffer.
*/
-void BKE_previewimg_id_custom_set(struct ID *id, const char *path);
+void BKE_previewimg_id_custom_set(struct ID *id, const char *filepath);
/**
* Free the preview image belonging to the id.
@@ -223,11 +223,12 @@ struct PreviewImage *BKE_previewimg_cached_get(const char *name);
struct PreviewImage *BKE_previewimg_cached_ensure(const char *name);
/**
- * Generate a #PreviewImage from given file path, using thumbnails management, if not yet existing.
- * Does not actually generate the preview, #BKE_previewimg_ensure() must be called for that.
+ * Generate a #PreviewImage from given `filepath`, using thumbnails management, if not yet
+ * existing. Does not actually generate the preview, #BKE_previewimg_ensure() must be called for
+ * that.
*/
struct PreviewImage *BKE_previewimg_cached_thumbnail_read(const char *name,
- const char *path,
+ const char *filepath,
int source,
bool force_update);
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
index 8d3649fef08..031d3647878 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -61,7 +61,7 @@ static CLG_LogRef LOG = {"bke.appdir"};
static struct {
/** Full path to program executable. */
- char program_filename[FILE_MAX];
+ char program_filepath[FILE_MAX];
/** Full path to directory in which executable is located. */
char program_dirname[FILE_MAX];
/** Persistent temporary directory (defined by the preferences or OS). */
@@ -860,14 +860,14 @@ static void where_am_i(char *fullname, const size_t maxlen, const char *name)
void BKE_appdir_program_path_init(const char *argv0)
{
- where_am_i(g_app.program_filename, sizeof(g_app.program_filename), argv0);
- BLI_split_dir_part(g_app.program_filename, g_app.program_dirname, sizeof(g_app.program_dirname));
+ where_am_i(g_app.program_filepath, sizeof(g_app.program_filepath), argv0);
+ BLI_split_dir_part(g_app.program_filepath, g_app.program_dirname, sizeof(g_app.program_dirname));
}
const char *BKE_appdir_program_path(void)
{
- BLI_assert(g_app.program_filename[0]);
- return g_app.program_filename;
+ BLI_assert(g_app.program_filepath[0]);
+ return g_app.program_filepath;
}
const char *BKE_appdir_program_dir(void)
diff --git a/source/blender/blenkernel/intern/blender_undo.c b/source/blender/blenkernel/intern/blender_undo.c
index c32941ccbc9..a5096b4f9eb 100644
--- a/source/blender/blenkernel/intern/blender_undo.c
+++ b/source/blender/blenkernel/intern/blender_undo.c
@@ -65,7 +65,7 @@ bool BKE_memfile_undo_decode(MemFileUndoData *mfu,
if (UNDO_DISK) {
const struct BlendFileReadParams params = {0};
BlendFileReadReport bf_reports = {.reports = NULL};
- struct BlendFileData *bfd = BKE_blendfile_read(mfu->filename, ¶ms, &bf_reports);
+ struct BlendFileData *bfd = BKE_blendfile_read(mfu->filepath, ¶ms, &bf_reports);
if (bfd != NULL) {
BKE_blendfile_read_setup(C, bfd, ¶ms, &bf_reports);
success = true;
@@ -108,20 +108,20 @@ MemFileUndoData *BKE_memfile_undo_encode(Main *bmain, MemFileUndoData *mfu_prev)
/* disk save version */
if (UNDO_DISK) {
static int counter = 0;
- char filename[FILE_MAX];
+ char filepath[FILE_MAX];
char numstr[32];
- /* Calculate current filename. */
+ /* Calculate current filepath. */
counter++;
counter = counter % U.undosteps;
BLI_snprintf(numstr, sizeof(numstr), "%d.blend", counter);
- BLI_join_dirfile(filename, sizeof(filename), BKE_tempdir_session(), numstr);
+ BLI_join_dirfile(filepath, sizeof(filepath), BKE_tempdir_session(), numstr);
/* success = */ /* UNUSED */ BLO_write_file(
- bmain, filename, fileflags, &(const struct BlendFileWriteParams){0}, NULL);
+ bmain, filepath, fileflags, &(const struct BlendFileWriteParams){0}, NULL);
- BLI_strncpy(mfu->filename, filename, sizeof(mfu->filename));
+ BLI_strncpy(mfu->filepath, filepath, sizeof(mfu->filepath));
}
else {
MemFile *prevfile = (mfu_prev) ? &(mfu_prev->memfile) : NULL;
diff --git a/source/blender/blenkernel/intern/customdata_file.c b/source/blender/blenkernel/intern/customdata_file.c
index 9716b4909b2..cbfaf2831d1 100644
--- a/source/blender/blenkernel/intern/customdata_file.c
+++ b/source/blender/blenkernel/intern/customdata_file.c
@@ -268,11 +268,11 @@ static bool cdf_write_header(CDataFile *cdf)
return true;
}
-bool cdf_read_open(CDataFile *cdf, const char *filename)
+bool cdf_read_open(CDataFile *cdf, const char *filepath)
{
FILE *f;
- f = BLI_fopen(filename, "rb");
+ f = BLI_fopen(filepath, "rb");
if (!f) {
return false;
}
@@ -333,14 +333,14 @@ void cdf_read_close(CDataFile *cdf)
}
}
-bool cdf_write_open(CDataFile *cdf, const char *filename)
+bool cdf_write_open(CDataFile *cdf, const char *filepath)
{
CDataFileHeader *header;
CDataFileImageHeader *image;
CDataFileMeshHeader *mesh;
FILE *f;
- f = BLI_fopen(filename, "wb");
+ f = BLI_fopen(filepath, "wb");
if (!f) {
return false;
}
@@ -402,9 +402,9 @@ void cdf_write_close(CDataFile *cdf)
}
}
-void cdf_remove(const char *filename)
+void cdf_remove(const char *filepath)
{
- BLI_delete(filename, false, false);
+ BLI_delete(filepath, false, false);
}
/********************************** Layers ***********************************/
diff --git a/source/blender/blenkernel/intern/icons.cc b/source/blender/blenkernel/intern/icons.cc
index 2ba6510ee71..7826ef9b1f4 100644
--- a/source/blender/blenkernel/intern/icons.cc
+++ b/source/blender/blenkernel/intern/icons.cc
@@ -241,16 +241,16 @@ static PreviewImage *previewimg_create_ex(size_t deferred_data_size)
return prv_img;
}
-static PreviewImage *previewimg_deferred_create(const char *path, int source)
+static PreviewImage *previewimg_deferred_create(const char *filepath, int source)
{
- /* We pack needed data for lazy loading (source type, in a single char, and path). */
- const size_t deferred_data_size = strlen(path) + 2;
+ /* We pack needed data for lazy loading (source type, in a single char, and filepath). */
+ const size_t deferred_data_size = strlen(filepath) + 2;
char *deferred_data;
PreviewImage *prv = previewimg_create_ex(deferred_data_size);
deferred_data = (char *)PRV_DEFERRED_DATA(prv);
deferred_data[0] = source;
- memcpy(&deferred_data[1], path, deferred_data_size - 1);
+ memcpy(&deferred_data[1], filepath, deferred_data_size - 1);
return prv;
}
@@ -393,7 +393,7 @@ PreviewImage *BKE_previewimg_id_ensure(ID *id)
return nullptr;
}
-void BKE_previewimg_id_custom_set(ID *id, const char *path)
+void BKE_previewimg_id_custom_set(ID *id, const char *filepath)
{
PreviewImage **prv = BKE_previewimg_id_get_p(id);
@@ -403,7 +403,7 @@ void BKE_previewimg_id_custom_set(ID *id, const char *path)
if (*prv) {
BKE_previewimg_deferred_release(*prv);
}
- *prv = previewimg_deferred_create(path, THB_SOURCE_IMAGE);
+ *prv = previewimg_deferred_create(filepath, THB_SOURCE_IMAGE);
/* Can't lazy-render the preview on access. ID previews are saved to files and we want them to be
* there in time. Not only if something happened to have accessed it meanwhile. */
@@ -458,7 +458,7 @@ PreviewImage *BKE_previewimg_cached_ensure(const char *name)
}
PreviewImage *BKE_previewimg_cached_thumbnail_read(const char *name,
- const char *path,
+ const char *filepath,
const int source,
bool force_update)
{
@@ -476,8 +476,8 @@ PreviewImage *BKE_previewimg_cached_thumbnail_read(const char *name,
if (prv && force_update) {
const char *prv_deferred_data = (char *)PRV_DEFERRED_DATA(prv);
- if (((int)prv_deferred_data[0] == source) && STREQ(&prv_deferred_data[1], path)) {
- /* If same path, no need to re-allocate preview, just clear it up. */
+ if (((int)prv_deferred_data[0] == source) && STREQ(&prv_deferred_data[1], filepath)) {
+ /* If same filepath, no need to re-allocate preview, just clear it up. */
BKE_previewimg_clear(prv);
}
else {
@@ -486,7 +486,7 @@ PreviewImage *BKE_previewimg_cached_thumbnail_read(const char *name,
}
if (!prv) {
- prv = previewimg_deferred_create(path, source);
+ prv = previewimg_deferred_create(filepath, source);
force_update = true;
}
@@ -521,10 +521,10 @@ void BKE_previewimg_ensure(PreviewImage *prv, c
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list