Deal with compiler warnings

This commit is contained in:
sfan5 2022-04-28 20:53:15 +02:00
parent faecff570c
commit a89afe1229
12 changed files with 30 additions and 30 deletions

@ -407,7 +407,7 @@ public:
}
ClientScripting *getScript() { return m_script; }
const bool modsLoaded() const { return m_mods_loaded; }
bool modsLoaded() const { return m_mods_loaded; }
void pushToEventQueue(ClientEvent *event);

@ -81,9 +81,9 @@ public:
return false;
}
void drop()
void drop() override
{
ISceneNode::drop();
ISceneNode::drop(); // calls destructor
}
void updateCamera(v3f pos, v3f dir, f32 fov, v3s16 offset);
@ -91,24 +91,22 @@ public:
/*
Forcefully get a sector from somewhere
*/
MapSector * emergeSector(v2s16 p);
//void deSerializeSector(v2s16 p2d, std::istream &is);
MapSector * emergeSector(v2s16 p) override;
/*
ISceneNode methods
*/
virtual void OnRegisterSceneNode();
virtual void OnRegisterSceneNode() override;
virtual void render()
virtual void render() override
{
video::IVideoDriver* driver = SceneManager->getVideoDriver();
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
renderMap(driver, SceneManager->getSceneNodeRenderPass());
}
virtual const aabb3f &getBoundingBox() const
virtual const aabb3f &getBoundingBox() const override
{
return m_box;
}
@ -130,7 +128,7 @@ public:
void renderPostFx(CameraMode cam_mode);
// For debug printing
virtual void PrintInfo(std::ostream &out);
void PrintInfo(std::ostream &out) override;
const MapDrawControl & getControl() const { return m_control; }
f32 getWantedRange() const { return m_control.wanted_range; }

@ -435,7 +435,7 @@ const v3f GenericCAO::getPosition() const
return m_position;
}
const bool GenericCAO::isImmortal()
bool GenericCAO::isImmortal() const
{
return itemgroup_get(getGroups(), "immortal");
}

@ -172,7 +172,7 @@ public:
inline const v3f &getRotation() const { return m_rotation; }
const bool isImmortal();
bool isImmortal() const;
inline const ObjectProperties &getProperties() const { return m_prop; }

@ -1063,9 +1063,9 @@ bool Game::startup(bool *kill,
void Game::run()
{
ProfilerGraph graph;
RunStats stats = { 0 };
CameraOrientation cam_view_target = { 0 };
CameraOrientation cam_view = { 0 };
RunStats stats;
CameraOrientation cam_view_target = {};
CameraOrientation cam_view = {};
FpsControl draw_times;
f32 dtime; // in seconds

@ -304,7 +304,7 @@ void Minimap::setModeIndex(size_t index)
data->mode = m_modes[index];
m_current_mode_index = index;
} else {
data->mode = MinimapModeDef{MINIMAP_TYPE_OFF, gettext("Minimap hidden"), 0, 0, ""};
data->mode = {MINIMAP_TYPE_OFF, gettext("Minimap hidden"), 0, 0, "", 0};
m_current_mode_index = 0;
}

@ -31,10 +31,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "profiler.h"
ShadowRenderer::ShadowRenderer(IrrlichtDevice *device, Client *client) :
m_device(device), m_smgr(device->getSceneManager()),
m_driver(device->getVideoDriver()), m_client(client), m_current_frame(0),
m_smgr(device->getSceneManager()), m_driver(device->getVideoDriver()),
m_client(client), m_current_frame(0),
m_perspective_bias_xy(0.8), m_perspective_bias_z(0.5)
{
(void) m_client;
m_shadows_supported = true; // assume shadows supported. We will check actual support in initialize
m_shadows_enabled = true;

@ -109,7 +109,6 @@ private:
void enable() { m_shadows_enabled = m_shadows_supported; }
// a bunch of variables
IrrlichtDevice *m_device{nullptr};
scene::ISceneManager *m_smgr{nullptr};
video::IVideoDriver *m_driver{nullptr};
Client *m_client{nullptr};

@ -94,7 +94,8 @@ protected:
checkResults(PQprepare(m_conn, name.c_str(), sql.c_str(), 0, NULL));
}
const int getPGVersion() const { return m_pgversion; }
int getPGVersion() const { return m_pgversion; }
private:
// Database connectivity checks
void ping();

@ -327,7 +327,7 @@ public:
- Create blank filled with CONTENT_IGNORE
*/
MapBlock *emergeBlock(v3s16 p, bool create_blank=true);
MapBlock *emergeBlock(v3s16 p, bool create_blank=true) override;
/*
Try to get a block.
@ -349,27 +349,27 @@ public:
static MapDatabase *createDatabase(const std::string &name, const std::string &savedir, Settings &conf);
// Call these before and after saving of blocks
void beginSave();
void endSave();
void beginSave() override;
void endSave() override;
void save(ModifiedState save_level);
void save(ModifiedState save_level) override;
void listAllLoadableBlocks(std::vector<v3s16> &dst);
void listAllLoadedBlocks(std::vector<v3s16> &dst);
MapgenParams *getMapgenParams();
bool saveBlock(MapBlock *block);
bool saveBlock(MapBlock *block) override;
static bool saveBlock(MapBlock *block, MapDatabase *db, int compression_level = -1);
MapBlock* loadBlock(v3s16 p);
// Database version
void loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool save_after_load=false);
bool deleteBlock(v3s16 blockpos);
bool deleteBlock(v3s16 blockpos) override;
void updateVManip(v3s16 pos);
// For debug printing
virtual void PrintInfo(std::ostream &out);
void PrintInfo(std::ostream &out) override;
bool isSavingEnabled(){ return m_map_saving_enabled; }

@ -194,7 +194,7 @@ struct BufferedPacket {
u16 getSeqnum() const;
inline const size_t size() const { return m_data.size(); }
inline size_t size() const { return m_data.size(); }
u8 *data; // Direct memory access
float time = 0.0f; // Seconds from buffering the packet or re-sending

@ -231,7 +231,7 @@ void UDPSocket::Send(const Address &destination, const void *data, int size)
int sent;
if (m_addr_family == AF_INET6) {
struct sockaddr_in6 address = {0};
struct sockaddr_in6 address = {};
address.sin6_family = AF_INET6;
address.sin6_addr = destination.getAddress6();
address.sin6_port = htons(destination.getPort());
@ -239,7 +239,7 @@ void UDPSocket::Send(const Address &destination, const void *data, int size)
sent = sendto(m_handle, (const char *)data, size, 0,
(struct sockaddr *)&address, sizeof(struct sockaddr_in6));
} else {
struct sockaddr_in address = {0};
struct sockaddr_in address = {};
address.sin_family = AF_INET;
address.sin_addr = destination.getAddress();
address.sin_port = htons(destination.getPort());