Merge branch 'rm_esm4_local_static' into 'master'

Remove static modifier from local variables used to store temporary loading results

See merge request OpenMW/openmw!3964
fix-osga-rotate-wildly
Alexei Kotov 9 months ago
commit 25414cd660

@ -53,7 +53,7 @@ void ESM4::Container::load(ESM4::Reader& reader)
break; break;
case ESM::fourCC("CNTO"): case ESM::fourCC("CNTO"):
{ {
static InventoryItem inv; // FIXME: use unique_ptr here? InventoryItem inv; // FIXME: use unique_ptr here?
reader.get(inv); reader.get(inv);
reader.adjustFormId(inv.item); reader.adjustFormId(inv.item);
mInventory.push_back(inv); mInventory.push_back(inv);

@ -56,7 +56,7 @@ void ESM4::Creature::load(ESM4::Reader& reader)
break; break;
case ESM::fourCC("CNTO"): case ESM::fourCC("CNTO"):
{ {
static InventoryItem inv; // FIXME: use unique_ptr here? InventoryItem inv; // FIXME: use unique_ptr here?
reader.get(inv); reader.get(inv);
reader.adjustFormId(inv.item); reader.adjustFormId(inv.item);
mInventory.push_back(inv); mInventory.push_back(inv);

@ -41,7 +41,7 @@ void ESM4::DialogInfo::load(ESM4::Reader& reader)
mEditorId = ESM::RefId(mId).serializeText(); // FIXME: quick workaround to use existing code mEditorId = ESM::RefId(mId).serializeText(); // FIXME: quick workaround to use existing code
static ScriptLocalVariableData localVar; ScriptLocalVariableData localVar;
bool ignore = false; bool ignore = false;
while (reader.getSubRecordHeader()) while (reader.getSubRecordHeader())

@ -58,7 +58,7 @@ void ESM4::LevelledCreature::load(ESM4::Reader& reader)
break; break;
case ESM::fourCC("LVLO"): case ESM::fourCC("LVLO"):
{ {
static LVLO lvlo; LVLO lvlo;
if (subHdr.dataSize != 12) if (subHdr.dataSize != 12)
{ {
if (subHdr.dataSize == 8) if (subHdr.dataSize == 8)

@ -56,7 +56,7 @@ void ESM4::LevelledItem::load(ESM4::Reader& reader)
break; break;
case ESM::fourCC("LVLO"): case ESM::fourCC("LVLO"):
{ {
static LVLO lvlo; LVLO lvlo;
if (subHdr.dataSize != 12) if (subHdr.dataSize != 12)
{ {
if (subHdr.dataSize == 8) if (subHdr.dataSize == 8)

@ -59,7 +59,7 @@ void ESM4::LevelledNpc::load(ESM4::Reader& reader)
break; break;
case ESM::fourCC("LVLO"): case ESM::fourCC("LVLO"):
{ {
static LVLO lvlo; LVLO lvlo;
if (subHdr.dataSize != 12) if (subHdr.dataSize != 12)
{ {
if (subHdr.dataSize == 8) if (subHdr.dataSize == 8)

@ -59,7 +59,7 @@ void ESM4::Npc::load(ESM4::Reader& reader)
break; break;
case ESM::fourCC("CNTO"): case ESM::fourCC("CNTO"):
{ {
static InventoryItem inv; // FIXME: use unique_ptr here? InventoryItem inv; // FIXME: use unique_ptr here?
reader.get(inv); reader.get(inv);
reader.adjustFormId(inv.item); reader.adjustFormId(inv.item);
mInventory.push_back(inv); mInventory.push_back(inv);

@ -103,7 +103,7 @@ void ESM4::AIPackage::load(ESM4::Reader& reader)
break; break;
} }
static CTDA condition; CTDA condition;
reader.get(condition); reader.get(condition);
// FIXME: how to "unadjust" if not FormId? // FIXME: how to "unadjust" if not FormId?
// adjustFormId(condition.param1); // adjustFormId(condition.param1);

@ -68,7 +68,7 @@ void ESM4::Pathgrid::load(ESM4::Reader& reader)
} }
case ESM::fourCC("PGRR"): case ESM::fourCC("PGRR"):
{ {
static PGRR link; PGRR link;
for (std::size_t i = 0; i < std::size_t(mData); ++i) // keep gcc quiet for (std::size_t i = 0; i < std::size_t(mData); ++i) // keep gcc quiet
{ {
@ -105,7 +105,7 @@ void ESM4::Pathgrid::load(ESM4::Reader& reader)
} }
case ESM::fourCC("PGRL"): case ESM::fourCC("PGRL"):
{ {
static PGRL objLink; PGRL objLink;
reader.getFormId(objLink.object); reader.getFormId(objLink.object);
// object linkedNode // object linkedNode
std::size_t numNodes = (subHdr.dataSize - sizeof(int32_t)) / sizeof(int32_t); std::size_t numNodes = (subHdr.dataSize - sizeof(int32_t)) / sizeof(int32_t);

@ -59,8 +59,8 @@ void ESM4::Road::load(ESM4::Reader& reader)
} }
case ESM::fourCC("PGRR"): case ESM::fourCC("PGRR"):
{ {
static PGRR link; PGRR link;
static RDRP linkPt; RDRP linkPt;
for (std::size_t i = 0; i < mNodes.size(); ++i) for (std::size_t i = 0; i < mNodes.size(); ++i)
{ {

@ -36,7 +36,7 @@ void ESM4::Script::load(ESM4::Reader& reader)
mId = reader.getFormIdFromHeader(); mId = reader.getFormIdFromHeader();
mFlags = reader.hdr().record.flags; mFlags = reader.hdr().record.flags;
static ScriptLocalVariableData localVar; ScriptLocalVariableData localVar;
while (reader.getSubRecordHeader()) while (reader.getSubRecordHeader())
{ {

Loading…
Cancel
Save