From 8b1d5b5e4a3af2500e9a28ecfaf6c07e53e927ac Mon Sep 17 00:00:00 2001 From: Ashton Larkin <42042756+adlarkin@users.noreply.github.com> Date: Fri, 6 Nov 2020 17:10:12 -0500 Subject: [PATCH] fix codecheck errors (#173) Signed-off-by: Ashton Larkin --- ogre/src/OgreRenderEngine.cc | 7 +++++-- ogre2/src/Ogre2RenderEngine.cc | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ogre/src/OgreRenderEngine.cc b/ogre/src/OgreRenderEngine.cc index 963585125..db3e149a5 100644 --- a/ogre/src/OgreRenderEngine.cc +++ b/ogre/src/OgreRenderEngine.cc @@ -493,8 +493,11 @@ void OgreRenderEngine::CreateRenderSystem() renderSys = rsList->at(c); c++; } - while (renderSys && - renderSys->getName().compare("OpenGL Rendering Subsystem") != 0); + // cpplint has a false positive when extending a while call to multiple lines + // (it thinks the while loop is empty), so we must put the whole while + // statement on one line and add NOLINT at the end so that cpplint doesn't + // complain about the line being too long + while (renderSys && renderSys->getName().compare("OpenGL Rendering Subsystem") != 0); // NOLINT if (renderSys == nullptr) { diff --git a/ogre2/src/Ogre2RenderEngine.cc b/ogre2/src/Ogre2RenderEngine.cc index fde53d2f0..eae0850ce 100644 --- a/ogre2/src/Ogre2RenderEngine.cc +++ b/ogre2/src/Ogre2RenderEngine.cc @@ -476,8 +476,11 @@ void Ogre2RenderEngine::CreateRenderSystem() renderSys = rsList->at(c); c++; } - while (renderSys && - renderSys->getName().compare("OpenGL 3+ Rendering Subsystem") != 0); + // cpplint has a false positive when extending a while call to multiple lines + // (it thinks the while loop is empty), so we must put the whole while + // statement on one line and add NOLINT at the end so that cpplint doesn't + // complain about the line being too long + while (renderSys && renderSys->getName().compare("OpenGL 3+ Rendering Subsystem") != 0); // NOLINT if (renderSys == nullptr) {