Libmv: Cleanup, make strict compiler more happy
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 11 Jun 2018 10:53:11 +0000 (12:53 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 11 Jun 2018 11:02:10 +0000 (13:02 +0200)
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.

intern/libmv/libmv/base/vector.h

index 1931fb0..bdc4392 100644 (file)
@@ -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;