diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-06-07 17:06:30 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-06-07 17:30:25 +0300 |
commit | 785a518ebe6d27a67a382f597c4d65444d6d8368 (patch) | |
tree | ac1d984bb3531a4d9b6b738d40b8e7349583d074 /source | |
parent | 2bf56f7fbbf693a4a54a5c679cda3c3882545af2 (diff) |
Cleanup: silence warnings
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract_mesh.cc | 19 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract_mesh_private.h | 2 |
2 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.cc b/source/blender/draw/intern/draw_cache_extract_mesh.cc index 2ec1827f8f2..8d6064179ad 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh.cc +++ b/source/blender/draw/intern/draw_cache_extract_mesh.cc @@ -544,6 +544,11 @@ struct MeshRenderDataUpdateTaskData { eMRIterType iter_type; eMRDataType data_flag; + MeshRenderDataUpdateTaskData(MeshRenderData *mr, eMRIterType iter_type, eMRDataType data_flag) + : mr(mr), iter_type(iter_type), data_flag(data_flag) + { + } + ~MeshRenderDataUpdateTaskData() { mesh_render_data_free(mr); @@ -554,8 +559,9 @@ struct MeshRenderDataUpdateTaskData { #endif }; -static void mesh_render_data_update_task_data_free(MeshRenderDataUpdateTaskData *taskdata) +static void mesh_render_data_update_task_data_free(void *data) { + MeshRenderDataUpdateTaskData *taskdata = static_cast<MeshRenderDataUpdateTaskData *>(data); BLI_assert(taskdata); delete taskdata; } @@ -577,10 +583,8 @@ static struct TaskNode *mesh_extract_render_data_node_create(struct TaskGraph *t const eMRIterType iter_type, const eMRDataType data_flag) { - MeshRenderDataUpdateTaskData *task_data = new (MeshRenderDataUpdateTaskData); - task_data->mr = mr; - task_data->iter_type = iter_type; - task_data->data_flag = data_flag; + MeshRenderDataUpdateTaskData *task_data = new MeshRenderDataUpdateTaskData( + mr, iter_type, data_flag); struct TaskNode *task_node = BLI_task_graph_node_create( task_graph, @@ -613,7 +617,7 @@ static struct TaskNode *extract_single_threaded_task_node_create(struct TaskGrap /** \name Task Node - UserData Initializer * \{ */ struct UserDataInitTaskData { - ExtractTaskData *td; + ExtractTaskData *td = nullptr; int32_t task_counter = 0; ~UserDataInitTaskData() @@ -626,8 +630,9 @@ struct UserDataInitTaskData { #endif }; -static void user_data_init_task_data_free(UserDataInitTaskData *taskdata) +static void user_data_init_task_data_free(void *data) { + UserDataInitTaskData *taskdata = static_cast<UserDataInitTaskData *>(data); delete taskdata; } diff --git a/source/blender/draw/intern/draw_cache_extract_mesh_private.h b/source/blender/draw/intern/draw_cache_extract_mesh_private.h index 8b8bfed363c..a1249203060 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh_private.h +++ b/source/blender/draw/intern/draw_cache_extract_mesh_private.h @@ -325,7 +325,7 @@ typedef struct ExtractLEdgeMesh_Params { } ExtractLEdgeMesh_Params; typedef void(ExtractLEdgeMeshFn)(const MeshRenderData *mr, const MEdge *med, - const uint ledge_index, + const int ledge_index, void *data); #define EXTRACT_LEDGE_FOREACH_MESH_BEGIN(elem_edge, index_ledge, params, mr) \ |