purged -Wdelete-non-abstract-non-virtual-dtor

This commit is contained in:
Nikita Edel 2026-03-10 02:13:56 +01:00
parent c74bb31102
commit 021c2809f4
41 changed files with 70 additions and 39 deletions

View file

@ -3,6 +3,7 @@
class ConsoleInputSource
{
public:
virtual ~ConsoleInputSource(){}
virtual void info(const std::wstring& string) = 0;
virtual void warn(const std::wstring& string) = 0;
virtual std::wstring getConsoleName() = 0;

View file

@ -12,6 +12,7 @@ public:
bool sneaking;
Input(); // 4J - added
virtual ~Input(){}
virtual void tick(LocalPlayer *player);
@ -19,4 +20,4 @@ private:
bool lReset;
bool rReset;
};
};

View file

@ -27,6 +27,7 @@ protected:
public:
GameRuleDefinition();
virtual ~GameRuleDefinition(){}
virtual ConsoleGameRules::EGameRuleType getActionType() = 0;

View file

@ -22,6 +22,7 @@ public:
// was being mixed in with all the game information as they have
// completely different lifespans.
virtual ~GrSource(){}
virtual bool requiresTexturePack()=0;
virtual UINT getRequiredTexturePackId()=0;
virtual std::wstring getDefaultSaveName()=0;

View file

@ -14,7 +14,8 @@ private:
public:
LookAtEntityHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, int titleId, eINSTANCEOF type);
~LookAtEntityHint();
//TODO: LEAK LEKAFDSAKFDJ;SALKDJF;ASLKFJ ITS NEVER IMPLEMENTED
~LookAtEntityHint(){};
virtual bool onLookAtEntity(eINSTANCEOF type);
};
};

View file

@ -10,6 +10,7 @@ LookAtTileHint::LookAtTileHint(eTutorial_Hint id, Tutorial *tutorial, int tiles[
{
m_iTilesCount = tilesLength;
//TODO LEAK LEAK LEAK LEAKS EVERY WHERE AAAAAAAAAAAAAAAAH
m_iTiles= new int [m_iTilesCount];
for(unsigned int i=0;i<m_iTilesCount;i++)
{
@ -65,4 +66,4 @@ bool LookAtTileHint::onLookAt(int id,int iData)
}
}
return false;
}
}

View file

@ -16,7 +16,8 @@ private:
public:
LookAtTileHint(eTutorial_Hint id, Tutorial *tutorial, int tiles[], unsigned int tilesLength, int iconOverride = -1, int iData=-1, int iDataOverride = -1);
~LookAtTileHint();
//TODO
~LookAtTileHint(){};
virtual bool onLookAt(int id, int iData=0);
};

View file

@ -13,7 +13,8 @@ private:
public:
TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], unsigned int itemsLength);
~TakeItemHint();
//TODO: LEAK LEAK LEAK DESTRUCTOR WAS NEVER IMPLEMENTED
virtual ~TakeItemHint(){};
virtual bool onTake( std::shared_ptr<ItemInstance> item );
};

View file

@ -123,7 +123,7 @@ public:
bool m_isFullTutorial;
public:
Tutorial(int iPad, bool isFullTutorial = false);
~Tutorial();
virtual ~Tutorial();
void tick();
int getPad() { return m_iPad; }

View file

@ -37,6 +37,7 @@ protected:
public:
TutorialHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, eHintType type, bool allowFade = true);
virtual ~TutorialHint(){}
eTutorial_Hint getId() { return m_id; }

View file

@ -23,6 +23,7 @@ protected:
public:
MultiPlayerGameMode(Minecraft *minecraft, ClientConnection *connection);
virtual ~MultiPlayerGameMode(){}
static void creativeDestroyBlock(Minecraft *minecraft, MultiPlayerGameMode *gameMode, int x, int y, int z, int face);
void adjustPlayer(std::shared_ptr<Player> player);
bool isCutScene();
@ -64,4 +65,4 @@ public:
virtual bool isInputAllowed(int mapping) { return true; }
virtual bool isTutorial() { return false; }
virtual Tutorial *getTutorial() { return NULL; }
};
};

View file

@ -19,6 +19,7 @@ public:
int texHeight;
Model(); // 4J added
virtual ~Model(){}
virtual void render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) {}
virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0) {}
virtual void prepareMobModel(std::shared_ptr<Mob> mob, float time, float r, float a) {}

View file

@ -4,5 +4,6 @@ class BufferedImage;
class MemTextureProcessor
{
public:
virtual ~MemTextureProcessor(){}
virtual BufferedImage *process(BufferedImage *read) = 0;
};
};

View file

@ -23,7 +23,7 @@ public:
using AbstractTexturePack::getResource;
DLCTexturePack(DWORD id, DLCPack *pack, TexturePack *fallback);
~DLCTexturePack();
~DLCTexturePack(){};
virtual std::wstring getResource(const std::wstring& name);
virtual DLCPack * getDLCPack();

View file

@ -12,6 +12,7 @@ class TexturePack
public:
TexturePack() { m_bHasAudio=false;}
virtual ~TexturePack(){}
virtual bool hasData() = 0;
virtual bool hasAudio() { return m_bHasAudio;}
virtual void setHasAudio(bool bVal) {m_bHasAudio=bVal;}

