diff --git a/source/graphics/Terrain.h b/source/graphics/Terrain.h index 82aab6ee3e..45a297411f 100755 --- a/source/graphics/Terrain.h +++ b/source/graphics/Terrain.h @@ -62,12 +62,12 @@ public: // calculate the vertex under a given position (rounding down coordinates) static void CalcFromPosition(const CVector3D& pos, i32& i, i32& j) { - i = pos.X / CELL_SIZE; j = pos.Z / CELL_SIZE; + i = (i32)(pos.X / CELL_SIZE); j = (i32)(pos.Z / CELL_SIZE); } // calculate the vertex under a given position (rounding down coordinates) static void CalcFromPosition(float x, float y, i32& i, i32& j) { - i = x / CELL_SIZE; j = y / CELL_SIZE; + i = (i32)(x / CELL_SIZE); j = (i32)(y / CELL_SIZE); } // calculate the normal at a given vertex void CalcNormal(u32 i, u32 j, CVector3D& normal) const; diff --git a/source/lib/sysdep/unix/udbg.cpp b/source/lib/sysdep/unix/udbg.cpp index c7020c1de7..5964ec43e0 100755 --- a/source/lib/sysdep/unix/udbg.cpp +++ b/source/lib/sysdep/unix/udbg.cpp @@ -112,7 +112,7 @@ void* debug_get_nth_caller(uint n, void *context) int bt_size; bt_size=backtrace(bt, n+2); - assert(bt_size >= n+2 && "Need at least n+2 frames in get_nth_caller"); + assert(bt_size >= (int)(n+2) && "Need at least n+2 frames in get_nth_caller"); return bt[n+1]; // n==1 => bt[2], and so forth } @@ -130,12 +130,12 @@ const wchar_t* debug_dump_stack(wchar_t* buf, size_t max_chars, uint skip, void* bt_size=backtrace(bt, ARRAY_SIZE(bt)); // did we get enough backtraced frames? - assert((bt_size >= skip) && "Need at least frames in the backtrace"); + assert((bt_size >= (int)skip) && "Need at least frames in the backtrace"); // Assumed max length of a single print-out static const uint MAX_OUT_CHARS=1024; - for (uint i=skip;i(ptr_of_interest); ctx.file_ctx=file_ctx; bfd_map_over_sections (abfd, find_address_in_section, &ctx); diff --git a/source/scripting/ScriptingHost.cpp b/source/scripting/ScriptingHost.cpp index 72b20f5110..5c50ab981b 100755 --- a/source/scripting/ScriptingHost.cpp +++ b/source/scripting/ScriptingHost.cpp @@ -11,11 +11,13 @@ #include "lib/res/res.h" +#if OS_WIN #ifdef NDEBUG # pragma comment (lib, "js32.lib") #else # pragma comment (lib, "js32d.lib") #endif +#endif #define LOG_CATEGORY "scriptinghost" diff --git a/source/sound/CMusicPlayer.cpp b/source/sound/CMusicPlayer.cpp index c16c22dd0b..6bca3e4e50 100755 --- a/source/sound/CMusicPlayer.cpp +++ b/source/sound/CMusicPlayer.cpp @@ -39,7 +39,7 @@ void CMusicPlayer::open(char* UNUSED(filename)) if (is_open) release(); -/*/* +/* void* p; size_t sizeOfFile; if(vfs_load(filename, p, sizeOfFile) <= 0) @@ -118,6 +118,7 @@ bool CMusicPlayer::isPlaying() check(); return (state == AL_PLAYING); } +*/ /* bool CMusicPlayer::issue(int slot_idx) diff --git a/source/sound/CPlayList.cpp b/source/sound/CPlayList.cpp index f6aa92484f..a974e766b1 100755 --- a/source/sound/CPlayList.cpp +++ b/source/sound/CPlayList.cpp @@ -29,9 +29,9 @@ void CPlayList::load(const char* file) WARN_ERR_RETURN(hm); const char* playlist = (const char*)p; - const char* track; - debug_warn("TODO: This code looks quite suspicious"); - while(sscanf(playlist, "%s\n", &track) == 1) + char track[512]; + + while(sscanf(playlist, "%511s\n", track) == 1) tracks.push_back(track); mem_free_h(hm);