Cleanup: Pass explicit type to `MEM_cnew`.
Better avoid fancy implicit typing in this template, and be clear about what type is actually being allocated.
This commit is contained in:
parent
be8778355a
commit
2ff08d6d9c
|
@ -75,7 +75,8 @@ static void brush_copy_data(Main * /*bmain*/, ID *id_dst, const ID *id_src, cons
|
|||
brush_dst->automasking_cavity_curve = BKE_curvemapping_copy(brush_src->automasking_cavity_curve);
|
||||
|
||||
if (brush_src->gpencil_settings != nullptr) {
|
||||
brush_dst->gpencil_settings = MEM_cnew(__func__, *(brush_src->gpencil_settings));
|
||||
brush_dst->gpencil_settings = MEM_cnew<BrushGpencilSettings>(__func__,
|
||||
*(brush_src->gpencil_settings));
|
||||
brush_dst->gpencil_settings->curve_sensitivity = BKE_curvemapping_copy(
|
||||
brush_src->gpencil_settings->curve_sensitivity);
|
||||
brush_dst->gpencil_settings->curve_strength = BKE_curvemapping_copy(
|
||||
|
@ -97,7 +98,8 @@ static void brush_copy_data(Main * /*bmain*/, ID *id_dst, const ID *id_src, cons
|
|||
brush_src->gpencil_settings->curve_rand_value);
|
||||
}
|
||||
if (brush_src->curves_sculpt_settings != nullptr) {
|
||||
brush_dst->curves_sculpt_settings = MEM_cnew(__func__, *(brush_src->curves_sculpt_settings));
|
||||
brush_dst->curves_sculpt_settings = MEM_cnew<BrushCurvesSculptSettings>(
|
||||
__func__, *(brush_src->curves_sculpt_settings));
|
||||
}
|
||||
|
||||
/* enable fake user by default */
|
||||
|
|
|
@ -1100,7 +1100,7 @@ RenderView *RE_RenderViewGetByName(RenderResult *rr, const char *viewname)
|
|||
|
||||
static RenderPass *duplicate_render_pass(RenderPass *rpass)
|
||||
{
|
||||
RenderPass *new_rpass = MEM_cnew("new render pass", *rpass);
|
||||
RenderPass *new_rpass = MEM_cnew<RenderPass>("new render pass", *rpass);
|
||||
new_rpass->next = new_rpass->prev = nullptr;
|
||||
if (new_rpass->rect != nullptr) {
|
||||
new_rpass->rect = static_cast<float *>(MEM_dupallocN(new_rpass->rect));
|
||||
|
@ -1110,7 +1110,7 @@ static RenderPass *duplicate_render_pass(RenderPass *rpass)
|
|||
|
||||
static RenderLayer *duplicate_render_layer(RenderLayer *rl)
|
||||
{
|
||||
RenderLayer *new_rl = MEM_cnew("new render layer", *rl);
|
||||
RenderLayer *new_rl = MEM_cnew<RenderLayer>("new render layer", *rl);
|
||||
new_rl->next = new_rl->prev = nullptr;
|
||||
new_rl->passes.first = new_rl->passes.last = nullptr;
|
||||
new_rl->exrhandle = nullptr;
|
||||
|
@ -1123,7 +1123,7 @@ static RenderLayer *duplicate_render_layer(RenderLayer *rl)
|
|||
|
||||
static RenderView *duplicate_render_view(RenderView *rview)
|
||||
{
|
||||
RenderView *new_rview = MEM_cnew("new render view", *rview);
|
||||
RenderView *new_rview = MEM_cnew<RenderView>("new render view", *rview);
|
||||
if (new_rview->rectf != nullptr) {
|
||||
new_rview->rectf = static_cast<float *>(MEM_dupallocN(new_rview->rectf));
|
||||
}
|
||||
|
@ -1138,7 +1138,7 @@ static RenderView *duplicate_render_view(RenderView *rview)
|
|||
|
||||
RenderResult *RE_DuplicateRenderResult(RenderResult *rr)
|
||||
{
|
||||
RenderResult *new_rr = MEM_cnew("new duplicated render result", *rr);
|
||||
RenderResult *new_rr = MEM_cnew<RenderResult>("new duplicated render result", *rr);
|
||||
new_rr->next = new_rr->prev = nullptr;
|
||||
new_rr->layers.first = new_rr->layers.last = nullptr;
|
||||
new_rr->views.first = new_rr->views.last = nullptr;
|
||||
|
|
Loading…
Reference in New Issue