Remove AUTO_VAR macro and _toString function (#592)

This commit is contained in:
void_17
2026-03-06 02:11:18 +07:00
committed by GitHub
parent 7d6658fe5b
commit 55231bb8d3
294 changed files with 5067 additions and 5773 deletions

View File

@@ -89,11 +89,8 @@ vector<CompoundTag *> *NbtSlotFile::readAll(int slot)
vector<int> *fileSlots = fileSlotMap[slot];
int skipped = 0;
AUTO_VAR(itEnd, fileSlots->end());
for (AUTO_VAR(it, fileSlots->begin()); it != itEnd; it++)
for (int c : *fileSlots)
{
int c = *it; //fileSlots->at(i);
int pos = 0;
int continuesAt = -1;
int expectedSlot = slot + 1;
@@ -115,8 +112,6 @@ vector<CompoundTag *> *NbtSlotFile::readAll(int slot)
goto fileSlotLoop; // 4J - used to be continue fileSlotLoop, with for loop labelled as fileSlotLoop
}
// if (oldSlot != expectedSlot) throw new IOException("Wrong slot! Got " + oldSlot + ", expected " + expectedSlot); // 4J - TODO
ReadFile(raf,READ_BUFFER.data + pos,size,&numberOfBytesRead,NULL);
if (continuesAt >= 0)
@@ -144,12 +139,12 @@ int NbtSlotFile::getFreeSlot()
// fileSlot = toReplace->back();
// toReplace->pop_back();
// } else
if (freeFileSlots.size() > 0)
{
fileSlot = freeFileSlots.back();
freeFileSlots.pop_back();
}
}
else
{
fileSlot = totalFileSlots++;
@@ -164,11 +159,9 @@ void NbtSlotFile::replaceSlot(int slot, vector<CompoundTag *> *tags)
DWORD numberOfBytesWritten;
toReplace = fileSlotMap[slot];
fileSlotMap[slot] = new vector<int>();
AUTO_VAR(itEndTags, tags->end());
for (AUTO_VAR(it, tags->begin()); it != itEndTags; it++)
for (auto tag : *tags)
{
CompoundTag *tag = *it; //tags->at(i);
byteArray compressed = NbtIo::compress(tag);
if (compressed.length > largest)
{
@@ -227,12 +220,9 @@ void NbtSlotFile::replaceSlot(int slot, vector<CompoundTag *> *tags)
}
delete[] compressed.data;
}
AUTO_VAR(itEndToRep, toReplace->end());
for (AUTO_VAR(it, toReplace->begin()); it != itEndToRep; it++)
{
int c = *it; //toReplace->at(i);
for (int c : *toReplace)
{
freeFileSlots.push_back(c);
seekSlotHeader(c);