Remove all MSVC __int64

This commit is contained in:
void_17
2026-03-07 02:52:52 +07:00
parent fc7ddbab14
commit c67db1115a
277 changed files with 3672 additions and 3684 deletions

View File

@@ -40,7 +40,7 @@ SparseLightStorage::SparseLightStorage(bool sky)
// Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case
#pragma warning ( disable : 4826 )
dataAndCount = 0x007F000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL);
dataAndCount = 0x007F000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL);
#pragma warning ( default : 4826 )
#ifdef LIGHT_COMPRESSION_STATS
count = 127;
@@ -59,7 +59,7 @@ SparseLightStorage::SparseLightStorage(bool sky, bool isUpper)
// Data and count packs together the pointer to our data and the count of planes allocated - 0 planes allocated in this case
#pragma warning ( disable : 4826 )
dataAndCount = 0x0000000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL);
dataAndCount = 0x0000000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL);
#pragma warning ( default : 4826 )
#ifdef LIGHT_COMPRESSION_STATS
count = 0;
@@ -70,7 +70,7 @@ SparseLightStorage::~SparseLightStorage()
{
unsigned char *indicesAndData = (unsigned char *)(dataAndCount & 0x0000ffffffffffff);
// Determine correct means to free this data - could have been allocated either with XPhysicalAlloc or malloc
#ifdef _XBOX
if( (unsigned int)indicesAndData >= MM_PHYSICAL_4KB_BASE )
{
@@ -87,7 +87,7 @@ SparseLightStorage::~SparseLightStorage()
SparseLightStorage::SparseLightStorage(SparseLightStorage *copyFrom)
{
// Extra details of source storage
__int64 sourceDataAndCount = copyFrom->dataAndCount;
int64_t sourceDataAndCount = copyFrom->dataAndCount;
unsigned char *sourceIndicesAndData = (unsigned char *)(sourceDataAndCount & 0x0000ffffffffffff);
int sourceCount = (sourceDataAndCount >> 48 ) & 0xffff;
@@ -97,7 +97,7 @@ SparseLightStorage::SparseLightStorage(SparseLightStorage *copyFrom)
// AP - I've moved this to be before the memcpy because of a very strange bug on vita. Sometimes dataAndCount wasn't valid in time when ::get was called.
// This should never happen and this isn't a proper solution but fixes it for now.
#pragma warning ( disable : 4826 )
dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((__int64) destIndicesAndData ) & 0x0000ffffffffffffL );
dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((int64_t) destIndicesAndData ) & 0x0000ffffffffffffL );
#pragma warning ( default : 4826 )
XMemCpy( destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128 );
@@ -125,7 +125,7 @@ void SparseLightStorage::setData(byteArray dataIn, unsigned int inOffset)
{
bool all0 = true;
bool all15 = true;
for( int xz = 0; xz < 256; xz++ ) // 256 in loop as 16 x 16 separate bytes need checked
{
int pos = ( xz << 7 ) | y;
@@ -180,9 +180,9 @@ void SparseLightStorage::setData(byteArray dataIn, unsigned int inOffset)
// Get new data and count packed info
#pragma warning ( disable : 4826 )
__int64 newDataAndCount = ((__int64) planeIndices) & 0x0000ffffffffffffL;
int64_t newDataAndCount = ((int64_t) planeIndices) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
newDataAndCount |= ((__int64)allocatedPlaneCount) << 48;
newDataAndCount |= ((int64_t)allocatedPlaneCount) << 48;
updateDataAndCount( newDataAndCount );
}
@@ -245,7 +245,7 @@ int SparseLightStorage::get(int x, int y, int z)
{
unsigned char *planeIndices, *data;
getPlaneIndicesAndData(&planeIndices, &data);
if( planeIndices[y] == ALL_0_INDEX )
{
return 0;
@@ -312,7 +312,7 @@ void SparseLightStorage::setAllBright()
}
// Data and count packs together the pointer to our data and the count of planes allocated, which is currently zero
#pragma warning ( disable : 4826 )
__int64 newDataAndCount = ( (__int64) planeIndices ) & 0x0000ffffffffffffL;
int64_t newDataAndCount = ( (int64_t) planeIndices ) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
updateDataAndCount( newDataAndCount );
@@ -375,7 +375,7 @@ int SparseLightStorage::getDataRegion(byteArray dataInOut, int x0, int y0, int z
}
}
ptrdiff_t count = pucOut - &dataInOut.data[offset];
return (int)count;
}
@@ -385,7 +385,7 @@ void SparseLightStorage::addNewPlane(int y)
do
{
// Get last packed data pointer & count
__int64 lastDataAndCount = dataAndCount;
int64_t lastDataAndCount = dataAndCount;
// Unpack count & data pointer
int lastLinesUsed = (int)(( lastDataAndCount >> 48 ) & 0xffff);
@@ -407,14 +407,14 @@ void SparseLightStorage::addNewPlane(int y)
// Get new data and count packed info
#pragma warning ( disable : 4826 )
__int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL;
int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
newDataAndCount |= ((__int64)linesUsed) << 48;
newDataAndCount |= ((int64_t)linesUsed) << 48;
// Attempt to update the data & count atomically. This command will Only succeed if the data stored at
// dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place
__int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
if( lastDataAndCount2 == lastDataAndCount )
{
success = true;
@@ -479,20 +479,20 @@ void SparseLightStorage::tick()
}
// Update storage with a new values for dataAndCount, repeating as necessary if other simultaneous writes happen.
void SparseLightStorage::updateDataAndCount(__int64 newDataAndCount)
void SparseLightStorage::updateDataAndCount(int64_t newDataAndCount)
{
// Now actually assign this data to the storage. Just repeat until successful, there isn't any useful really that we can merge the results of this
// with any other simultaneous writes that might be happening.
bool success = false;
do
{
__int64 lastDataAndCount = dataAndCount;
int64_t lastDataAndCount = dataAndCount;
unsigned char *lastDataPointer = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff);
// Attempt to update the data & count atomically. This command will Only succeed if the data stored at
// dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place
__int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
if( lastDataAndCount2 == lastDataAndCount )
{
success = true;
@@ -514,7 +514,7 @@ int SparseLightStorage::compress()
unsigned char _planeIndices[128];
bool needsCompressed = false;
__int64 lastDataAndCount = dataAndCount;
int64_t lastDataAndCount = dataAndCount;
unsigned char *planeIndices = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff);
unsigned char *data = planeIndices + 128;
@@ -575,13 +575,13 @@ int SparseLightStorage::compress()
// Get new data and count packed info
#pragma warning ( disable : 4826 )
__int64 newDataAndCount = ((__int64) newIndicesAndData) & 0x0000ffffffffffffL;
int64_t newDataAndCount = ((int64_t) newIndicesAndData) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
newDataAndCount |= ((__int64)planesToAlloc) << 48;
newDataAndCount |= ((int64_t)planesToAlloc) << 48;
// Attempt to update the data & count atomically. This command will Only succeed if the data stored at
// dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place
__int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
if( lastDataAndCount2 != lastDataAndCount )
{
@@ -593,7 +593,7 @@ int SparseLightStorage::compress()
{
// Success
queueForDelete( planeIndices );
// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices);
// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices);
#ifdef LIGHT_COMPRESSION_STATS
count = planesToAlloc;
#endif
@@ -634,9 +634,9 @@ void SparseLightStorage::read(DataInputStream *dis)
dis->readFully(wrapper);
#pragma warning ( disable : 4826 )
__int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL;
int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
newDataAndCount |= ((__int64)count) << 48;
newDataAndCount |= ((int64_t)count) << 48;
updateDataAndCount( newDataAndCount );
}