1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Remove ABS in favor of Math::abs

This commit is contained in:
kobewi
2022-11-30 17:56:32 +01:00
parent 3d9b05ad4a
commit 10f6c01b9c
68 changed files with 142 additions and 146 deletions

View File

@@ -1716,7 +1716,7 @@ String String::num_int64(int64_t p_num, int base, bool capitalize_hex) {
c[chars] = 0;
n = p_num;
do {
int mod = ABS(n % base);
int mod = Math::abs(n % base);
if (mod >= 10) {
char a = (capitalize_hex ? 'A' : 'a');
c[--chars] = a + (mod - 10);
@@ -5593,7 +5593,7 @@ String String::sprintf(const Array &values, bool *error) const {
// Get basic number.
String str;
if (!as_unsigned) {
str = String::num_int64(ABS(value), base, capitalize);
str = String::num_int64(Math::abs(value), base, capitalize);
} else {
uint64_t uvalue = *((uint64_t *)&value);
// In unsigned hex, if the value fits in 32 bits, trim it down to that.