Merge branch 'master' into blender2.8

This commit is contained in:
2018-06-11 14:44:03 +02:00
11 changed files with 19 additions and 14 deletions

View 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;

View 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. */

View 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;
}

View 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;

View 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 */

View 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();

View 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()

View 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();

View 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) {

View 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;

View 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;