diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-12-17 04:11:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-12-17 04:11:28 +0300 |
commit | d61d68a310bd8d8f4bbfe325cf54dda8c19e7fbe (patch) | |
tree | aa066089c7461a90537ffa0f2cafcafc8a7e24d2 /source | |
parent | 814a11be59d3f846fdb160d90ddf09bac12069ae (diff) |
Cleanup: remove redundant string initialization
Fixed sized strings are always initialized & this is not done
elsewhere before calling BLI_path_join.
Remove since it's not needed and makes it read as if the function
might not initialize the output argument.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 7 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_fluid.c | 8 |
2 files changed, 1 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 708137ba5c4..c33018f7a7a 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -322,17 +322,14 @@ void BKE_fluid_cache_free(FluidDomainSettings *mds, Object *ob, int cache_map) if (cache_map & FLUID_DOMAIN_OUTDATED_DATA) { flags &= ~(FLUID_DOMAIN_BAKING_DATA | FLUID_DOMAIN_BAKED_DATA | FLUID_DOMAIN_OUTDATED_DATA); - temp_dir[0] = '\0'; BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_CONFIG, NULL); if (BLI_exists(temp_dir)) { BLI_delete(temp_dir, true, true); } - temp_dir[0] = '\0'; BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_DATA, NULL); if (BLI_exists(temp_dir)) { BLI_delete(temp_dir, true, true); } - temp_dir[0] = '\0'; BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_SCRIPT, NULL); if (BLI_exists(temp_dir)) { BLI_delete(temp_dir, true, true); @@ -341,7 +338,6 @@ void BKE_fluid_cache_free(FluidDomainSettings *mds, Object *ob, int cache_map) } if (cache_map & FLUID_DOMAIN_OUTDATED_NOISE) { flags &= ~(FLUID_DOMAIN_BAKING_NOISE | FLUID_DOMAIN_BAKED_NOISE | FLUID_DOMAIN_OUTDATED_NOISE); - temp_dir[0] = '\0'; BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_NOISE, NULL); if (BLI_exists(temp_dir)) { BLI_delete(temp_dir, true, true); @@ -350,7 +346,6 @@ void BKE_fluid_cache_free(FluidDomainSettings *mds, Object *ob, int cache_map) } if (cache_map & FLUID_DOMAIN_OUTDATED_MESH) { flags &= ~(FLUID_DOMAIN_BAKING_MESH | FLUID_DOMAIN_BAKED_MESH | FLUID_DOMAIN_OUTDATED_MESH); - temp_dir[0] = '\0'; BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_MESH, NULL); if (BLI_exists(temp_dir)) { BLI_delete(temp_dir, true, true); @@ -360,7 +355,6 @@ void BKE_fluid_cache_free(FluidDomainSettings *mds, Object *ob, int cache_map) if (cache_map & FLUID_DOMAIN_OUTDATED_PARTICLES) { flags &= ~(FLUID_DOMAIN_BAKING_PARTICLES | FLUID_DOMAIN_BAKED_PARTICLES | FLUID_DOMAIN_OUTDATED_PARTICLES); - temp_dir[0] = '\0'; BLI_path_join( temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_PARTICLES, NULL); if (BLI_exists(temp_dir)) { @@ -372,7 +366,6 @@ void BKE_fluid_cache_free(FluidDomainSettings *mds, Object *ob, int cache_map) if (cache_map & FLUID_DOMAIN_OUTDATED_GUIDING) { flags &= ~(FLUID_DOMAIN_BAKING_GUIDING | FLUID_DOMAIN_BAKED_GUIDING | FLUID_DOMAIN_OUTDATED_GUIDING); - temp_dir[0] = '\0'; BLI_path_join( temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_GUIDING, NULL); if (BLI_exists(temp_dir)) { diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 6c1c7afbebd..e25cedc51a4 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -364,7 +364,6 @@ static void fluid_bake_startjob(void *customdata, short *stop, short *do_update, FluidDomainSettings *mds = job->mmd->domain; char temp_dir[FILE_MAX]; - temp_dir[0] = '\0'; job->stop = stop; job->do_update = do_update; @@ -377,7 +376,6 @@ static void fluid_bake_startjob(void *customdata, short *stop, short *do_update, BKE_spacedata_draw_locks(true); if (fluid_is_bake_noise(job) || fluid_is_bake_all(job)) { - temp_dir[0] = '\0'; BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_NOISE, NULL); BLI_dir_create_recursive(temp_dir); /* Create 'noise' subdir if it does not exist already */ mds->cache_flag &= ~(FLUID_DOMAIN_BAKED_NOISE | FLUID_DOMAIN_OUTDATED_NOISE); @@ -385,7 +383,6 @@ static void fluid_bake_startjob(void *customdata, short *stop, short *do_update, job->pause_frame = &mds->cache_frame_pause_noise; } if (fluid_is_bake_mesh(job) || fluid_is_bake_all(job)) { - temp_dir[0] = '\0'; BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_MESH, NULL); BLI_dir_create_recursive(temp_dir); /* Create 'mesh' subdir if it does not exist already */ mds->cache_flag &= ~(FLUID_DOMAIN_BAKED_MESH | FLUID_DOMAIN_OUTDATED_MESH); @@ -393,7 +390,6 @@ static void fluid_bake_startjob(void *customdata, short *stop, short *do_update, job->pause_frame = &mds->cache_frame_pause_mesh; } if (fluid_is_bake_particle(job) || fluid_is_bake_all(job)) { - temp_dir[0] = '\0'; BLI_path_join( temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_PARTICLES, NULL); BLI_dir_create_recursive( @@ -403,7 +399,6 @@ static void fluid_bake_startjob(void *customdata, short *stop, short *do_update, job->pause_frame = &mds->cache_frame_pause_particles; } if (fluid_is_bake_guiding(job) || fluid_is_bake_all(job)) { - temp_dir[0] = '\0'; BLI_path_join( temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_GUIDING, NULL); BLI_dir_create_recursive(temp_dir); /* Create 'guiding' subdir if it does not exist already */ @@ -412,10 +407,9 @@ static void fluid_bake_startjob(void *customdata, short *stop, short *do_update, job->pause_frame = &mds->cache_frame_pause_guiding; } if (fluid_is_bake_data(job) || fluid_is_bake_all(job)) { - temp_dir[0] = '\0'; BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_CONFIG, NULL); BLI_dir_create_recursive(temp_dir); /* Create 'config' subdir if it does not exist already */ - temp_dir[0] = '\0'; + BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_DATA, NULL); BLI_dir_create_recursive(temp_dir); /* Create 'data' subdir if it does not exist already */ mds->cache_flag &= ~(FLUID_DOMAIN_BAKED_DATA | FLUID_DOMAIN_OUTDATED_DATA); |