Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-07-20 13:16:20 +0300
committerJacques Lucke <jacques@blender.org>2020-07-20 13:16:20 +0300
commit8cbbdedaf4dfec9e320e7e2be58b75d256950df1 (patch)
tree496b9620e11ac44e515b0bb4ca52c05834d557f9 /source/blender/nodes/shader
parent686ab4c9401a90b22fb17e46c992eb513fe4f693 (diff)
Refactor: Update integer type usage
This updates the usage of integer types in code I wrote according to our new style guides. Major changes: * Use signed instead of unsigned integers in many places. * C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`). * Hash values for C++ containers are 64 bit wide now (instead of 32 bit). I do hope that I broke no builds, but it is quite likely that some compiler reports slightly different errors. Please let me know when there are any errors. If the fix is small, feel free to commit it yourself. I compiled successfully on linux with gcc and on windows.
Diffstat (limited to 'source/blender/nodes/shader')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_map_range.cc4
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_sepcombRGB.cc2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.cc2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_valToRgb.cc2
4 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_map_range.cc b/source/blender/nodes/shader/nodes/node_shader_map_range.cc
index b026499ec4b..4a6c9ec9a4d 100644
--- a/source/blender/nodes/shader/nodes/node_shader_map_range.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_map_range.cc
@@ -115,13 +115,13 @@ class MapRangeFunction : public blender::fn::MultiFunction {
blender::fn::VSpan<float> to_max = params.readonly_single_input<float>(4, "To Max");
blender::MutableSpan<float> results = params.uninitialized_single_output<float>(5, "Result");
- for (uint i : mask) {
+ for (int64_t i : mask) {
float factor = safe_divide(values[i] - from_min[i], from_max[i] - from_min[i]);
results[i] = to_min[i] + factor * (to_max[i] - to_min[i]);
}
if (clamp_) {
- for (uint i : mask) {
+ for (int64_t i : mask) {
CLAMP(results[i], 0.0f, 1.0f);
}
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.cc b/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.cc
index 4b4b80ea1ad..c1543f791f1 100644
--- a/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.cc
@@ -80,7 +80,7 @@ class SeparateRGBFunction : public blender::fn::MultiFunction {
blender::MutableSpan<float> gs = params.uninitialized_single_output<float>(2, "G");
blender::MutableSpan<float> bs = params.uninitialized_single_output<float>(3, "B");
- for (uint i : mask) {
+ for (int64_t i : mask) {
blender::Color4f color = colors[i];
rs[i] = color.r;
gs[i] = color.g;
diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.cc b/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.cc
index 03e18acc245..8b23327460f 100644
--- a/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.cc
@@ -65,7 +65,7 @@ class MF_SeparateXYZ : public blender::fn::MultiFunction {
blender::MutableSpan<float> ys = params.uninitialized_single_output<float>(2, "Y");
blender::MutableSpan<float> zs = params.uninitialized_single_output<float>(3, "Z");
- for (uint i : mask) {
+ for (int64_t i : mask) {
blender::float3 xyz = vectors[i];
xs[i] = xyz.x;
ys[i] = xyz.y;
diff --git a/source/blender/nodes/shader/nodes/node_shader_valToRgb.cc b/source/blender/nodes/shader/nodes/node_shader_valToRgb.cc
index 21f15bcf6f4..7f712b0db40 100644
--- a/source/blender/nodes/shader/nodes/node_shader_valToRgb.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_valToRgb.cc
@@ -148,7 +148,7 @@ class ColorBandFunction : public blender::fn::MultiFunction {
params.uninitialized_single_output<blender::Color4f>(1, "Color");
blender::MutableSpan<float> alphas = params.uninitialized_single_output<float>(2, "Alpha");
- for (uint i : mask) {
+ for (int64_t i : mask) {
blender::Color4f color;
BKE_colorband_evaluate(&color_band_, values[i], color);
colors[i] = color;