Get rid of MSVC's __int64
Use either int64_t, uint64_t or long long and unsigned long long, defined as per C++11 standard
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
// 4J Stu - There are changes to this class for 1.8.2, but since we never use it anyway lets not worry about it
|
||||
|
||||
const int ZonedChunkStorage::BIT_TERRAIN_POPULATED = 0x0000001;
|
||||
|
||||
|
||||
const int ZonedChunkStorage::CHUNKS_PER_ZONE_BITS = 5; // = 32
|
||||
const int ZonedChunkStorage::CHUNKS_PER_ZONE = 1 << ZonedChunkStorage::CHUNKS_PER_ZONE_BITS; // ^2
|
||||
|
||||
@@ -50,7 +50,7 @@ ZoneFile *ZonedChunkStorage::getZoneFile(int x, int z, bool create)
|
||||
|
||||
int xZone = x >> CHUNKS_PER_ZONE_BITS;
|
||||
int zZone = z >> CHUNKS_PER_ZONE_BITS;
|
||||
__int64 key = xZone + (zZone << 20l);
|
||||
int64_t key = xZone + (zZone << 20l);
|
||||
// 4J - was !zoneFiles.containsKey(key)
|
||||
if (zoneFiles.find(key) == zoneFiles.end())
|
||||
{
|
||||
@@ -107,8 +107,8 @@ LevelChunk *ZonedChunkStorage::load(Level *level, int x, int z)
|
||||
header->flip();
|
||||
int xOrg = header->getInt();
|
||||
int zOrg = header->getInt();
|
||||
__int64 time = header->getLong();
|
||||
__int64 flags = header->getLong();
|
||||
int64_t time = header->getLong();
|
||||
int64_t flags = header->getLong();
|
||||
|
||||
lc->terrainPopulated = (flags & BIT_TERRAIN_POPULATED) != 0;
|
||||
|
||||
@@ -121,7 +121,7 @@ LevelChunk *ZonedChunkStorage::load(Level *level, int x, int z)
|
||||
|
||||
void ZonedChunkStorage::save(Level *level, LevelChunk *lc)
|
||||
{
|
||||
__int64 flags = 0;
|
||||
int64_t flags = 0;
|
||||
if (lc->terrainPopulated) flags |= BIT_TERRAIN_POPULATED;
|
||||
|
||||
ByteBuffer *header = ByteBuffer::allocate(CHUNK_HEADER_SIZE);
|
||||
@@ -147,10 +147,10 @@ void ZonedChunkStorage::tick()
|
||||
tickCount++;
|
||||
if (tickCount % (20 * 10) == 4)
|
||||
{
|
||||
vector<__int64> toClose;
|
||||
vector<int64_t> toClose;
|
||||
|
||||
AUTO_VAR(itEndZF, zoneFiles.end());
|
||||
for( unordered_map<__int64, ZoneFile *>::iterator it = zoneFiles.begin(); it != itEndZF; it++ )
|
||||
for( unordered_map<int64_t, ZoneFile *>::iterator it = zoneFiles.begin(); it != itEndZF; it++ )
|
||||
{
|
||||
ZoneFile *zoneFile = it->second;
|
||||
if (tickCount - zoneFile->lastUse > 20 * 60)
|
||||
@@ -158,11 +158,11 @@ void ZonedChunkStorage::tick()
|
||||
toClose.push_back(zoneFile->key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AUTO_VAR(itEndTC, toClose.end());
|
||||
for (AUTO_VAR(it, toClose.begin()); it != itEndTC; it++)
|
||||
{
|
||||
__int64 key = *it ; //toClose[i];
|
||||
int64_t key = *it ; //toClose[i];
|
||||
// 4J - removed try/catch
|
||||
// try {
|
||||
char buf[256];
|
||||
@@ -181,7 +181,7 @@ void ZonedChunkStorage::tick()
|
||||
void ZonedChunkStorage::flush()
|
||||
{
|
||||
AUTO_VAR(itEnd, zoneFiles.end());
|
||||
for( unordered_map<__int64, ZoneFile *>::iterator it = zoneFiles.begin(); it != itEnd; it++ )
|
||||
for( unordered_map<int64_t, ZoneFile *>::iterator it = zoneFiles.begin(); it != itEnd; it++ )
|
||||
{
|
||||
ZoneFile *zoneFile = it->second;
|
||||
// 4J - removed try/catch
|
||||
|
||||
Reference in New Issue
Block a user