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) {