Code cleanup to use array.data() rather than &array[0]
[blender.git] / intern / cycles / render / mesh_subdivision.cpp
index efb40efbb79c12eaaefefb56dec8aabef9b9ddcc..f87425f00421af8efed14ca854ec74ecf5a59496 100644 (file)
@@ -45,7 +45,7 @@ namespace Far {
                setNumBaseVertices(refiner, mesh.verts.size());
                setNumBaseFaces(refiner, mesh.subd_faces.size());
 
-               ccl::Mesh::SubdFace* face = &mesh.subd_faces[0];
+               const ccl::Mesh::SubdFace* face = mesh.subd_faces.data();
 
                for(int i = 0; i < mesh.subd_faces.size(); i++, face++) {
                        setNumBaseFaceVertices(refiner, i, face->num_corners);
@@ -57,7 +57,7 @@ namespace Far {
        template<>
        bool TopologyRefinerFactory<ccl::Mesh>::assignComponentTopology(TopologyRefiner& refiner, ccl::Mesh const& mesh)
        {
-               ccl::Mesh::SubdFace* face = &mesh.subd_faces[0];
+               const ccl::Mesh::SubdFace* face = mesh.subd_faces.data();
 
                for(int i = 0; i < mesh.subd_faces.size(); i++, face++) {
                        IndexArray face_verts = getBaseFaceVertices(refiner, i);
@@ -195,7 +195,7 @@ public:
                        verts[i].value = mesh->verts[i];
                }
 
-               OsdValue<float3>* src = &verts[0];
+               OsdValue<float3>* src = verts.data();
                for(int i = 0; i < refiner->GetMaxLevel(); i++) {
                        OsdValue<float3>* dest = src + refiner->GetLevel(i).GetNumVertices();
                        Far::PrimvarRefiner(*refiner).Interpolate(i+1, src, dest);
@@ -219,7 +219,7 @@ public:
                        attr.resize(num_refiner_verts + num_local_points);
                        attr.flags |= ATTR_FINAL_SIZE;
 
-                       char* src = &attr.buffer[0];
+                       char* src = attr.buffer.data();
 
                        for(int i = 0; i < refiner->GetMaxLevel(); i++) {
                                char* dest = src + refiner->GetLevel(i).GetNumVertices() * attr.data_sizeof();