mirror of
https://github.com/libretro/ppsspp.git
synced 2024-12-04 15:06:25 +00:00
Clean up some unused result warnings.
This commit is contained in:
parent
25136eb019
commit
30e13c7c37
@ -60,7 +60,9 @@ const char *GetStringErrorMsg(int errCode) {
|
||||
static __thread char err_str[buff_size] = {};
|
||||
|
||||
// Thread safe (XSI-compliant)
|
||||
strerror_r(errCode, err_str, buff_size);
|
||||
if (strerror_r(errCode, err_str, buff_size) == 0) {
|
||||
return "Unknown error";
|
||||
}
|
||||
#endif
|
||||
|
||||
return err_str;
|
||||
|
@ -62,12 +62,12 @@ int ChunkFile::readInt() {
|
||||
return *(int *)(data + pos - 4);
|
||||
else {
|
||||
int i;
|
||||
fread(&i, 1, 4, file);
|
||||
return i;
|
||||
if (fread(&i, 1, 4, file) == 4) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ChunkFile::writeInt(int i) {
|
||||
@ -166,18 +166,23 @@ void ChunkFile::ascend() {
|
||||
|
||||
//read a block
|
||||
void ChunkFile::readData(void *what, int count) {
|
||||
if (fastMode)
|
||||
if (fastMode) {
|
||||
memcpy(what, data + pos, count);
|
||||
else
|
||||
fread(what, 1, count, file);
|
||||
} else {
|
||||
if (fread(what, 1, count, file) != count) {
|
||||
ELOG("Failed to read complete %d bytes", count);
|
||||
}
|
||||
}
|
||||
|
||||
pos+=count;
|
||||
char temp[4]; //discarded
|
||||
count &= 3;
|
||||
if (count) {
|
||||
count=4-count;
|
||||
if (!fastMode)
|
||||
fread(temp, 1, count, file); // could just as well seek
|
||||
if (!fastMode) {
|
||||
if (fseek(file, count, SEEK_CUR) != 0) {
|
||||
ELOG("Missing padding");
|
||||
}
|
||||
}
|
||||
pos+=count;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user