From 02d783a9937c226cdee8b7c09a23340cfceef13a Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 21 Jan 2018 12:41:42 +0000 Subject: [PATCH] Fix build --- src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp | 2 +- src/openrct2-ui/windows/Changelog.cpp | 3 ++- src/openrct2-ui/windows/EditorObjectSelection.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp index 2bc989f59c..d763a3b6a5 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp @@ -90,7 +90,7 @@ std::string OpenGLShader::ReadSourceCode(const std::string &path) } auto fileData = std::string((size_t)fileLength + 1, '\0'); - fs.Read(fileData.data(), fileLength); + fs.Read((void *)fileData.data(), fileLength); return fileData; } diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index c818c3ca18..99b63623e3 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -240,7 +240,8 @@ static bool window_changelog_read_file() return false; } - auto * start = _changelogText.data(); + // Non-const cast required until C++17 is enabled + auto * start = (char *)_changelogText.data(); if (_changelogText.size() >= 3 && utf8_is_bom(start)) { start += 3; diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index eb71b770d9..9693298914 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -1201,7 +1201,7 @@ static void window_editor_object_selection_set_pressed_tab(rct_window *w) static sint32 get_object_from_object_selection(uint8 object_type, sint32 y) { sint32 listItemIndex = y / 12; - if (listItemIndex < 0 || listItemIndex >= _listItems.size()) + if (listItemIndex < 0 || (size_t)listItemIndex >= _listItems.size()) return -1; return listItemIndex;