1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-31 22:15:33 +00:00

Merge pull request #2031 from akortunov/warnfix

Fix some Clang 7 warnings
This commit is contained in:
Bret Curtis 2018-11-14 09:43:39 +01:00 committed by GitHub
commit 8a66dec865
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 14 deletions

View file

@ -53,7 +53,7 @@ matrix:
sudo: required
env:
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7"
- ANALYZE="scan-build-7 --use-cc clang-7 --use-c++ clang++-7"
- ANALYZE="scan-build-7 --force-analyze-debug-code --use-cc clang-7 --use-c++ clang++-7"
- BUILD_OPENMW_CS="OFF"
compiler: clang
- name: OpenMW (openmw-cs) on Ubuntu Trusty Clang-7 with Static Analysis
@ -62,7 +62,7 @@ matrix:
sudo: required
env:
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7"
- ANALYZE="scan-build-7 --use-cc clang-7 --use-c++ clang++-7"
- ANALYZE="scan-build-7 --force-analyze-debug-code --use-cc clang-7 --use-c++ clang++-7"
- BUILD_OPENMW="OFF"
compiler: clang
# allow_failures:

View file

@ -743,6 +743,7 @@ namespace
mVertices (vertices),
mRenderXform (renderXform)
{
assert(font != nullptr);
mVertexColourType = MyGUI::RenderManager::getInstance().getVertexFormat();
}

View file

@ -25,6 +25,8 @@ bool shouldAcceptKeyFocus(MyGUI::Widget* w)
/// Recursively get all child widgets that accept keyboard input
void getKeyFocusWidgets(MyGUI::Widget* parent, std::vector<MyGUI::Widget*>& results)
{
assert(parent != nullptr);
if (!parent->getVisible() || !parent->getEnabled())
return;

View file

@ -90,7 +90,7 @@ bool FFmpeg_Decoder::getNextPacket()
bool FFmpeg_Decoder::getAVAudioData()
{
bool got_frame;
bool got_frame = false;
if(mCodecCtx->codec_type != AVMEDIA_TYPE_AUDIO)
return false;

View file

@ -267,8 +267,6 @@ namespace
struct NifFileMock : Nif::File
{
MOCK_CONST_METHOD1(fail, void (const std::string&));
MOCK_CONST_METHOD1(warn, void (const std::string&));
MOCK_CONST_METHOD1(getRecord, Nif::Record* (std::size_t));
MOCK_CONST_METHOD0(numRecords, std::size_t ());
MOCK_CONST_METHOD1(getRoot, Nif::Record* (std::size_t));

View file

@ -134,9 +134,9 @@ public:
{
state->bindVertexBufferObject(bufferobject);
glVertexPointer(3, GL_FLOAT, sizeof(MyGUI::Vertex), static_cast<char*>(0));
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(MyGUI::Vertex), static_cast<char*>(0) + 12);
glTexCoordPointer(2, GL_FLOAT, sizeof(MyGUI::Vertex), static_cast<char*>(0) + 16);
glVertexPointer(3, GL_FLOAT, sizeof(MyGUI::Vertex), reinterpret_cast<char*>(0));
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(MyGUI::Vertex), reinterpret_cast<char*>(12));
glTexCoordPointer(2, GL_FLOAT, sizeof(MyGUI::Vertex), reinterpret_cast<char*>(16));
}
else
{

View file

@ -18,10 +18,6 @@ struct File
{
virtual ~File() = default;
virtual void fail(const std::string &msg) const = 0;
virtual void warn(const std::string &msg) const = 0;
virtual Record *getRecord(size_t index) const = 0;
virtual size_t numRecords() const = 0;
@ -71,14 +67,14 @@ class NIFFile final : public File
public:
/// Used if file parsing fails
void fail(const std::string &msg) const override
void fail(const std::string &msg) const
{
std::string err = " NIFFile Error: " + msg;
err += "\nFile: " + filename;
throw std::runtime_error(err);
}
/// Used when something goes wrong, but not catastrophically so
void warn(const std::string &msg) const override
void warn(const std::string &msg) const
{
Log(Debug::Warning) << " NIFFile Warning: " << msg << "\nFile: " << filename;
}