summaryrefslogtreecommitdiffstats
path: root/graphics/Blender/overloaded_min.diff
blob: 5612d01599c16967a3b127514d3464fd47d189b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
diff -Naur blender-3.0.1/intern/cycles/scene/hair.cpp blender-3.0.1.patched/intern/cycles/scene/hair.cpp
--- blender-3.0.1/intern/cycles/scene/hair.cpp	2021-10-27 15:21:51.000000000 -0400
+++ blender-3.0.1.patched/intern/cycles/scene/hair.cpp	2022-03-22 14:54:15.181140060 -0400
@@ -119,7 +119,7 @@
 {
   /* Figure out which steps we need to fetch and their interpolation factor. */
   const size_t max_step = num_steps - 1;
-  const size_t step = min((int)(time * max_step), max_step - 1);
+  const size_t step = min((int)(time * max_step), (int)(max_step - 1));
   const float t = time * max_step - step;
   /* Fetch vertex coordinates. */
   float4 curr_keys[2];
@@ -147,7 +147,7 @@
 {
   /* Figure out which steps we need to fetch and their interpolation factor. */
   const size_t max_step = num_steps - 1;
-  const size_t step = min((int)(time * max_step), max_step - 1);
+  const size_t step = min((int)(time * max_step), (int)(max_step - 1));
   const float t = time * max_step - step;
   /* Fetch vertex coordinates. */
   float4 curr_keys[4];
@@ -192,7 +192,7 @@
                                 float4 r_keys[2]) const
 {
   k0 = max(k0, 0);
-  k1 = min(k1, num_keys - 1);
+  k1 = min((int)k1, (int)(num_keys - 1));
   const size_t center_step = ((num_steps - 1) / 2);
   if (step == center_step) {
     /* Center step: regular key location. */
@@ -238,7 +238,7 @@
                                          float4 r_keys[4]) const
 {
   k0 = max(k0, 0);
-  k3 = min(k3, num_keys - 1);
+  k3 = min((int)k3, (int)(num_keys - 1));
   const size_t center_step = ((num_steps - 1) / 2);
   if (step == center_step) {
     /* Center step: regular key location. */
diff -Naur blender-3.0.1/intern/cycles/scene/mesh.cpp blender-3.0.1.patched/intern/cycles/scene/mesh.cpp
--- blender-3.0.1/intern/cycles/scene/mesh.cpp	2021-10-27 15:21:51.000000000 -0400
+++ blender-3.0.1.patched/intern/cycles/scene/mesh.cpp	2022-03-22 15:35:52.169528851 -0400
@@ -53,7 +53,7 @@
 {
   /* Figure out which steps we need to fetch and their interpolation factor. */
   const size_t max_step = num_steps - 1;
-  const size_t step = min((int)(time * max_step), max_step - 1);
+  const size_t step = min((int)(time * max_step), (int)(max_step - 1));
   const float t = time * max_step - step;
   /* Fetch vertex coordinates. */
   float3 curr_verts[3];