Skip to content

Commit

Permalink
Fixed some errors from PVS-Studio in Core project
Browse files Browse the repository at this point in the history
FixedSizeQueue
- Added private operator=
- Changed signature of EndPop
Some changed to printf like functions.
Fixed typo in syn-att.c
  • Loading branch information
Vbif committed Dec 31, 2015
1 parent 1072028 commit 281f0e1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Common/FixedSizeQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ class FixedSizeQueue {
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);
};


Expand Down Expand Up @@ -210,7 +211,7 @@ class LockFreeBlockQueue {
T *BeginPop() {
return blocks[curReadBlock];
}
T *EndPop() {
void EndPop() {
curReadBlock++;
if (curReadBlock == NUM_BLOCKS)
curReadBlock = 0;
Expand Down
2 changes: 1 addition & 1 deletion Core/Dialog/SavedataParam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions Core/MIPS/MIPSInt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion GPU/Common/VertexDecoderCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class VertexReader
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;
}

Expand Down
2 changes: 1 addition & 1 deletion ext/udis86/syn-att.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ");
Expand Down

0 comments on commit 281f0e1

Please sign in to comment.