fixed warnings reported by cppcheck
authorPerttu Ahola <celeron55@gmail.com>
Mon, 11 Apr 2011 08:36:13 +0000 (11:36 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Mon, 11 Apr 2011 08:36:13 +0000 (11:36 +0300)
src/client.cpp
src/clientobject.cpp
src/debug.cpp
src/map.cpp
src/map.h
src/mapblockobject.h
src/server.cpp
src/socket.cpp
src/utility.h
src/voxel.h

index fca7b1b02d61b3843d5962373d90a270ec82b020..e2877f5fc63434ed123b68df5bb6afd4a29f7d37 100644 (file)
@@ -82,7 +82,8 @@ Client::Client(
        camera_direction(0,0,1),
        m_server_ser_ver(SER_FMT_VER_INVALID),
        m_inventory_updated(false),
-       m_time_of_day(0)
+       m_time_of_day(0),
+       m_map_seed(0)
 {
        m_packetcounter_timer = 0.0;
        m_delete_unused_sectors_timer = 0.0;
index 1d9dd215bd31a8a25517e37fa8c48389e220d6bf..5b744de6ce0d99b4c6490503e46002e68ab244fe 100644 (file)
@@ -404,7 +404,8 @@ RatCAO::RatCAO():
        ClientActiveObject(0),
        m_selection_box(-BS/3.,0.0,-BS/3., BS/3.,BS/2.,BS/3.),
        m_node(NULL),
-       m_position(v3f(0,10*BS,0))
+       m_position(v3f(0,10*BS,0)),
+       m_yaw(0)
 {
        ClientActiveObject::registerType(getType(), create);
 }
index d4d07375d90831a69bd90aca609f384e30a5f973..a19186232a5b8d6e735b2db172ff5c7044135b0d 100644 (file)
@@ -90,6 +90,7 @@ DebugStack::DebugStack(threadid_t id)
        threadid = id;
        stack_i = 0;
        stack_max_i = 0;
+       memset(stack, 0, DEBUG_STACK_SIZE*DEBUG_STACK_TEXT_SIZE);
 }
 
 void DebugStack::print(FILE *file, bool everything)
index 2d16710b1812cad33a25617557e662cf19aca675..82317aec5a02281b7691206598dbf4c091c4eba8 100644 (file)
@@ -6030,7 +6030,8 @@ void MapVoxelManipulator::blitBack
 }
 
 ManualMapVoxelManipulator::ManualMapVoxelManipulator(Map *map):
-               MapVoxelManipulator(map)
+               MapVoxelManipulator(map),
+               m_create_area(false)
 {
 }
 
index cb48cb32b65184616cb13d69f44c1975976dfdb7..206dc7d7ba31ee071903b7e1e1df7c711de56236 100644 (file)
--- a/src/map.h
+++ b/src/map.h
@@ -780,7 +780,8 @@ struct ChunkMakeData
 
        ChunkMakeData():
                no_op(false),
-               vmanip(NULL)
+               vmanip(NULL),
+               seed(0)
        {}
 };
 
index 6a0c36d9cbf765084949f4bb1f8bdfec1cdf4fc2..db8006fd9d9b91afac6e7a83df0c62baf4a1a407 100644 (file)
@@ -563,7 +563,8 @@ public:
                                (-BS*0.3,-BS*.25,-BS*0.3, BS*0.3,BS*0.25,BS*0.3);
                m_selection_box = new core::aabbox3d<f32>
                                (-BS*0.3,-BS*.25,-BS*0.3, BS*0.3,BS*0.25,BS*0.3);
-
+               
+               m_yaw = 0;
                m_counter1 = 0;
                m_counter2 = 0;
                m_age = 0;
@@ -906,7 +907,8 @@ class PlayerObject : public MovingObject
 public:
        PlayerObject(MapBlock *block, s16 id, v3f pos):
                MovingObject(block, id, pos),
-               m_node(NULL)
+               m_node(NULL),
+               m_yaw(0)
        {
                m_collision_box = new core::aabbox3d<f32>
                                (-BS*0.3,-BS*.25,-BS*0.3, BS*0.3,BS*0.25,BS*0.3);
index 3a1949d9815e59057dcf5a3415643cf66b1c22f0..b4c3d71f4670ab64b773a7f8b882378a34515be0 100644 (file)
@@ -892,6 +892,7 @@ void RemoteClient::SetBlocksNotSent(core::map<v3s16, MapBlock*> &blocks)
 PlayerInfo::PlayerInfo()
 {
        name[0] = 0;
+       avg_rtt = 0;
 }
 
 void PlayerInfo::PrintLine(std::ostream *s)
index b159fa14c5177b92b51bd8a7aca1495c3d98f4d0..ab3ca62c58d6ee90ee1dc050c92dd7207a9daedd 100644 (file)
@@ -53,6 +53,8 @@ void sockets_cleanup()
 
 Address::Address()
 {
+       m_address = 0;
+       m_port = 0;
 }
 
 Address::Address(unsigned int address, unsigned short port)
index 50bbe1496d8118d55be806df7d8618350bd4029e..e3a97740086326d734fdb59b833973bf340352aa 100644 (file)
@@ -1903,7 +1903,7 @@ inline v3f intToFloat(v3s16 p, f32 d)
 */
 
 // Creates a string with the length as the first two bytes
-inline std::string serializeString(const std::string plain)
+inline std::string serializeString(const std::string &plain)
 {
        assert(plain.size() <= 65535);
        char buf[2];
@@ -1945,7 +1945,7 @@ inline std::string deSerializeString(std::istream &is)
 }
 
 // Creates a string with the length as the first four bytes
-inline std::string serializeLongString(const std::string plain)
+inline std::string serializeLongString(const std::string &plain)
 {
        char buf[4];
        writeU32((u8*)&buf[0], plain.size());
index 5d45ab183e7dd310f30f06eeb6e0453d5bc51c1a..2e8015eb19c72dee159458b2902d45fff13889f2 100644 (file)
@@ -553,7 +553,7 @@ public:
        /*
                Some settings
        */
-       bool m_disable_water_climb;
+       //bool m_disable_water_climb;
 
 private:
 };