Fix misc. MinGW and Valgrind warnings
authorkwolekr <kwolekr@minetest.net>
Sun, 8 Nov 2015 21:19:34 +0000 (16:19 -0500)
committerkwolekr <kwolekr@minetest.net>
Sun, 8 Nov 2015 21:34:56 +0000 (16:34 -0500)
src/localplayer.cpp
src/minimap.cpp
src/threading/thread.cpp
src/util/serialize.cpp

index e55464479aa177b6042d949230ff74aad038b5bc..fd781f940f6f3c255d8edf0ff01a88c77d311655 100644 (file)
@@ -42,6 +42,7 @@ LocalPlayer::LocalPlayer(IGameDef *gamedef, const char *name):
        last_pitch(0),
        last_yaw(0),
        last_keyPressed(0),
+       camera_impact(0.f),
        last_animation(NO_ANIM),
        hotbar_image(""),
        hotbar_selected_image(""),
index a6eff0680f2255a79cd0dbe80d0354019404d517..ded8470c54bcad77c6a6d8bd8fdbcb5a142d9524 100644 (file)
@@ -216,6 +216,8 @@ Mapper::Mapper(IrrlichtDevice *device, Client *client)
        this->m_shdrsrc = client->getShaderSource();
        this->m_ndef    = client->getNodeDefManager();
 
+       m_angle = 0.f;
+
        // Initialize static settings
        m_enable_shaders = g_settings->getBool("enable_shaders");
        m_surface_mode_scan_height =
index 57b551503831ff60b19dd0f7a80a01192981a391..8688c4cbf0079ab047ace82d18c8d8a2e86b3570 100644 (file)
@@ -264,7 +264,8 @@ DWORD WINAPI Thread::threadProc(LPVOID param)
        thr->m_running = false;
        g_logger.deregisterThread();
 
-       return NULL;
+       // 0 is returned here to avoid an unnecessary ifdef clause
+       return 0;
 }
 
 
index ced5fc7cf910d70dc384e00d91f204d89a93bc45..99cb990f1dada7ee78f0dafa9f68349aab7e1a0f 100644 (file)
@@ -229,7 +229,7 @@ std::string deSerializeLongString(std::istream &is)
 
        Buffer<char> buf2(s_size);
        is.read(&buf2[0], s_size);
-       if (is.gcount() != s_size)
+       if ((u32)is.gcount() != s_size)
                throw SerializationError("deSerializeLongString: couldn't read all chars");
 
        s.reserve(s_size);