fixed all C++ extra + pedantic errors

This commit is contained in:
Blaise Tine
2020-02-17 15:02:06 -05:00
parent 4184980188
commit 90c3813340
25 changed files with 141 additions and 98 deletions

View File

@@ -24,7 +24,7 @@ ByteDecoder::ByteDecoder(const ArchDef &ad) {
static void decodeError(string msg) {
cout << "Instruction decoder error: " << msg << '\n';
exit(1);
std::abort();
}
void Encoder::encodeChunk(DataChunk &dest, const TextChunk &src) {
@@ -386,7 +386,7 @@ Instruction *WordDecoder::decode(const std::vector<Byte> &v, Size &idx) {
break;
defualt:
cout << "Unrecognized argument class in word decoder.\n";
exit(1);
std::abort();
}
if (haveRefs && usedImm && refMap.find(idx-n/8) != refMap.end()) {

View File

@@ -359,7 +359,7 @@ namespace Harp {
char* content = new char[size];
int x = fread(content, 1, size, fp);
if (!x) { std::cout << "COULD NOT READ FILE\n"; exit(1);}
if (!x) { std::cout << "COULD NOT READ FILE\n"; std::abort();}
int offset = 0;
char* line = content;

View File

@@ -40,7 +40,7 @@ namespace Harp {
Ref(name, rel), addr(addr) { }
virtual void bind(Addr addr, Addr base = 0) {
std::cout << "Attempted to bind a SimpleRef.\n";
exit(1);
std::abort();
}
virtual Addr getAddr() const { return this->addr; }
Byte *getAddrPtr() { return (Byte*)&addr; }
@@ -86,7 +86,7 @@ namespace Harp {
// std::cout << "Attempt to bind a " << bits << "-bit "
// << (relative?"":"non-") << "relative symbol to an address"
// " it cannot reach.\n";
// exit(1);
// std::abort();
// }
// virtual Addr getAddr() const {

View File

@@ -284,7 +284,7 @@ void Instruction::executeOn(Warp &c) {
break;
default:
cout << "unsupported MUL/DIV instr\n";
exit(1);
std::abort();
}
}
else
@@ -351,7 +351,7 @@ void Instruction::executeOn(Warp &c) {
break;
default:
cout << "ERROR: UNSUPPORTED R INST\n";
exit(1);
std::abort();
}
}
break;
@@ -388,7 +388,7 @@ void Instruction::executeOn(Warp &c) {
break;
default:
cout << "ERROR: UNSUPPORTED L INST\n";
exit(1);
std::abort();
c.memAccesses.push_back(Warp::MemAccess(false, memAddr));
}
break;
@@ -475,7 +475,7 @@ void Instruction::executeOn(Warp &c) {
break;
default:
cout << "ERROR: UNSUPPORTED L INST\n";
exit(1);
std::abort();
}
break;
case S_INST:
@@ -507,7 +507,7 @@ void Instruction::executeOn(Warp &c) {
break;
default:
cout << "ERROR: UNSUPPORTED S INST\n";
exit(1);
std::abort();
}
c.memAccesses.push_back(Warp::MemAccess(true, memAddr));
#ifdef EMU_INSTRUMENTATION
@@ -855,7 +855,7 @@ void Instruction::executeOn(Warp &c) {
default:
cout << "pc: " << hex << (c.pc) << "\n";
cout << "aERROR: Unsupported instruction: " << *this << "\n" << flush;
exit(1);
std::abort();
}
}

View File

@@ -25,7 +25,7 @@ RamMemDevice::RamMemDevice(const char *filename, Size wordSize) :
if (!input) {
cout << "Error reading file \"" << filename << "\" into RamMemDevice.\n";
exit(1);
std::abort();
}
do { contents.push_back(input.get()); } while (input);
@@ -38,7 +38,7 @@ RamMemDevice::RamMemDevice(Size size, Size wordSize) :
void RomMemDevice::write(Addr, Word) {
cout << "Attempt to write to ROM.\n";
exit(1);
std::abort();
}
Word RamMemDevice::read(Addr addr) {
@@ -215,7 +215,7 @@ Word DiskControllerMemDevice::read(Addr a) {
case 5: return status;
default:
cout << "Attempt to read invalid disk controller register.\n";
exit(1);
std::abort();
}
}

View File

@@ -20,7 +20,7 @@ Harp::OSDomain::OSDomain(ArchDef &archref, string imgFile) :
{
if (osDomain != NULL) {
cout << "Error: OSDomain is a singleton.";
exit(1);
std::abort();
}
osDomain = this;