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;
case ESM::fourCC("CNTO"):
{
static InventoryItem inv; // FIXME: use unique_ptr here?
InventoryItem inv; // FIXME: use unique_ptr here?
reader.get(inv);
reader.adjustFormId(inv.item);
mInventory.push_back(inv);

@ -56,7 +56,7 @@ void ESM4::Creature::load(ESM4::Reader& reader)
break;
case ESM::fourCC("CNTO"):
{
static InventoryItem inv; // FIXME: use unique_ptr here?
InventoryItem inv; // FIXME: use unique_ptr here?
reader.get(inv);
reader.adjustFormId(inv.item);
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
static ScriptLocalVariableData localVar;
ScriptLocalVariableData localVar;
bool ignore = false;
while (reader.getSubRecordHeader())

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

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

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

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

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

@ -68,7 +68,7 @@ void ESM4::Pathgrid::load(ESM4::Reader& reader)
}
case ESM::fourCC("PGRR"):
{
static PGRR link;
PGRR link;
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"):
{
static PGRL objLink;
PGRL objLink;
reader.getFormId(objLink.object);
// object linkedNode
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"):
{
static PGRR link;
static RDRP linkPt;
PGRR link;
RDRP linkPt;
for (std::size_t i = 0; i < mNodes.size(); ++i)
{

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

Loading…
Cancel
Save