From bef8dedce03186ea2a14dbe7d57d100a5d6aa503 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 28 Apr 2011 10:22:20 +0000 Subject: [PATCH] Fixed Coverity reported issue. CID 11414: Logically dead code (DEADCODE) After this line, the value of "vboMemory" is equal to 0. Assigning: "vboMemory" = "NULL". Another case of debugging code paths being picked out. I have chosen to just delete these paths as the code looks to be working fine and less code is better than more code when it comes to maintenance. --- src/osg/BufferObject.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/osg/BufferObject.cpp b/src/osg/BufferObject.cpp index 840803c18..e191906a1 100644 --- a/src/osg/BufferObject.cpp +++ b/src/osg/BufferObject.cpp @@ -189,12 +189,6 @@ void GLBufferObject::compileBuffer() _extensions->glBufferData(_profile._target, _profile._size, NULL, _profile._usage); } - char* vboMemory = 0; - -#if 0 - vboMemory = extensions->glMapBuffer(_target, GL_WRITE_ONLY_ARB); -#endif - for(BufferEntries::iterator itr = _bufferEntries.begin(); itr != _bufferEntries.end(); ++itr) @@ -205,18 +199,10 @@ void GLBufferObject::compileBuffer() // OSG_NOTICE<<"GLBufferObject::compileBuffer(..) downloading BufferEntry "<<&entry<getModifiedCount(); - if (vboMemory) - memcpy(vboMemory + (GLsizeiptrARB)entry.offset, entry.dataSource->getDataPointer(), entry.dataSize); - else - _extensions->glBufferSubData(_profile._target, (GLintptrARB)entry.offset, (GLsizeiptrARB)entry.dataSize, entry.dataSource->getDataPointer()); + _extensions->glBufferSubData(_profile._target, (GLintptrARB)entry.offset, (GLsizeiptrARB)entry.dataSize, entry.dataSource->getDataPointer()); } } - - // Unmap the texture image buffer - if (vboMemory) _extensions->glUnmapBuffer(_profile._target); - - } void GLBufferObject::deleteGLObject()