1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Replace usage of long long with u64/s64

This commit is contained in:
ShadowNinja 2014-03-12 19:37:19 -04:00
parent 7cac34c807
commit 18577f2527
7 changed files with 16 additions and 13 deletions

View file

@ -36,13 +36,13 @@ static s64 pythonmodulo(s64 i, s64 mod)
return mod - ((-i) % mod);
}
long long Database::getBlockAsInteger(const v3s16 pos) {
return (unsigned long long)pos.Z*16777216 +
(unsigned long long)pos.Y*4096 +
(unsigned long long)pos.X;
s64 Database::getBlockAsInteger(const v3s16 pos) {
return (u64) pos.Z * 16777216 +
(u64) pos.Y * 4096 +
(u64) pos.X;
}
v3s16 Database::getIntegerAsBlock(long long i) {
v3s16 Database::getIntegerAsBlock(s64 i) {
s32 x = unsignedToSigned(pythonmodulo(i, 4096), 2048);
i = (i - x) / 4096;
s32 y = unsignedToSigned(pythonmodulo(i, 4096), 2048);