Cleanup: redundant temp string & over sized filename & number buffer

This commit is contained in:
Campbell Barton 2023-05-30 10:22:04 +10:00
parent 65cc4cd774
commit edcfdea70a
3 changed files with 7 additions and 9 deletions

View File

@ -950,7 +950,7 @@ static bool bake_targets_output_external(const BakeAPIRender *bkr,
}
if (bk_image->tile_number) {
char tmp[FILE_MAX];
char tmp[12];
SNPRINTF(tmp, "%d", bk_image->tile_number);
BLI_path_suffix(filepath, FILE_MAX, tmp, "_");
}

View File

@ -329,8 +329,7 @@ static void SOUND_OT_bake_animation(wmOperatorType *ot)
static int sound_mixdown_exec(bContext *C, wmOperator *op)
{
#ifdef WITH_AUDASPACE
char path[FILE_MAX];
char filename[FILE_MAX];
char filepath[FILE_MAX];
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Main *bmain = CTX_data_main(C);
@ -345,7 +344,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op)
sound_bake_animation_exec(C, op);
RNA_string_get(op->ptr, "filepath", path);
RNA_string_get(op->ptr, "filepath", filepath);
bitrate = RNA_int_get(op->ptr, "bitrate") * 1000;
accuracy = RNA_int_get(op->ptr, "accuracy");
specs.format = RNA_enum_get(op->ptr, "format");
@ -355,8 +354,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op)
specs.channels = scene_eval->r.ffcodecdata.audio_channels;
specs.rate = scene_eval->r.ffcodecdata.audio_mixrate;
STRNCPY(filename, path);
BLI_path_abs(filename, BKE_main_blendfile_path(bmain));
BLI_path_abs(filepath, BKE_main_blendfile_path(bmain));
const double fps = (((double)scene_eval->r.frs_sec) / (double)scene_eval->r.frs_sec_base);
const int start_frame = scene_eval->r.sfra;
@ -367,7 +365,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op)
start_frame * specs.rate / fps,
(end_frame - start_frame + 1) * specs.rate / fps,
accuracy,
filename,
filepath,
specs,
container,
codec,
@ -382,7 +380,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op)
start_frame * specs.rate / fps,
(end_frame - start_frame + 1) * specs.rate / fps,
accuracy,
filename,
filepath,
specs,
container,
codec,

View File

@ -255,7 +255,7 @@ static Sequence *rna_Sequences_new_image(ID *id,
load_data.fit_method = fit_method;
Sequence *seq = SEQ_add_image_strip(bmain, scene, seqbase, &load_data);
char dirpath[FILE_MAX], filename[FILE_MAX];
char dirpath[FILE_MAX], filename[FILE_MAXFILE];
BLI_path_split_dir_file(file, dirpath, sizeof(dirpath), filename, sizeof(filename));
SEQ_add_image_set_directory(seq, dirpath);
SEQ_add_image_load_file(scene, seq, 0, filename);