From 716a8241d387180fd8ad69cdec33633bc7a0f963 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 23 Jun 2020 09:54:14 +1000 Subject: Cleanup: rename 'name' to 'filepath' for DNA types Using 'name' for the full path of a file reads badly, especially when id.name is used in related code. --- source/blender/blenkernel/intern/sound.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/sound.c') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index e8f31594cc0..a293bc55073 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -172,7 +172,7 @@ bSound *BKE_sound_new_file(Main *bmain, const char *filepath) BLI_path_abs(str, path); sound = BKE_libblock_alloc(bmain, ID_SO, BLI_path_basename(filepath), 0); - BLI_strncpy(sound->name, filepath, FILE_MAX); + BLI_strncpy(sound->filepath, filepath, FILE_MAX); /* sound->type = SOUND_TYPE_FILE; */ /* XXX unused currently */ sound->spinlock = MEM_mallocN(sizeof(SpinLock), "sound_spinlock"); @@ -193,7 +193,7 @@ bSound *BKE_sound_new_file_exists_ex(Main *bmain, const char *filepath, bool *r_ /* first search an identical filepath */ for (sound = bmain->sounds.first; sound; sound = sound->id.next) { - BLI_strncpy(strtest, sound->name, sizeof(sound->name)); + BLI_strncpy(strtest, sound->filepath, sizeof(sound->filepath)); BLI_path_abs(strtest, ID_BLEND_PATH(bmain, &sound->id)); if (BLI_path_cmp(strtest, str) == 0) { @@ -452,8 +452,8 @@ static void sound_load_audio(Main *bmain, bSound *sound, bool free_waveform) /* load sound */ PackedFile *pf = sound->packedfile; - /* don't modify soundact->sound->name, only change a copy */ - BLI_strncpy(fullpath, sound->name, sizeof(fullpath)); + /* don't modify soundact->sound->filepath, only change a copy */ + BLI_strncpy(fullpath, sound->filepath, sizeof(fullpath)); BLI_path_abs(fullpath, ID_BLEND_PATH(bmain, &sound->id)); /* but we need a packed file then */ -- cgit v1.2.3