Fixed some errors from PVS-Studio in Core project

FixedSizeQueue
- Added private operator=
- Changed signature of EndPop
Some changed to printf like functions.
Fixed typo in syn-att.c
This commit is contained in:
gmvbif 2015-12-28 11:21:02 +03:00
parent 1072028ef5
commit 281f0e18e6
5 changed files with 9 additions and 8 deletions

View File

@ -165,7 +165,8 @@ private:
int count_; // sacrifice 4 bytes for a simpler implementation. may optimize away in the future.
// Make copy constructor private for now.
FixedSizeQueue(FixedSizeQueue &other) { }
FixedSizeQueue(FixedSizeQueue &other);
FixedSizeQueue& operator=(const FixedSizeQueue &other);
};
@ -210,7 +211,7 @@ public:
T *BeginPop() {
return blocks[curReadBlock];
}
T *EndPop() {
void EndPop() {
curReadBlock++;
if (curReadBlock == NUM_BLOCKS)
curReadBlock = 0;

View File

@ -916,7 +916,7 @@ std::string SavedataParam::GetSpaceText(u64 size)
size /= 1024;
}
snprintf(text, sizeof(text), "%lld TB", size);
snprintf(text, sizeof(text), "%llu TB", size);
return std::string(text);
}

View File

@ -834,14 +834,14 @@ namespace MIPSInt
{
case 36: // mfic
if (!reported) {
Reporting::ReportMessage("MFIC instruction hit (%08x) at %08x", op, currentMIPS->pc);
Reporting::ReportMessage("MFIC instruction hit (%08x) at %08x", op.encoding, currentMIPS->pc);
WARN_LOG(CPU,"MFIC Disable/Enable Interrupt CPU instruction");
reported = 1;
}
break;
case 38: // mtic
if (!reported) {
Reporting::ReportMessage("MTIC instruction hit (%08x) at %08x", op, currentMIPS->pc);
Reporting::ReportMessage("MTIC instruction hit (%08x) at %08x", op.encoding, currentMIPS->pc);
WARN_LOG(CPU,"MTIC Disable/Enable Interrupt CPU instruction");
reported = 1;
}
@ -1027,7 +1027,7 @@ namespace MIPSInt
{
case 0:
if (!reported) {
Reporting::ReportMessage("INTERRUPT instruction hit (%08x) at %08x", op, currentMIPS->pc);
Reporting::ReportMessage("INTERRUPT instruction hit (%08x) at %08x", op.encoding, currentMIPS->pc);
WARN_LOG(CPU,"Disable/Enable Interrupt CPU instruction");
reported = 1;
}

View File

@ -375,7 +375,7 @@ public:
case DEC_U16_4: for (int i = 0; i < 4; i++) weights[i] = s[i] * (1.f / 32768.f); break;
default:
ERROR_LOG_REPORT_ONCE(fmtw0, G3D, "Reader: Unsupported W0 Format %d", decFmt_.w0fmt);
memset(weights, 0, sizeof(float) * 4);
memset(weights, 0, sizeof(float) * 8);
break;
}

View File

@ -157,7 +157,7 @@ ud_translate_att(struct ud *u)
ud_asmprintf(u, "lock ");
if (u->pfx_rep) {
ud_asmprintf(u, "rep ");
} else if (u->pfx_rep) {
} else if (u->pfx_repe) {
ud_asmprintf(u, "repe ");
} else if (u->pfx_repne) {
ud_asmprintf(u, "repne ");