From 8a76a28afaed665ca9ea11d96f02fbcf91e7b62b Mon Sep 17 00:00:00 2001 From: samypr100 <3933065+samypr100@users.noreply.github.com> Date: Fri, 17 Feb 2023 12:53:25 -0500 Subject: [PATCH] memcpy --> std::memcpy --- cpp/open3d/io/file_format/FileXYZ.cpp | 2 +- cpp/pybind/io/class_io.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cpp/open3d/io/file_format/FileXYZ.cpp b/cpp/open3d/io/file_format/FileXYZ.cpp index 0a8f8a06a606..c45a663220aa 100644 --- a/cpp/open3d/io/file_format/FileXYZ.cpp +++ b/cpp/open3d/io/file_format/FileXYZ.cpp @@ -164,7 +164,7 @@ bool WritePointCloudInMemoryToXYZ(unsigned char *&buffer, } length = content.length(); buffer = new unsigned char[length]; // we do this for the caller - memcpy(buffer, content.c_str(), length); + std::memcpy(buffer, content.c_str(), length); reporter.Finish(); return true; diff --git a/cpp/pybind/io/class_io.cpp b/cpp/pybind/io/class_io.cpp index 20942c5d68b4..2d7946dc62a0 100644 --- a/cpp/pybind/io/class_io.cpp +++ b/cpp/pybind/io/class_io.cpp @@ -202,7 +202,8 @@ void pybind_class_io(py::module &m_io) { const char *dataptr = PYBIND11_BYTES_AS_STRING(bytes.ptr()); auto length = PYBIND11_BYTES_SIZE(bytes.ptr()); auto buffer = new unsigned char[length]; - memcpy(buffer, dataptr, length); // copy before releasing GIL + // copy before releasing GIL + std::memcpy(buffer, dataptr, length); py::gil_scoped_release release; geometry::PointCloud pcd; ReadPointCloud(reinterpret_cast(buffer),