Cleanup: Alembic, use MEM_cnew

Avoids extra cast. No functionnal change.
This commit is contained in:
Kévin Dietrich
2022-11-25 14:27:18 +01:00
parent 6422f75088
commit 3cf803cf3c

View File

@@ -134,8 +134,7 @@ static bool gather_objects_paths(const IObject &object, ListBase *object_paths)
}
if (get_path) {
void *abc_path_void = MEM_callocN(sizeof(CacheObjectPath), "CacheObjectPath");
CacheObjectPath *abc_path = static_cast<CacheObjectPath *>(abc_path_void);
CacheObjectPath *abc_path = MEM_cnew<CacheObjectPath>("CacheObjectPath");
BLI_strncpy(abc_path->path, object.getFullName().c_str(), sizeof(abc_path->path));
BLI_addtail(object_paths, abc_path);
@@ -358,8 +357,7 @@ static std::pair<bool, AbcObjectReader *> visit_object(
readers.push_back(reader);
reader->incref();
CacheObjectPath *abc_path = static_cast<CacheObjectPath *>(
MEM_callocN(sizeof(CacheObjectPath), "CacheObjectPath"));
CacheObjectPath *abc_path = MEM_cnew<CacheObjectPath>("CacheObjectPath");
BLI_strncpy(abc_path->path, full_name.c_str(), sizeof(abc_path->path));
BLI_addtail(&settings.cache_file->object_paths, abc_path);