View file

@ -12,7 +12,9 @@ private:
public:
JumpControl(Mob *mob);
virtual ~JumpControl(){}
void jump();
//genuinly, why tf is this VIRTUAL
virtual void tick();
};
};

View file

@ -15,6 +15,7 @@ private:
public:
LookControl(Mob *mob);
virtual ~LookControl(){}
void setLookAt(std::shared_ptr<Entity> target, float yMax, float xMax);
void setLookAt(double x, double y, double z, float yMax, float xMax);
@ -30,4 +31,4 @@ public:
double getWantedX();
double getWantedY();
double getWantedZ();
};
};

View file

@ -22,6 +22,7 @@ private:
public:
MoveControl(Mob *mob);
virtual ~MoveControl(){}
bool hasWanted();
float getSpeed();
@ -31,4 +32,4 @@ public:
private:
float rotlerp(float a, float b, float max);
};
};

View file

@ -7,6 +7,7 @@ class Player;
class Container
{
public:
virtual ~Container(){}
static const int LARGE_MAX_STACK_SIZE = 64;
virtual unsigned int getContainerSize() = 0;
@ -20,4 +21,4 @@ public:
virtual bool stillValid(std::shared_ptr<Player> player) = 0;
virtual void startOpen() = 0;
virtual void stopOpen() = 0;
};
};

View file

@ -13,7 +13,7 @@ private:
public:
CraftingContainer(AbstractContainerMenu *menu, unsigned int w, unsigned int h);
~CraftingContainer();
virtual ~CraftingContainer();
virtual unsigned int getContainerSize();
virtual std::shared_ptr<ItemInstance> getItem(unsigned int slot);
@ -29,4 +29,4 @@ public:
void startOpen() { } // TODO Auto-generated method stub
void stopOpen() { } // TODO Auto-generated method stub
};
};

View file

@ -7,6 +7,7 @@ class Player;
class Merchant
{
public:
virtual ~Merchant(){}
virtual void setTradingPlayer(std::shared_ptr<Player> player) = 0;
virtual std::shared_ptr<Player> getTradingPlayer() = 0;
virtual MerchantRecipeList *getOffers(std::shared_ptr<Player> forPlayer) = 0;
@ -14,4 +15,4 @@ public:
virtual void notifyTrade(MerchantRecipe *activeRecipe) = 0;
virtual void notifyTradeUpdated(std::shared_ptr<ItemInstance> item) = 0;
virtual int getDisplayName() = 0;
};
};

View file

@ -10,6 +10,7 @@ private:
public:
// 4J Stu Added a ctor to init items
ResultContainer();
virtual ~ResultContainer(){}
virtual unsigned int getContainerSize();
virtual std::shared_ptr<ItemInstance> getItem(unsigned int slot);
@ -23,4 +24,4 @@ public:
void startOpen() { } // TODO Auto-generated method stub
void stopOpen() { } // TODO Auto-generated method stub
};
};

View file

@ -63,7 +63,7 @@ private:
ItemInstance() { _init(-1,0,0); }
public:
~ItemInstance();
virtual ~ItemInstance();
std::shared_ptr<ItemInstance> remove(int count);
Item *getItem() const;
@ -151,4 +151,4 @@ public:
int getBaseRepairCost();
void setRepairCost(int cost);
};
};

View file

@ -28,7 +28,7 @@ protected:
public:
Dimension();
~Dimension();
virtual ~Dimension();
virtual ChunkSource *createRandomLevelSource() const;
virtual ChunkSource *createFlatLevelSource() const;
virtual ChunkStorage *createStorage(File dir);

View file

@ -152,7 +152,7 @@ public:
LevelChunk(Level *level, int x, int z);
LevelChunk(Level *level, byteArray blocks, int x, int z);
LevelChunk(Level *level, int x, int z, LevelChunk *lc);
~LevelChunk();
virtual ~LevelChunk();
virtual bool isAt(int x, int z);

View file

@ -71,6 +71,7 @@ protected:
virtual void setTagData(CompoundTag *tag); // 4J - removed CompoundTag *playerTag
public:
virtual ~LevelData(){}
virtual __int64 getSeed();
virtual int getXSpawn();
virtual int getYSpawn();

View file

@ -18,6 +18,7 @@ public:
static const std::wstring NETHER_FOLDER;
static const std::wstring ENDER_FOLDER;
virtual ~LevelStorage(){}
virtual LevelData *prepareLevel() = 0;
virtual void checkSession() = 0;
virtual ChunkStorage *createChunkStorage(Dimension *dimension) = 0;

View file

@ -19,4 +19,4 @@ public:
virtual void saveMapIdLookup() = 0;
virtual void deleteMapFilesForPlayer(std::shared_ptr<Player> player) = 0;
virtual void saveAllCachedData() = 0;
};
};

View file

