[Bf-blender-cvs] [7e8626b] master: Code cleanup: warnings
Campbell Barton
noreply at git.blender.org
Sat Jul 19 16:40:25 CEST 2014
Commit: 7e8626bbcec21c682dc9159fe0307d157c56ede4
Author: Campbell Barton
Date: Sun Jul 20 00:38:52 2014 +1000
https://developer.blender.org/rB7e8626bbcec21c682dc9159fe0307d157c56ede4
Code cleanup: warnings
===================================================================
M intern/itasc/Armature.cpp
M source/blender/blenlib/intern/rand.c
===================================================================
diff --git a/intern/itasc/Armature.cpp b/intern/itasc/Armature.cpp
index 0c73656..13b471b 100644
--- a/intern/itasc/Armature.cpp
+++ b/intern/itasc/Armature.cpp
@@ -15,8 +15,10 @@
namespace iTaSC {
+#if 0
// a joint constraint is characterized by 5 values: tolerance, K, alpha, yd, yddot
static const unsigned int constraintCacheSize = 5;
+#endif
std::string Armature::m_root = "root";
Armature::Armature():
diff --git a/source/blender/blenlib/intern/rand.c b/source/blender/blenlib/intern/rand.c
index 410f988..3dff0b3 100644
--- a/source/blender/blenlib/intern/rand.c
+++ b/source/blender/blenlib/intern/rand.c
@@ -95,15 +95,20 @@ void BLI_rng_srandom(RNG *rng, unsigned int seed)
BLI_rng_seed(rng, seed + hash[seed & 255]);
}
-int BLI_rng_get_int(RNG *rng)
+BLI_INLINE void rng_step(RNG *rng)
{
rng->X = (MULTIPLIER * rng->X + ADDEND) & MASK;
+}
+
+int BLI_rng_get_int(RNG *rng)
+{
+ rng_step(rng);
return (int) (rng->X >> 17);
}
unsigned int BLI_rng_get_uint(RNG *rng)
{
- rng->X = (MULTIPLIER * rng->X + ADDEND) & MASK;
+ rng_step(rng);
return (unsigned int) (rng->X >> 17);
}
@@ -167,10 +172,9 @@ void BLI_rng_shuffle_array(RNG *rng, void *data, unsigned int elem_size_i, unsig
void BLI_rng_skip(RNG *rng, int n)
{
- int i;
-
- for (i = 0; i < n; i++)
- BLI_rng_get_int(rng);
+ while (n--) {
+ rng_step(rng);
+ }
}
/***/
More information about the Bf-blender-cvs
mailing list