Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 11 Jun 2018 12:44:03 +0000 (14:44 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Mon, 11 Jun 2018 12:44:03 +0000 (14:44 +0200)
intern/cycles/blender/blender_camera.cpp
intern/cycles/blender/blender_util.h
intern/cycles/bvh/bvh_params.h
intern/cycles/kernel/closure/alloc.h
intern/cycles/kernel/osl/osl_services.cpp
intern/cycles/kernel/osl/osl_shader.cpp
intern/cycles/render/camera.cpp
intern/cycles/render/scene.cpp
intern/cycles/render/svm.cpp
intern/cycles/util/util_vector.h
intern/libmv/libmv/base/vector.h

index c7d3752..aea63b6 100644 (file)
@@ -90,7 +90,7 @@ struct BlenderCamera {
 static void blender_camera_init(BlenderCamera *bcam,
                                 BL::RenderSettings& b_render)
 {
-       memset(bcam, 0, sizeof(BlenderCamera));
+       memset((void *)bcam, 0, sizeof(BlenderCamera));
 
        bcam->type = CAMERA_PERSPECTIVE;
        bcam->zoom = 1.0f;
index 8a874b7..e9ede91 100644 (file)
@@ -251,7 +251,7 @@ static inline Transform get_transform(const BL::Array<float, 16>& array)
 
        /* We assume both types to be just 16 floats, and transpose because blender
         * use column major matrix order while we use row major. */
-       memcpy(&projection, &array, sizeof(float)*16);
+       memcpy((void *)&projection, &array, sizeof(float)*16);
        projection = projection_transpose(projection);
 
        /* Drop last row, matrix is assumed to be affine transform. */
index 89a379c..d8dd7df 100644 (file)
@@ -182,7 +182,10 @@ public:
 
        BVHReference& operator=(const BVHReference &arg) {
                if(&arg != this) {
-                       memcpy(this, &arg, sizeof(BVHReference));
+                       /* TODO(sergey): Check if it is still faster to memcpy() with
+                        * modern compilers.
+                        */
+                       memcpy((void *)this, &arg, sizeof(BVHReference));
                }
                return *this;
        }
index b903aeb..acccba9 100644 (file)
@@ -75,7 +75,7 @@ ccl_device_inline ShaderClosure *bsdf_alloc_osl(ShaderData *sd, int size, float3
        if(!sc)
                return NULL;
 
-       memcpy(sc, data, size);
+       memcpy((void *)sc, data, size);
 
        float sample_weight = fabsf(average(weight));
        sc->weight = weight;
index 32d86b7..5f4baf6 100644 (file)
@@ -65,13 +65,13 @@ CCL_NAMESPACE_BEGIN
 static void copy_matrix(OSL::Matrix44& m, const Transform& tfm)
 {
        ProjectionTransform t = projection_transpose(ProjectionTransform(tfm));
-       memcpy(&m, &t, sizeof(m));
+       memcpy((void *)&m, &t, sizeof(m));
 }
 
 static void copy_matrix(OSL::Matrix44& m, const ProjectionTransform& tfm)
 {
        ProjectionTransform t = projection_transpose(tfm);
-       memcpy(&m, &t, sizeof(m));
+       memcpy((void *)&m, &t, sizeof(m));
 }
 
 /* static ustrings */
index 6b3a996..b7d1c62 100644 (file)
@@ -53,7 +53,7 @@ void OSLShader::thread_init(KernelGlobals *kg, KernelGlobals *kernel_globals, OS
        OSL::ShadingSystem *ss = kg->osl->ss;
        OSLThreadData *tdata = new OSLThreadData();
 
-       memset(&tdata->globals, 0, sizeof(OSL::ShaderGlobals));
+       memset((void *)&tdata->globals, 0, sizeof(OSL::ShaderGlobals));
        tdata->globals.tracedata = &tdata->tracedata;
        tdata->globals.flipHandedness = false;
        tdata->osl_thread_info = ss->create_thread_info();
index 38936ff..734cdff 100644 (file)
@@ -176,7 +176,7 @@ Camera::Camera()
        need_flags_update = true;
        previous_need_motion = -1;
 
-       memset(&kernel_camera, 0, sizeof(kernel_camera));
+       memset((void *)&kernel_camera, 0, sizeof(kernel_camera));
 }
 
 Camera::~Camera()
index b35cdbd..c0f1ae0 100644 (file)
@@ -79,13 +79,13 @@ DeviceScene::DeviceScene(Device *device)
   sobol_directions(device, "__sobol_directions", MEM_TEXTURE),
   ies_lights(device, "__ies", MEM_TEXTURE)
 {
-       memset(&data, 0, sizeof(data));
+       memset((void*)&data, 0, sizeof(data));
 }
 
 Scene::Scene(const SceneParams& params_, Device *device)
 : device(device), dscene(device), params(params_)
 {
-       memset(&dscene.data, 0, sizeof(dscene.data));
+       memset((void *)&dscene.data, 0, sizeof(dscene.data));
 
        camera = new Camera();
        dicing_camera = new Camera();
index eb8a35a..626f160 100644 (file)
@@ -735,7 +735,7 @@ void SVMCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType ty
        }
 
        /* clear all compiler state */
-       memset(&active_stack, 0, sizeof(active_stack));
+       memset((void *)&active_stack, 0, sizeof(active_stack));
        current_svm_nodes.clear();
 
        foreach(ShaderNode *node_iter, graph->nodes) {
index e98e4e3..8d91d39 100644 (file)
@@ -131,7 +131,7 @@ public:
        {
                if(this != &from) {
                        resize(from.size());
-                       memcpy(data_, from.data_, datasize_*sizeof(T));
+                       memcpy((void*)data_, from.data_, datasize_*sizeof(T));
                }
 
                return *this;
@@ -204,7 +204,9 @@ public:
                                        return NULL;
                                }
                                else if(data_ != NULL) {
-                                       memcpy(newdata, data_, ((datasize_ < newsize)? datasize_: newsize)*sizeof(T));
+                                       memcpy((void *)newdata,
+                                              data_,
+                                              ((datasize_ < newsize)? datasize_: newsize)*sizeof(T));
                                        mem_free(data_, capacity_);
                                }
                                data_ = newdata;
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;