@ -15,6 +15,7 @@ private:
public:
SavedData(const std::wstring& id);
virtual ~SavedData(){}
virtual void load(CompoundTag *tag) = 0;
virtual void save(CompoundTag *tag) = 0;
@ -22,4 +23,4 @@ public:
void setDirty();
void setDirty(bool dirty);
bool isDirty();
};
};

View file

@ -32,7 +32,7 @@ public:
const int id;
public:
PacketStatistics(int id) : id( id ), count( 0 ), totalSize( 0 ), samplesPos( 0 ), firstSampleTime( 0 ) { countSamples[0] = 0; sizeSamples[0] = 0; }
PacketStatistics(int id) : count( 0 ), totalSize( 0 ), samplesPos( 0 ), firstSampleTime( 0 ), id( id ) { countSamples[0] = 0; sizeSamples[0] = 0; }
void addPacket(int bytes);
int getCount();
double getAverageSize();
@ -61,6 +61,7 @@ public:
const __int64 createTime;
Packet();
virtual ~Packet(){}
static std::shared_ptr<Packet> getPacket(int id);
@ -110,4 +111,4 @@ public:
protected:
static void writeNbt(CompoundTag *tag, DataOutputStream *dos);
};
};

View file

@ -106,6 +106,7 @@ class GameCommandPacket;
class PacketListener
{
public:
virtual ~PacketListener(){}
virtual bool isServerPacketListener() = 0;
virtual void handleBlockRegionUpdate(std::shared_ptr<BlockRegionUpdatePacket> packet);
virtual void onUnhandledPacket(std::shared_ptr<Packet> packet);

View file

@ -24,6 +24,8 @@ protected:
public:
BiomeDecorator(Biome *biome);
virtual ~BiomeDecorator(){}
void decorate(Level *level, Random *random, int xo, int zo);
@ -72,4 +74,4 @@ protected:
void decorateDepthSpan(int count, Feature *feature, int y0, int y1);
void decorateDepthAverage(int count, Feature *feature, int yMid, int ySpan);
void decorateOres();
};
};

View file

@ -40,7 +40,7 @@ public:
#else
static __int64 findSeed(LevelType *generator); // 4J added
#endif
~BiomeSource();
virtual ~BiomeSource();
public:
std::vector<Biome *> getPlayerSpawnBiomes() { return playerSpawnBiomes; }

View file

@ -7,9 +7,9 @@
bool HouseFeature::place(Level *level, Random *random, int x, int y, int z)
{
while (y > 0 && !level->getMaterial(x, y - 1, z)->blocksMotion())
while (y > 0 && !level->getMaterial(x, y - 1, z)->blocksMotion()) {
y--;
}
int w = random->nextInt(7) + 7;
int h = 4 + random->nextInt(3) / 2;
int d = random->nextInt(7) + 7;
@ -190,4 +190,4 @@ bool HouseFeature::place(Level *level, Random *random, int x, int y, int z)
return true;
}
}

View file

@ -13,8 +13,9 @@ bool LakeFeature::place(Level *level, Random *random, int x, int y, int z)
{
x -= 8;
z -= 8;
while (y > 5 && level->isEmptyTile(x, y, z))
while (y > 5 && level->isEmptyTile(x, y, z)) {
y--;
}
if (y <= 4)
{
return false;
@ -172,4 +173,4 @@ bool LakeFeature::place(Level *level, Random *random, int x, int y, int z)
}
return true;
}
}

View file

@ -14,10 +14,10 @@ protected:
public:
LargeFeature();
~LargeFeature();
virtual ~LargeFeature();
virtual void apply(ChunkSource *ChunkSource, Level *level, int xOffs, int zOffs, byteArray blocks);
protected:
virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks) {}
};
};

View file

@ -5,9 +5,9 @@ class TreeFeature : public Feature
{
private:
const int baseHeight;
const bool addJungleFeatures;
const int trunkType;
const int leafType;
const bool addJungleFeatures;
public:
TreeFeature(bool doUpdate);

View file

@ -22,7 +22,7 @@ BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup)
#endif
if( file == INVALID_HANDLE_VALUE )
{
DWORD error = GetLastError();
// DWORD error = GetLastError();
//assert(false);
app.DebugPrintf("Biome override not found, using plains as default\n");
@ -78,4 +78,4 @@ intArray BiomeOverrideLayer::getArea(int xo, int yo, int w, int h)
}
}
return result;
}
}

View file

@ -24,6 +24,7 @@ public:
static LayerArray getDefaultLayers(__int64 seed, LevelType *levelType);
Layer(__int64 seedMixup);
virtual ~Layer(){}
virtual void init(__int64 seed);
virtual void initRandom(__int64 x, __int64 y);
@ -33,4 +34,4 @@ protected:
public:
virtual intArray getArea(int xo, int yo, int w, int h) = 0;
};
};

View file

@ -3,6 +3,7 @@ class Synth
{
public:
virtual double getValue(double x, double y) = 0;
virtual ~Synth(){}
doubleArray create(int width, int height);
};

View file

@ -39,6 +39,7 @@ private:
int maxPlaceCount;
PieceWeight(EPieceClass pieceClass, int weight, int maxPlaceCount);
virtual ~PieceWeight(){}
virtual bool doPlace(int depth);
bool isValid();
};