diff --git a/source/blender/sequencer/intern/channels.cc b/source/blender/sequencer/intern/channels.cc index 72adebde310..2a84c9fca50 100644 --- a/source/blender/sequencer/intern/channels.cc +++ b/source/blender/sequencer/intern/channels.cc @@ -37,8 +37,7 @@ void channels_ensure(ListBase *channels) { /* Allocate channels. Channel 0 is never used, but allocated to prevent off by 1 issues. */ for (int i = 0; i < MAX_CHANNELS + 1; i++) { - SeqTimelineChannel *channel = static_cast( - MEM_callocN(sizeof(SeqTimelineChannel), "seq timeline channel")); + SeqTimelineChannel *channel = MEM_callocN("seq timeline channel"); SNPRINTF(channel->name, DATA_("Channel %d"), i); channel->index = i; BLI_addtail(channels, channel); diff --git a/source/blender/sequencer/intern/disk_cache.cc b/source/blender/sequencer/intern/disk_cache.cc index ef1d19added..8930718d315 100644 --- a/source/blender/sequencer/intern/disk_cache.cc +++ b/source/blender/sequencer/intern/disk_cache.cc @@ -135,8 +135,7 @@ static DiskCacheFile *seq_disk_cache_add_file_to_list(SeqDiskCache *disk_cache, const char *filepath) { - DiskCacheFile *cache_file = static_cast( - MEM_callocN(sizeof(DiskCacheFile), "SeqDiskCacheFile")); + DiskCacheFile *cache_file = MEM_callocN("SeqDiskCacheFile"); char dir[FILE_MAXDIR], file[FILE_MAX]; BLI_path_split_dir_file(filepath, dir, sizeof(dir), file, sizeof(file)); STRNCPY(cache_file->filepath, filepath); @@ -669,8 +668,7 @@ ImBuf *seq_disk_cache_read_file(SeqDiskCache *disk_cache, SeqCacheKey *key) SeqDiskCache *seq_disk_cache_create(Main *bmain, Scene *scene) { - SeqDiskCache *disk_cache = static_cast( - MEM_callocN(sizeof(SeqDiskCache), "SeqDiskCache")); + SeqDiskCache *disk_cache = MEM_callocN("SeqDiskCache"); disk_cache->bmain = bmain; BLI_mutex_init(&disk_cache->read_write_mutex); seq_disk_cache_handle_versioning(disk_cache); diff --git a/source/blender/sequencer/intern/effects/vse_effect_blend.cc b/source/blender/sequencer/intern/effects/vse_effect_blend.cc index 1fe0f3b442a..401305b3721 100644 --- a/source/blender/sequencer/intern/effects/vse_effect_blend.cc +++ b/source/blender/sequencer/intern/effects/vse_effect_blend.cc @@ -339,8 +339,10 @@ static void init_colormix_effect(Strip *strip) if (strip->effectdata) { MEM_freeN(strip->effectdata); } - strip->effectdata = MEM_callocN(sizeof(ColorMixVars), "colormixvars"); - ColorMixVars *data = (ColorMixVars *)strip->effectdata; + + ColorMixVars *data = MEM_callocN("colormixvars"); + strip->effectdata = data; + data->blend_effect = STRIP_TYPE_OVERLAY; data->factor = 1.0f; } diff --git a/source/blender/sequencer/intern/effects/vse_effect_gaussian_blur.cc b/source/blender/sequencer/intern/effects/vse_effect_gaussian_blur.cc index 8e69019d943..ba8bca63f7b 100644 --- a/source/blender/sequencer/intern/effects/vse_effect_gaussian_blur.cc +++ b/source/blender/sequencer/intern/effects/vse_effect_gaussian_blur.cc @@ -25,7 +25,7 @@ static void init_gaussian_blur_effect(Strip *strip) MEM_freeN(strip->effectdata); } - strip->effectdata = MEM_callocN(sizeof(GaussianBlurVars), "gaussianblurvars"); + strip->effectdata = MEM_callocN("gaussianblurvars"); } static int num_inputs_gaussian_blur() diff --git a/source/blender/sequencer/intern/effects/vse_effect_glow.cc b/source/blender/sequencer/intern/effects/vse_effect_glow.cc index 94571faa71a..45637775cc6 100644 --- a/source/blender/sequencer/intern/effects/vse_effect_glow.cc +++ b/source/blender/sequencer/intern/effects/vse_effect_glow.cc @@ -130,9 +130,9 @@ static void init_glow_effect(Strip *strip) MEM_freeN(strip->effectdata); } - strip->effectdata = MEM_callocN(sizeof(GlowVars), "glowvars"); + GlowVars *glow = MEM_callocN("glowvars"); + strip->effectdata = glow; - GlowVars *glow = (GlowVars *)strip->effectdata; glow->fMini = 0.25; glow->fClamp = 1.0; glow->fBoost = 0.5; diff --git a/source/blender/sequencer/intern/effects/vse_effect_solid_color.cc b/source/blender/sequencer/intern/effects/vse_effect_solid_color.cc index 1c9b6b16cdd..75c672da9b4 100644 --- a/source/blender/sequencer/intern/effects/vse_effect_solid_color.cc +++ b/source/blender/sequencer/intern/effects/vse_effect_solid_color.cc @@ -23,9 +23,9 @@ static void init_solid_color(Strip *strip) MEM_freeN(strip->effectdata); } - strip->effectdata = MEM_callocN(sizeof(SolidColorVars), "solidcolor"); + SolidColorVars *cv = MEM_callocN("solidcolor"); + strip->effectdata = cv; - SolidColorVars *cv = (SolidColorVars *)strip->effectdata; cv->col[0] = cv->col[1] = cv->col[2] = 0.5; } diff --git a/source/blender/sequencer/intern/effects/vse_effect_speed.cc b/source/blender/sequencer/intern/effects/vse_effect_speed.cc index da5813d0626..fc075d84885 100644 --- a/source/blender/sequencer/intern/effects/vse_effect_speed.cc +++ b/source/blender/sequencer/intern/effects/vse_effect_speed.cc @@ -29,9 +29,9 @@ static void init_speed_effect(Strip *strip) MEM_freeN(strip->effectdata); } - strip->effectdata = MEM_callocN(sizeof(SpeedControlVars), "speedcontrolvars"); + SpeedControlVars *v = MEM_callocN("speedcontrolvars"); + strip->effectdata = v; - SpeedControlVars *v = (SpeedControlVars *)strip->effectdata; v->speed_control_type = SEQ_SPEED_STRETCH; v->speed_fader = 1.0f; v->speed_fader_length = 0.0f; @@ -95,7 +95,7 @@ void strip_effect_speed_rebuild_map(Scene *scene, Strip *strip) MEM_freeN(v->frameMap); } - v->frameMap = static_cast(MEM_mallocN(sizeof(float) * effect_strip_length, __func__)); + v->frameMap = MEM_malloc_arrayN(size_t(effect_strip_length), __func__); v->frameMap[0] = 0.0f; float target_frame = 0; diff --git a/source/blender/sequencer/intern/effects/vse_effect_text.cc b/source/blender/sequencer/intern/effects/vse_effect_text.cc index 71fc3c7f1da..a7e5259e45f 100644 --- a/source/blender/sequencer/intern/effects/vse_effect_text.cc +++ b/source/blender/sequencer/intern/effects/vse_effect_text.cc @@ -174,8 +174,9 @@ static void init_text_effect(Strip *strip) MEM_freeN(strip->effectdata); } - TextVars *data = static_cast( - strip->effectdata = MEM_callocN(sizeof(TextVars), "textvars")); + TextVars *data = MEM_callocN("textvars"); + strip->effectdata = data; + data->text_font = nullptr; data->text_blf_id = -1; data->text_size = 60.0f; diff --git a/source/blender/sequencer/intern/effects/vse_effect_transform.cc b/source/blender/sequencer/intern/effects/vse_effect_transform.cc index aeefac3f4bf..9a6b47c3c8f 100644 --- a/source/blender/sequencer/intern/effects/vse_effect_transform.cc +++ b/source/blender/sequencer/intern/effects/vse_effect_transform.cc @@ -27,9 +27,8 @@ static void init_transform_effect(Strip *strip) MEM_freeN(strip->effectdata); } - strip->effectdata = MEM_callocN(sizeof(TransformVars), "transformvars"); - - TransformVars *transform = (TransformVars *)strip->effectdata; + TransformVars *transform = MEM_callocN("transformvars"); + strip->effectdata = transform; transform->ScalexIni = 1.0f; transform->ScaleyIni = 1.0f; diff --git a/source/blender/sequencer/intern/effects/vse_effect_wipe.cc b/source/blender/sequencer/intern/effects/vse_effect_wipe.cc index b217e04f665..905297b3b0a 100644 --- a/source/blender/sequencer/intern/effects/vse_effect_wipe.cc +++ b/source/blender/sequencer/intern/effects/vse_effect_wipe.cc @@ -288,7 +288,7 @@ static void init_wipe_effect(Strip *strip) MEM_freeN(strip->effectdata); } - strip->effectdata = MEM_callocN(sizeof(WipeVars), "wipevars"); + strip->effectdata = MEM_callocN("wipevars"); } static int num_inputs_wipe() diff --git a/source/blender/sequencer/intern/image_cache.cc b/source/blender/sequencer/intern/image_cache.cc index 6c6602778b3..edc1585b8c8 100644 --- a/source/blender/sequencer/intern/image_cache.cc +++ b/source/blender/sequencer/intern/image_cache.cc @@ -492,7 +492,7 @@ static void seq_cache_create(Main *bmain, Scene *scene) { BLI_mutex_lock(&cache_create_lock); if (scene->ed->cache == nullptr) { - SeqCache *cache = static_cast(MEM_callocN(sizeof(SeqCache), "SeqCache")); + SeqCache *cache = MEM_callocN("SeqCache"); cache->keys_pool = BLI_mempool_create(sizeof(SeqCacheKey), 0, 64, BLI_MEMPOOL_NOP); cache->items_pool = BLI_mempool_create(sizeof(SeqCacheItem), 0, 64, BLI_MEMPOOL_NOP); cache->hash = BLI_ghash_new(seq_cache_hashhash, seq_cache_hashcmp, "SeqCache hash"); diff --git a/source/blender/sequencer/intern/proxy.cc b/source/blender/sequencer/intern/proxy.cc index c4489534421..c6ea16552f8 100644 --- a/source/blender/sequencer/intern/proxy.cc +++ b/source/blender/sequencer/intern/proxy.cc @@ -462,8 +462,7 @@ bool proxy_rebuild_context(Main *bmain, relations_sequence_free_anim(strip); - context = static_cast( - MEM_callocN(sizeof(IndexBuildContext), "strip proxy rebuild context")); + context = MEM_callocN("strip proxy rebuild context"); nseq = sequence_dupli_recursive(scene, scene, nullptr, strip, 0); diff --git a/source/blender/sequencer/intern/proxy_job.cc b/source/blender/sequencer/intern/proxy_job.cc index 86fac50a1b9..6506e9c2f03 100644 --- a/source/blender/sequencer/intern/proxy_job.cc +++ b/source/blender/sequencer/intern/proxy_job.cc @@ -73,7 +73,7 @@ ProxyJob *ED_seq_proxy_job_get(const bContext *C, wmJob *wm_job) Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); ProxyJob *pj = static_cast(WM_jobs_customdata_get(wm_job)); if (!pj) { - pj = static_cast(MEM_callocN(sizeof(ProxyJob), "proxy rebuild job")); + pj = MEM_callocN("proxy rebuild job"); pj->depsgraph = depsgraph; pj->scene = scene; pj->main = CTX_data_main(C); diff --git a/source/blender/sequencer/intern/render.cc b/source/blender/sequencer/intern/render.cc index 5503752e8ff..814c6795bde 100644 --- a/source/blender/sequencer/intern/render.cc +++ b/source/blender/sequencer/intern/render.cc @@ -830,7 +830,7 @@ static void convert_multilayer_ibuf(ImBuf *ibuf) /* Combined layer might be non-4 channels, however the rest * of sequencer assumes RGBA everywhere. Convert to 4 channel if needed. */ if (ibuf->float_buffer.data != nullptr && ibuf->channels != 4) { - float *dst = static_cast(MEM_mallocN(sizeof(float[4]) * ibuf->x * ibuf->y, __func__)); + float *dst = MEM_malloc_arrayN(4 * size_t(ibuf->x) * size_t(ibuf->y), __func__); IMB_buffer_float_from_float_threaded(dst, ibuf->float_buffer.data, ibuf->channels, @@ -958,8 +958,8 @@ static ImBuf *seq_render_image_strip(const RenderData *context, if (is_multiview_render) { int totviews = BKE_scene_multiview_num_views_get(&context->scene->r); - ImBuf **ibufs_arr = static_cast( - MEM_callocN(sizeof(ImBuf *) * totviews, "Sequence Image Views Imbufs")); + ImBuf **ibufs_arr = MEM_calloc_arrayN(size_t(totviews), + "Sequence Image Views Imbufs"); for (int view_id = 0; view_id < totfiles; view_id++) { ibufs_arr[view_id] = seq_render_image_strip_view( @@ -1114,8 +1114,7 @@ static ImBuf *seq_render_movie_strip(const RenderData *context, if (is_multiview_render) { ImBuf **ibuf_arr; int totviews = BKE_scene_multiview_num_views_get(&context->scene->r); - ibuf_arr = static_cast( - MEM_callocN(sizeof(ImBuf *) * totviews, "Sequence Image Views Imbufs")); + ibuf_arr = MEM_calloc_arrayN(size_t(totviews), "Sequence Image Views Imbufs"); int ibuf_view_id; for (ibuf_view_id = 0, sanim = static_cast(strip->anims.first); sanim; @@ -1276,8 +1275,7 @@ ImBuf *seq_render_mask(const RenderData *context, Mask *mask, float frame_index, context->depsgraph, mask->sfra + frame_index); BKE_animsys_evaluate_animdata(&mask_temp->id, adt, &anim_eval_context, ADT_RECALC_ANIM, false); - maskbuf = static_cast( - MEM_mallocN(sizeof(float) * context->rectx * context->recty, __func__)); + maskbuf = MEM_malloc_arrayN(size_t(context->rectx) * size_t(context->recty), __func__); mr_handle = BKE_maskrasterize_handle_new(); @@ -1520,8 +1518,7 @@ static ImBuf *seq_render_scene_strip(const RenderData *context, goto finally; } - ibufs_arr = static_cast( - MEM_callocN(sizeof(ImBuf *) * totviews, "Sequence Image Views Imbufs")); + ibufs_arr = MEM_calloc_arrayN(size_t(totviews), "Sequence Image Views Imbufs"); if (re == nullptr) { re = RE_NewSceneRender(scene); diff --git a/source/blender/sequencer/intern/sequencer.cc b/source/blender/sequencer/intern/sequencer.cc index fffb0d9a320..87085e9c4e3 100644 --- a/source/blender/sequencer/intern/sequencer.cc +++ b/source/blender/sequencer/intern/sequencer.cc @@ -66,8 +66,7 @@ namespace blender::seq { StripProxy *seq_strip_proxy_alloc() { - StripProxy *strip_proxy = static_cast( - MEM_callocN(sizeof(StripProxy), "StripProxy")); + StripProxy *strip_proxy = MEM_callocN("StripProxy"); strip_proxy->quality = 50; strip_proxy->build_tc_flags = SEQ_PROXY_TC_RECORD_RUN | SEQ_PROXY_TC_RECORD_RUN_NO_GAPS; strip_proxy->tc = SEQ_PROXY_TC_RECORD_RUN; @@ -76,17 +75,16 @@ StripProxy *seq_strip_proxy_alloc() static StripData *seq_strip_alloc(int type) { - StripData *data = static_cast(MEM_callocN(sizeof(StripData), "strip")); + StripData *data = MEM_callocN("strip"); if (type != STRIP_TYPE_SOUND_RAM) { - data->transform = static_cast( - MEM_callocN(sizeof(StripTransform), "StripTransform")); + data->transform = MEM_callocN("StripTransform"); data->transform->scale_x = 1; data->transform->scale_y = 1; data->transform->origin[0] = 0.5f; data->transform->origin[1] = 0.5f; data->transform->filter = SEQ_TRANSFORM_FILTER_AUTO; - data->crop = static_cast(MEM_callocN(sizeof(StripCrop), "StripCrop")); + data->crop = MEM_callocN("StripCrop"); } data->us = 1; @@ -129,7 +127,7 @@ Strip *sequence_alloc(ListBase *lb, int timeline_frame, int machine, int type) { Strip *strip; - strip = static_cast(MEM_callocN(sizeof(Strip), "addseq")); + strip = MEM_callocN("addseq"); BLI_addtail(lb, strip); *((short *)strip->name) = ID_SEQ; @@ -155,8 +153,7 @@ Strip *sequence_alloc(ListBase *lb, int timeline_frame, int machine, int type) } strip->data = seq_strip_alloc(type); - strip->stereo3d_format = static_cast( - MEM_callocN(sizeof(Stereo3dFormat), "Sequence Stereo Format")); + strip->stereo3d_format = MEM_callocN("Sequence Stereo Format"); strip->color_tag = STRIP_COLOR_NONE; @@ -274,7 +271,7 @@ Editing *editing_ensure(Scene *scene) if (scene->ed == nullptr) { Editing *ed; - ed = scene->ed = static_cast(MEM_callocN(sizeof(Editing), "addseq")); + ed = scene->ed = MEM_callocN("addseq"); ed->seqbasep = &ed->seqbase; ed->cache = nullptr; ed->cache_flag = (SEQ_CACHE_STORE_FINAL_OUT | SEQ_CACHE_STORE_RAW); @@ -339,8 +336,8 @@ static void seq_new_fix_links_recursive(Strip *strip, blender::Map( - MEM_callocN(sizeof(SequencerToolSettings), "Sequencer tool settings")); + SequencerToolSettings *tool_settings = MEM_callocN( + "Sequencer tool settings"); tool_settings->fit_method = SEQ_SCALE_TO_FIT; tool_settings->snap_mode = SEQ_SNAP_TO_STRIPS | SEQ_SNAP_TO_CURRENT_FRAME | SEQ_SNAP_TO_STRIP_HOLD | SEQ_SNAP_TO_MARKERS | SEQ_SNAP_TO_RETIMING | @@ -429,7 +426,7 @@ static MetaStack *seq_meta_stack_alloc(const Scene *scene, Strip *strip_meta) { Editing *ed = editing_get(scene); - MetaStack *ms = static_cast(MEM_mallocN(sizeof(MetaStack), "metastack")); + MetaStack *ms = MEM_mallocN("metastack"); BLI_addhead(&ed->metastack, ms); ms->parseq = strip_meta; diff --git a/source/blender/sequencer/intern/sound.cc b/source/blender/sequencer/intern/sound.cc index 23207b549a7..39b534ae80f 100644 --- a/source/blender/sequencer/intern/sound.cc +++ b/source/blender/sequencer/intern/sound.cc @@ -276,8 +276,7 @@ void *sound_equalizermodifier_recreator(Strip *strip, SequenceModifierData *smd, return sound; } - float *buf = (float *)MEM_callocN(sizeof(float) * SOUND_EQUALIZER_SIZE_DEFINITION, - "eqrecreator"); + float *buf = MEM_calloc_arrayN(SOUND_EQUALIZER_SIZE_DEFINITION, "eqrecreator"); CurveMapping *eq_mapping; CurveMap *cm; diff --git a/source/blender/sequencer/intern/strip_add.cc b/source/blender/sequencer/intern/strip_add.cc index 5827a1c1bcb..024dff85406 100644 --- a/source/blender/sequencer/intern/strip_add.cc +++ b/source/blender/sequencer/intern/strip_add.cc @@ -237,8 +237,7 @@ Strip *add_image_strip(Main *bmain, Scene *scene, ListBase *seqbase, LoadData *l seqbase, load_data->start_frame, load_data->channel, STRIP_TYPE_IMAGE); strip->len = load_data->image.len; StripData *data = strip->data; - data->stripdata = static_cast( - MEM_callocN(load_data->image.len * sizeof(StripElem), "stripelem")); + data->stripdata = MEM_calloc_arrayN(size_t(load_data->image.len), "stripelem"); if (strip->len == 1) { strip->flag |= SEQ_SINGLE_FRAME_CONTENT; @@ -328,8 +327,7 @@ Strip *add_sound_strip(Main *bmain, Scene *scene, ListBase *seqbase, LoadData *l StripData *data = strip->data; /* We only need 1 element to store the filename. */ - StripElem *se = data->stripdata = static_cast( - MEM_callocN(sizeof(StripElem), "stripelem")); + StripElem *se = data->stripdata = MEM_callocN("stripelem"); BLI_path_split_dir_file( load_data->path, data->dirpath, sizeof(data->dirpath), se->filename, sizeof(se->filename)); @@ -401,8 +399,7 @@ Strip *add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, LoadData *l char colorspace[64] = "\0"; /* MAX_COLORSPACE_NAME */ bool is_multiview_loaded = false; const int totfiles = seq_num_files(scene, load_data->views_format, load_data->use_multiview); - MovieReader **anim_arr = static_cast( - MEM_callocN(sizeof(MovieReader *) * totfiles, "Video files")); + MovieReader **anim_arr = MEM_calloc_arrayN(size_t(totfiles), "Video files"); int i; int orig_width = 0; int orig_height = 0; @@ -474,7 +471,7 @@ Strip *add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, LoadData *l for (i = 0; i < totfiles; i++) { if (anim_arr[i]) { - StripAnim *sanim = static_cast(MEM_mallocN(sizeof(StripAnim), "Strip Anim")); + StripAnim *sanim = MEM_mallocN("Strip Anim"); BLI_addtail(&strip->anims, sanim); sanim->anim = anim_arr[i]; } @@ -510,7 +507,7 @@ Strip *add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, LoadData *l StripData *data = strip->data; /* We only need 1 element for MOVIE strips. */ StripElem *se; - data->stripdata = se = static_cast(MEM_callocN(sizeof(StripElem), "stripelem")); + data->stripdata = se = MEM_callocN("stripelem"); data->stripdata->orig_width = orig_width; data->stripdata->orig_height = orig_height; data->stripdata->orig_fps = video_fps; @@ -593,7 +590,7 @@ void add_reload_new_file(Main *bmain, Scene *scene, Strip *strip, const bool loc if (anim) { seq_anim_add_suffix(scene, anim, i); - sanim = static_cast(MEM_mallocN(sizeof(StripAnim), "Strip Anim")); + sanim = MEM_mallocN("Strip Anim"); BLI_addtail(&strip->anims, sanim); sanim->anim = anim; } @@ -609,7 +606,7 @@ void add_reload_new_file(Main *bmain, Scene *scene, Strip *strip, const bool loc strip->streamindex, strip->data->colorspace_settings.name); if (anim) { - sanim = static_cast(MEM_mallocN(sizeof(StripAnim), "Strip Anim")); + sanim = MEM_mallocN("Strip Anim"); BLI_addtail(&strip->anims, sanim); sanim->anim = anim; } diff --git a/source/blender/sequencer/intern/strip_retiming.cc b/source/blender/sequencer/intern/strip_retiming.cc index 8afb0786e4f..1ce30be1ec0 100644 --- a/source/blender/sequencer/intern/strip_retiming.cc +++ b/source/blender/sequencer/intern/strip_retiming.cc @@ -111,7 +111,7 @@ void retiming_data_ensure(Strip *strip) return; } - strip->retiming_keys = (SeqRetimingKey *)MEM_calloc_arrayN(2, sizeof(SeqRetimingKey), __func__); + strip->retiming_keys = MEM_calloc_arrayN(2, __func__); SeqRetimingKey *key = strip->retiming_keys + 1; key->strip_frame_index = strip->len - 1; key->retiming_factor = 1.0f; @@ -345,8 +345,7 @@ static SeqRetimingKey *strip_retiming_add_key(Strip *strip, float frame_index) BLI_assert(new_key_index >= 0); BLI_assert(new_key_index < keys_count); - SeqRetimingKey *new_keys = (SeqRetimingKey *)MEM_callocN( - (keys_count + 1) * sizeof(SeqRetimingKey), __func__); + SeqRetimingKey *new_keys = MEM_calloc_arrayN(keys_count + 1, __func__); if (new_key_index > 0) { memcpy(new_keys, keys, new_key_index * sizeof(SeqRetimingKey)); } @@ -443,8 +442,7 @@ void retiming_remove_multiple_keys(Strip *strip, blender::Vector(new_keys_count, __func__); int keys_copied = 0; /* Copy keys to new array. */ @@ -480,8 +478,7 @@ static void strip_retiming_remove_key_ex(Strip *strip, SeqRetimingKey *key) } size_t keys_count = retiming_keys_count(strip); - SeqRetimingKey *keys = (SeqRetimingKey *)MEM_callocN((keys_count - 1) * sizeof(SeqRetimingKey), - __func__); + SeqRetimingKey *keys = MEM_calloc_arrayN(keys_count - 1, __func__); const int key_index = key - strip->retiming_keys; memcpy(keys, strip->retiming_keys, (key_index) * sizeof(SeqRetimingKey)); diff --git a/source/blender/sequencer/intern/utils.cc b/source/blender/sequencer/intern/utils.cc index 0ce0d737f2d..541938f7f2e 100644 --- a/source/blender/sequencer/intern/utils.cc +++ b/source/blender/sequencer/intern/utils.cc @@ -278,7 +278,7 @@ static bool open_anim_file_multiview(Scene *scene, Strip *strip, const char *fil char filepath_view[FILE_MAX]; SNPRINTF(filepath_view, "%s%s%s", prefix, suffix, ext); - StripAnim *sanim = static_cast(MEM_mallocN(sizeof(StripAnim), "Strip Anim")); + StripAnim *sanim = MEM_mallocN("Strip Anim"); /* Multiview files must be loaded, otherwise it is not possible to detect failure. */ open_anim_filepath(strip, sanim, filepath_view, true); @@ -321,7 +321,7 @@ void strip_open_anim_file(Scene *scene, Strip *strip, bool openfile) } if (!is_multiview || !multiview_is_loaded) { - StripAnim *sanim = static_cast(MEM_mallocN(sizeof(StripAnim), "Strip Anim")); + StripAnim *sanim = MEM_mallocN("Strip Anim"); BLI_addtail(&strip->anims, sanim); open_anim_filepath(strip, sanim, filepath, openfile); index_dir_set(ed, strip, sanim);