Warning fixes, general cleanup (#5053)
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled

This commit is contained in:
brainiac
2026-04-04 23:27:21 -07:00
committed by GitHub
parent 435224631f
commit 491b1edd12
107 changed files with 1279 additions and 1542 deletions
+20 -16
View File
@@ -18,10 +18,10 @@
#pragma once
#include "common/emu_opcodes.h"
#include "common/mutex.h"
#include "common/types.h"
#include <map>
#include <mutex>
//enable the use of shared mem opcodes for world and zone only
#ifdef ZONE
@@ -31,7 +31,8 @@
#define SHARED_OPCODES
#endif
class OpcodeManager {
class OpcodeManager
{
public:
OpcodeManager();
virtual ~OpcodeManager() {}
@@ -48,24 +49,27 @@ public:
EmuOpcode NameSearch(const char *name);
//This has to be public for stupid visual studio
class OpcodeSetStrategy {
class OpcodeSetStrategy
{
public:
virtual ~OpcodeSetStrategy() {} //shut up compiler!
virtual ~OpcodeSetStrategy() = default;
virtual void Set(EmuOpcode emu_op, uint16 eq_op) = 0;
};
protected:
bool loaded; //true if all opcodes loaded
Mutex MOpcodes; //this only protects the local machine
std::mutex MOpcodes; //this only protects the local machine
//in a shared manager, this dosent protect others
static bool LoadOpcodesFile(const char *filename, OpcodeSetStrategy *s, bool report_errors);
};
class MutableOpcodeManager : public OpcodeManager {
class MutableOpcodeManager : public OpcodeManager
{
public:
MutableOpcodeManager() : OpcodeManager() {}
virtual bool Mutable() { return(true); }
MutableOpcodeManager() = default;
virtual bool Mutable() override { return true; }
virtual void SetOpcode(EmuOpcode emu_op, uint16 eq_op) = 0;
};
@@ -108,16 +112,16 @@ public:
virtual void SetOpcode(EmuOpcode emu_op, uint16 eq_op);
protected:
class NormalMemStrategy : public OpcodeManager::OpcodeSetStrategy {
class NormalMemStrategy : public OpcodeManager::OpcodeSetStrategy
{
public:
virtual ~NormalMemStrategy() {} //shut up compiler!
RegularOpcodeManager *it;
void Set(EmuOpcode emu_op, uint16 eq_op);
};
friend class NormalMemStrategy;
RegularOpcodeManager* it;
uint16 *emu_to_eq;
EmuOpcode *eq_to_emu;
virtual void Set(EmuOpcode emu_op, uint16 eq_op) override;
};
uint16* emu_to_eq;
EmuOpcode* eq_to_emu;
uint32 EQOpcodeCount;
uint32 EmuOpcodeCount;
};