Skip to content

Commit

Permalink
Fixed silly C++ warning issue for return types
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislupo committed Jun 13, 2018
1 parent 54ce009 commit 7f5b9ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ ALU_Ops decode (const ALU_Type data) {
}
return ALU_MOV;
}

cout << "[ERROR] Unknown Instruction to be decoded" << endl;
exit(1);
}

DP_Ops decode (const DP_Type data) {
Expand Down Expand Up @@ -243,6 +244,8 @@ LD_ST_Ops decode (const LD_ST_Type data) {
}
}
}
cout << "[ERROR] Unknown Instruction to be decoded" << endl;
exit(1);
}

MISC_Ops decode (const MISC_Type data) {
Expand Down Expand Up @@ -391,7 +394,8 @@ MISC_Ops decode (const MISC_Type data) {
}
return MISC_ADD;
}

cout << "[ERROR] Unknown Instruction to be decoded" << endl;
exit(1);
}

int decode (const COND_Type data) {
Expand All @@ -401,13 +405,15 @@ int decode (const COND_Type data) {
printCond(data.instr.b.cond);
cout << " 0x" << hex << rf[15] + 2*(int)((char)(data.instr.b.imm))+2 << endl;
}
return COND;
}

int decode (const UNCOND_Type data) {
// complete
if (opts.instrs) {
cout << "b 0x" << hex << rf[15] + 2*(int)((char)(data.instr.b.imm))+2 << endl;
}
return UNCOND;
}

BL_Ops decode (const BL_Type data) {
Expand Down Expand Up @@ -438,4 +444,5 @@ int decode (const ADD_SP_Type data) {
if (opts.instrs) {
cout << "add r" << data.instr.add.rd << ", sp, #" << data.instr.add.imm*4 << endl;
}
return ADD_SP;
}
1 change: 1 addition & 0 deletions thumbsim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ class Register {
operator unsigned int() const { return d.data_uint(); }
Register & operator=(unsigned int val) {
write(val);
return *this;
}
};

Expand Down

0 comments on commit 7f5b9ac

Please sign in to comment.