mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 18:49:51 +01:00
Merge pull request #8358 from Vbif/static-analysis
Fixed some errors from PVS-Studio
This commit is contained in:
commit
2623da125b
6 files changed
+8
-6
No files matched your search
@@ -130,8 +130,6 @@ private:
|
||||
TextureCacheDX9 *textureCache_;
|
||||
ShaderManagerDX9 *shaderManager_;
|
||||
TransformDrawEngineDX9 *transformDraw_;
|
||||
bool usePostShader_;
|
||||
bool postShaderAtOutputResolution_;
|
||||
|
||||
// Used by post-processing shader
|
||||
std::vector<FBO *> extraFBOs_;
|
||||
|
||||
@@ -349,20 +349,24 @@ void CGEDebugger::DescribePixelRGBA(u32 pix, GPUDebugBufferFormat fmt, int x, in
|
||||
r = Convert5To8((pix >> 0) & 0x1F);
|
||||
g = Convert6To8((pix >> 5) & 0x3F);
|
||||
b = Convert5To8((pix >> 11) & 0x1F);
|
||||
break;
|
||||
case GPU_DBG_FORMAT_565_REV:
|
||||
b = Convert5To8((pix >> 0) & 0x1F);
|
||||
g = Convert6To8((pix >> 5) & 0x3F);
|
||||
r = Convert5To8((pix >> 11) & 0x1F);
|
||||
break;
|
||||
case GPU_DBG_FORMAT_5551:
|
||||
r = Convert5To8((pix >> 0) & 0x1F);
|
||||
g = Convert5To8((pix >> 5) & 0x1F);
|
||||
b = Convert5To8((pix >> 10) & 0x1F);
|
||||
a = (pix >> 15) & 1 ? 255 : 0;
|
||||
break;
|
||||
case GPU_DBG_FORMAT_5551_REV:
|
||||
a = pix & 1 ? 255 : 0;
|
||||
b = Convert5To8((pix >> 1) & 0x1F);
|
||||
g = Convert5To8((pix >> 6) & 0x1F);
|
||||
r = Convert5To8((pix >> 11) & 0x1F);
|
||||
break;
|
||||
case GPU_DBG_FORMAT_5551_BGRA:
|
||||
b = Convert5To8((pix >> 0) & 0x1F);
|
||||
g = Convert5To8((pix >> 5) & 0x1F);
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
ChunkFile::ChunkFile(const char *filename, bool _read) {
|
||||
data=0;
|
||||
fn = filename;
|
||||
fastMode=false;
|
||||
numLevels=0;
|
||||
read=_read;
|
||||
pos=0;
|
||||
|
||||
@@ -531,7 +531,7 @@ bool IniFile::Load(std::istream &in) {
|
||||
// Maximum number of letters in a line
|
||||
static const int MAX_BYTES = 1024*32;
|
||||
|
||||
while (!in.eof())
|
||||
while (!(in.eof() || in.fail()))
|
||||
{
|
||||
char templine[MAX_BYTES];
|
||||
in.getline(templine, MAX_BYTES);
|
||||
|
||||
@@ -164,7 +164,7 @@ void Convert(const uint8_t *image_data, int width, int height, int pitch, int fl
|
||||
for (int y = 0; y < height; y++) {
|
||||
for (int x = 0; x < width; x++) {
|
||||
int dithval = dith[(x&3)+((y&0x3)<<2)] - 8;
|
||||
dithval = 0;
|
||||
//dithval = 0; please check this
|
||||
int r = clamp32((image_data[i * 4] + dithval/2) >> 3);
|
||||
int g = clamp64((image_data[i * 4 + 1] + dithval/4) >> 2);
|
||||
int b = clamp32((image_data[i * 4 + 2] + dithval/2) >> 3);
|
||||
|
||||
@@ -323,7 +323,8 @@ int Client::ReadResponseEntity(Buffer *readbuf, const std::vector<std::string> &
|
||||
bool result = decompress_string(compressed, &decompressed);
|
||||
if (!result) {
|
||||
ELOG("Error decompressing using zlib");
|
||||
*progress = 0.0f;
|
||||
if (progress)
|
||||
*progress = 0.0f;
|
||||
return -1;
|
||||
}
|
||||
output->Append(decompressed);
|
||||
|
||||
Reference in new issue
Block a user