diff --git a/src/celcompat/fs.cpp b/src/celcompat/fs.cpp index 10d378583..fedc7a686 100644 --- a/src/celcompat/fs.cpp +++ b/src/celcompat/fs.cpp @@ -611,8 +611,8 @@ path current_path() path current_path(std::error_code& ec) { #ifdef _WIN32 - std::wstring p(MAX_PATH + 1, 0); - DWORD r = GetModuleFileNameW(nullptr, &p[0], MAX_PATH); + std::wstring buffer(MAX_PATH + 1, 0); + DWORD r = GetModuleFileNameW(nullptr, &buffer[0], MAX_PATH); if (r == 0) { ec = std::error_code(errno, std::system_category()); @@ -621,14 +621,14 @@ path current_path(std::error_code& ec) auto pos = buffer.find_last_of(L"\\/"); return buffer.substr(0, pos); #else - std::string p(256, 0); - char *r = getcwd(&p[0], p.size()); + std::string buffer(256, 0); + char *r = getcwd(&buffer[0], p.size()); if (r == nullptr) { ec = std::error_code(errno, std::system_category()); return path(); } - return p; + return buffer; #endif } diff --git a/src/celengine/render.cpp b/src/celengine/render.cpp index e74becc09..21798ee86 100644 --- a/src/celengine/render.cpp +++ b/src/celengine/render.cpp @@ -86,8 +86,10 @@ std::ofstream hdrlog; #endif #ifdef _MSC_VER #include +#ifndef alloca #define alloca(s) _alloca(s) #endif +#endif using namespace cmod; using namespace Eigen; diff --git a/src/celengine/vertexobject.cpp b/src/celengine/vertexobject.cpp index d9ae9c6fe..97b725335 100644 --- a/src/celengine/vertexobject.cpp +++ b/src/celengine/vertexobject.cpp @@ -131,7 +131,7 @@ void VertexObject::enableAttribArrays() noexcept auto n = t.first; auto& p = t.second; glEnableVertexAttribArray(n); - glVertexAttribPointer(n, p.count, p.type, p.normalized, p.stride, (GLvoid*) p.offset); + glVertexAttribPointer(n, p.count, p.type, p.normalized, p.stride, (GLvoid*) (size_t) p.offset); } }