Skip to content
Snippets Groups Projects
Commit f56b6866 authored by Ezekiel Dohmen's avatar Ezekiel Dohmen
Browse files

Adding static to functions that use static globals

parent 26527208
No related branches found
No related tags found
2 merge requests!439RCG 5.0 release fro deb 10,!310Noise.pm code generation cleanup
......@@ -38,7 +38,7 @@ sub printFrontEndVars {
print ::OUT << "END";
static unsigned long noise_seed = 4101842887655102017LL;\n
static unsigned long noise_u, noise_v, noise_w;
inline unsigned long noise_int64() {
static inline unsigned long noise_int64() {
noise_u = noise_u * 2862933555777941757LL + 7046029254386353087LL;
noise_v ^= noise_v >> 17; noise_v ^= noise_v << 31; noise_v ^= noise_v >> 8;
noise_w = 4294957665U * (noise_w & 0xffffffff) + (noise_w >> 32);
......@@ -46,8 +46,8 @@ inline unsigned long noise_int64() {
noise_x ^= noise_x >> 35; noise_x ^= noise_x <<4;
return (noise_x + noise_v) ^ noise_w;
}
inline double noise_doub() { return 5.42101086242752217E-20 * noise_int64(); }
inline void noise_ran(unsigned long j) {
static inline double noise_doub() { return 5.42101086242752217E-20 * noise_int64(); }
static inline void noise_ran(unsigned long j) {
noise_v = 4101842887655102017LL;
noise_w = 1;
noise_u = j ^ noise_v; noise_int64();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment