diff options
author | Campbell Barton <campbell@blender.org> | 2022-10-17 03:16:41 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-10-17 03:16:41 +0300 |
commit | 1d1cade9a9a7f75034669520e39c56959917803a (patch) | |
tree | 92482d85f4199f1f65ebcb4b04b6c2cf4a4a0ea4 /source/blender/io/usd/intern | |
parent | 2f3f208901b5bf0fde7fbc9c3f02b66f7591b169 (diff) |
BLI_path: remove trailing NULL argument to BLI_path_join
Using varargs had the disadvantages, replace with a macro which has
some advantages.
- Arguments are type checked.
- Less verbose.
- Unintended NULL arguments would silently terminate joining paths.
- Passing in a NULL argument warns with GCC.
Diffstat (limited to 'source/blender/io/usd/intern')
-rw-r--r-- | source/blender/io/usd/intern/usd_writer_material.cc | 12 | ||||
-rw-r--r-- | source/blender/io/usd/intern/usd_writer_volume.cc | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/io/usd/intern/usd_writer_material.cc b/source/blender/io/usd/intern/usd_writer_material.cc index c195bf0e0bd..75abae79519 100644 --- a/source/blender/io/usd/intern/usd_writer_material.cc +++ b/source/blender/io/usd/intern/usd_writer_material.cc @@ -380,7 +380,7 @@ static void export_in_memory_texture(Image *ima, BKE_image_path_ensure_ext_from_imformat(file_name, &imageFormat); char export_path[FILE_MAX]; - BLI_path_join(export_path, FILE_MAX, export_dir.c_str(), file_name, nullptr); + BLI_path_join(export_path, FILE_MAX, export_dir.c_str(), file_name); if (!allow_overwrite && BLI_exists(export_path)) { return; @@ -576,7 +576,7 @@ static std::string get_tex_image_asset_path(bNode *node, BLI_split_file_part(path.c_str(), file_path, FILE_MAX); if (export_params.relative_paths) { - BLI_path_join(exp_path, FILE_MAX, ".", "textures", file_path, nullptr); + BLI_path_join(exp_path, FILE_MAX, ".", "textures", file_path); } else { /* Create absolute path in the textures directory. */ @@ -588,7 +588,7 @@ static std::string get_tex_image_asset_path(bNode *node, char dir_path[FILE_MAX]; BLI_split_dir_part(stage_path.c_str(), dir_path, FILE_MAX); - BLI_path_join(exp_path, FILE_MAX, dir_path, "textures", file_path, nullptr); + BLI_path_join(exp_path, FILE_MAX, dir_path, "textures", file_path); } BLI_str_replace_char(exp_path, '\\', '/'); return exp_path; @@ -645,7 +645,7 @@ static void copy_tiled_textures(Image *ima, BLI_split_file_part(src_tile_path, dest_filename, sizeof(dest_filename)); char dest_tile_path[FILE_MAX]; - BLI_path_join(dest_tile_path, FILE_MAX, dest_dir.c_str(), dest_filename, nullptr); + BLI_path_join(dest_tile_path, FILE_MAX, dest_dir.c_str(), dest_filename); if (!allow_overwrite && BLI_exists(dest_tile_path)) { continue; @@ -680,7 +680,7 @@ static void copy_single_file(Image *ima, const std::string &dest_dir, const bool BLI_split_file_part(source_path, file_name, FILE_MAX); char dest_path[FILE_MAX]; - BLI_path_join(dest_path, FILE_MAX, dest_dir.c_str(), file_name, nullptr); + BLI_path_join(dest_path, FILE_MAX, dest_dir.c_str(), file_name); if (!allow_overwrite && BLI_exists(dest_path)) { return; @@ -726,7 +726,7 @@ static void export_texture(bNode *node, BLI_split_dir_part(stage_path.c_str(), usd_dir_path, FILE_MAX); char tex_dir_path[FILE_MAX]; - BLI_path_join(tex_dir_path, FILE_MAX, usd_dir_path, "textures", SEP_STR, nullptr); + BLI_path_join(tex_dir_path, FILE_MAX, usd_dir_path, "textures", SEP_STR); BLI_dir_create_recursive(tex_dir_path); diff --git a/source/blender/io/usd/intern/usd_writer_volume.cc b/source/blender/io/usd/intern/usd_writer_volume.cc index 8cc3c65ee70..c6a27c5f663 100644 --- a/source/blender/io/usd/intern/usd_writer_volume.cc +++ b/source/blender/io/usd/intern/usd_writer_volume.cc @@ -152,7 +152,7 @@ std::optional<std::string> USDVolumeWriter::construct_vdb_file_path(const Volume strcat(vdb_file_name, ".vdb"); char vdb_file_path[FILE_MAX]; - BLI_path_join(vdb_file_path, sizeof(vdb_file_path), vdb_directory_path, vdb_file_name, nullptr); + BLI_path_join(vdb_file_path, sizeof(vdb_file_path), vdb_directory_path, vdb_file_name); return vdb_file_path; } |