overloaded_min.diff 2.3 KB

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