summaryrefslogtreecommitdiffstats
path: root/core/math
diff options
context:
space:
mode:
Diffstat (limited to 'core/math')
-rw-r--r--core/math/math_funcs.h4
-rw-r--r--core/math/random_pcg.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h
index 8cf13efdb6..c0d7649b65 100644
--- a/core/math/math_funcs.h
+++ b/core/math/math_funcs.h
@@ -218,8 +218,8 @@ public:
return value;
}
- static _ALWAYS_INLINE_ int posmod(int p_x, int p_y) {
- int value = p_x % p_y;
+ static _ALWAYS_INLINE_ int64_t posmod(int64_t p_x, int64_t p_y) {
+ int64_t value = p_x % p_y;
if ((value < 0 && p_y > 0) || (value > 0 && p_y < 0)) {
value += p_y;
}
diff --git a/core/math/random_pcg.cpp b/core/math/random_pcg.cpp
index 1152c4e834..681c2a9717 100644
--- a/core/math/random_pcg.cpp
+++ b/core/math/random_pcg.cpp
@@ -39,7 +39,7 @@ RandomPCG::RandomPCG(uint64_t p_seed, uint64_t p_inc) :
}
void RandomPCG::randomize() {
- seed((OS::get_singleton()->get_unix_time() + OS::get_singleton()->get_ticks_usec()) * pcg.state + PCG_DEFAULT_INC_64);
+ seed(((uint64_t)OS::get_singleton()->get_unix_time() + OS::get_singleton()->get_ticks_usec()) * pcg.state + PCG_DEFAULT_INC_64);
}
double RandomPCG::random(double p_from, double p_to) {