[Bf-blender-cvs] [a6e582164f1] master: Libmv: Cleanup, make strict compiler more happy

Sergey Sharybin noreply at git.blender.org
Mon Jun 11 13:02:14 CEST 2018


Commit: a6e582164f11c618a324dad1a2ae2c73cbc85b77
Author: Sergey Sharybin
Date:   Mon Jun 11 12:53:11 2018 +0200
Branches: master
https://developer.blender.org/rBa6e582164f11c618a324dad1a2ae2c73cbc85b77

Libmv: Cleanup, make strict compiler more happy

In C++ it is not really safe to memcpy objects, and newer GCC will warn
about this. However, we don't use our vector for unsafe-to-memcpy objects,
so just explicitly silence that warning.

===================================================================

M	intern/libmv/libmv/base/vector.h

===================================================================

diff --git a/intern/libmv/libmv/base/vector.h b/intern/libmv/libmv/base/vector.h
index 1931fb0b1f9..bdc4392155c 100644
--- a/intern/libmv/libmv/base/vector.h
+++ b/intern/libmv/libmv/base/vector.h
@@ -121,7 +121,7 @@ class vector {
   void reserve(unsigned int size) {
     if (size > size_) {
       T *data = static_cast<T *>(allocate(size));
-      memcpy(data, data_, sizeof(*data)*size_);
+      memcpy(static_cast<void *>(data), data_, sizeof(*data)*size_);
       allocator_.deallocate(data_, capacity_);
       data_ = data;
       capacity_ = size;



More information about the Bf-blender-cvs mailing list