[Bf-blender-cvs] [e5136872881] master: Cycles: Fix a few type casting warnings

Patrick Mours noreply at git.blender.org
Tue Apr 5 18:09:39 CEST 2022


Commit: e51368728815e3700414a77bf91668425a9965ec
Author: Patrick Mours
Date:   Tue Apr 5 17:30:01 2022 +0200
Branches: master
https://developer.blender.org/rBe51368728815e3700414a77bf91668425a9965ec

Cycles: Fix a few type casting warnings

Stumbled over the `integrate_surface_volume_only_bounce` kernel
function not returning the right type. The others too showed up as
warnings when building Cycles as a standalone which didn't have
those warnings disabled.

Differential Revision: https://developer.blender.org/D14558

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

M	intern/cycles/kernel/integrator/shade_surface.h
M	intern/cycles/scene/geometry.cpp
M	intern/cycles/scene/geometry.h
M	intern/cycles/session/merge.cpp

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

diff --git a/intern/cycles/kernel/integrator/shade_surface.h b/intern/cycles/kernel/integrator/shade_surface.h
index a9bf3b5b432..55bb08044ae 100644
--- a/intern/cycles/kernel/integrator/shade_surface.h
+++ b/intern/cycles/kernel/integrator/shade_surface.h
@@ -346,8 +346,8 @@ ccl_device_forceinline int integrate_surface_bsdf_bssrdf_bounce(
 }
 
 #ifdef __VOLUME__
-ccl_device_forceinline bool integrate_surface_volume_only_bounce(IntegratorState state,
-                                                                 ccl_private ShaderData *sd)
+ccl_device_forceinline int integrate_surface_volume_only_bounce(IntegratorState state,
+                                                                ccl_private ShaderData *sd)
 {
   if (!path_state_volume_next(state)) {
     return LABEL_NONE;
diff --git a/intern/cycles/scene/geometry.cpp b/intern/cycles/scene/geometry.cpp
index a2a15416ae6..8152a27046f 100644
--- a/intern/cycles/scene/geometry.cpp
+++ b/intern/cycles/scene/geometry.cpp
@@ -180,7 +180,7 @@ bool Geometry::has_true_displacement() const
 }
 
 void Geometry::compute_bvh(
-    Device *device, DeviceScene *dscene, SceneParams *params, Progress *progress, int n, int total)
+    Device *device, DeviceScene *dscene, SceneParams *params, Progress *progress, size_t n, size_t total)
 {
   if (progress->get_cancel())
     return;
diff --git a/intern/cycles/scene/geometry.h b/intern/cycles/scene/geometry.h
index bbb50d5cbfe..0c2e70d483d 100644
--- a/intern/cycles/scene/geometry.h
+++ b/intern/cycles/scene/geometry.h
@@ -110,8 +110,8 @@ class Geometry : public Node {
                    DeviceScene *dscene,
                    SceneParams *params,
                    Progress *progress,
-                   int n,
-                   int total);
+                   size_t n,
+                   size_t total);
 
   virtual PrimitiveType primitive_type() const = 0;
 
diff --git a/intern/cycles/session/merge.cpp b/intern/cycles/session/merge.cpp
index a88ffee6409..316f56630d6 100644
--- a/intern/cycles/session/merge.cpp
+++ b/intern/cycles/session/merge.cpp
@@ -531,7 +531,7 @@ static void read_layer_samples(vector<MergeImage> &images,
         current_layer_samples.total = 0;
         current_layer_samples.per_pixel.resize(in_spec.width * in_spec.height);
         std::fill(
-            current_layer_samples.per_pixel.begin(), current_layer_samples.per_pixel.end(), 0);
+            current_layer_samples.per_pixel.begin(), current_layer_samples.per_pixel.end(), 0.0f);
       }
 
       if (layer.has_sample_pass) {



More information about the Bf-blender-cvs mailing list