Cleanup warnings and bugs found through static analysis

This commit is contained in:
2017-04-27 17:48:12 -07:00
parent aa3046ee87
commit 41808f29c6
11 changed files with 57 additions and 59 deletions

View File

@@ -95,12 +95,6 @@ bool KRTextureTGA::uploadTexture(GLenum target, int lod_max_dim, int &current_lo
m_pData->lock();
TGA_HEADER *pHeader = (TGA_HEADER *)m_pData->getStart();
unsigned char *pData = (unsigned char *)pHeader + (long)pHeader->idlength + (long)pHeader->colourmaplength * (long)pHeader->colourmaptype + sizeof(TGA_HEADER);
#if TARGET_OS_IPHONE
GLenum base_internal_format = GL_BGRA;
#else
GLenum base_internal_format = pHeader->bitsperpixel == 24 ? GL_BGR : GL_BGRA;
#endif
GLenum internal_format = GL_RGBA;
@@ -115,8 +109,6 @@ bool KRTextureTGA::uploadTexture(GLenum target, int lod_max_dim, int &current_lo
return false; // Mapped colors not supported
}
GLenum err;
switch(pHeader->imagetype) {
case 2: // rgb
switch(pHeader->bitsperpixel) {