aboutsummaryrefslogtreecommitdiff
path: root/qtmips_asm
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-07-17 22:50:42 +0200
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-07-17 22:50:42 +0200
commitd0e96ac431f8ebccc5fd21580414913824d72766 (patch)
treec186e5307e36f4be47df18de516d95ea97556e78 /qtmips_asm
parent94095c7890f491d7023b1a69b3f088be8c05e898 (diff)
downloadqtmips-d0e96ac431f8ebccc5fd21580414913824d72766.tar.gz
qtmips-d0e96ac431f8ebccc5fd21580414913824d72766.tar.bz2
qtmips-d0e96ac431f8ebccc5fd21580414913824d72766.zip
Prepend message types by MSG_, Windows headerfiles define ERROR as macro.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_asm')
-rw-r--r--qtmips_asm/messagetype.h10
-rw-r--r--qtmips_asm/simpleasm.cpp16
2 files changed, 13 insertions, 13 deletions
diff --git a/qtmips_asm/messagetype.h b/qtmips_asm/messagetype.h
index a3a1c49..fef5eb8 100644
--- a/qtmips_asm/messagetype.h
+++ b/qtmips_asm/messagetype.h
@@ -39,11 +39,11 @@
namespace messagetype {
enum Type {
- START,
- FINISH,
- INFO,
- WARNING,
- ERROR,
+ MSG_START,
+ MSG_FINISH,
+ MSG_INFO,
+ MSG_WARNING,
+ MSG_ERROR,
};
}
diff --git a/qtmips_asm/simpleasm.cpp b/qtmips_asm/simpleasm.cpp
index 15d50b2..9ff8816 100644
--- a/qtmips_asm/simpleasm.cpp
+++ b/qtmips_asm/simpleasm.cpp
@@ -150,7 +150,7 @@ bool SimpleAsm::process_line(QString line, QString filename,
if (!ok) {
error = tr("line %1 .orig %2 parse error.")
.arg(QString::number(line_number), line);
- emit report_message(messagetype::ERROR, filename, line_number, 0, error, "");
+ emit report_message(messagetype::MSG_ERROR, filename, line_number, 0, error, "");
error_occured = true;
fatal_occured = true;
if (error_ptr != nullptr)
@@ -165,7 +165,7 @@ bool SimpleAsm::process_line(QString line, QString filename,
if ((operands.count() > 2) || (operands.count() < 1)) {
error = tr("line %1 .set or .equ incorrect arguments number.")
.arg(QString::number(line_number));
- emit report_message(messagetype::ERROR, filename, line_number, 0, error, "");
+ emit report_message(messagetype::MSG_ERROR, filename, line_number, 0, error, "");
error_occured = true;
if (error_ptr != nullptr)
*error_ptr = error;
@@ -184,7 +184,7 @@ bool SimpleAsm::process_line(QString line, QString filename,
if (!ok) {
error = tr("line %1 .set or .equ %2 parse error.")
.arg(QString::number(line_number), operands.at(1));
- emit report_message(messagetype::ERROR, filename, line_number, 0, error, "");
+ emit report_message(messagetype::MSG_ERROR, filename, line_number, 0, error, "");
error_occured = true;
if (error_ptr != nullptr)
*error_ptr = error;
@@ -218,7 +218,7 @@ bool SimpleAsm::process_line(QString line, QString filename,
if (size < 0) {
error = tr("line %1 instruction %2 parse error - %3.")
.arg(QString::number(line_number), line, error);
- emit report_message(messagetype::ERROR, filename, line_number, 0, error, "");
+ emit report_message(messagetype::MSG_ERROR, filename, line_number, 0, error, "");
error_occured = true;
if (error_ptr != nullptr)
*error_ptr = error;
@@ -241,7 +241,7 @@ bool SimpleAsm::finish(QString *error_ptr) {
if (!expression.parse(r->expression, error)) {
error = tr("expression parse error %1 at line %2, expression %3.")
.arg(error, QString::number(r->line), expression.dump());
- emit report_message(messagetype::ERROR, r->filename, r->line, 0, error, "");
+ emit report_message(messagetype::MSG_ERROR, r->filename, r->line, 0, error, "");
if (error_ptr != nullptr && !error_reported)
*error_ptr = error;
error_occured = true;
@@ -251,20 +251,20 @@ bool SimpleAsm::finish(QString *error_ptr) {
if (!expression.eval(value, symtab, error)) {
error = tr("expression evalution error %1 at line %2 , expression %3.")
.arg(error, QString::number(r->line), expression.dump());
- emit report_message(messagetype::ERROR, r->filename, r->line, 0, error, "");
+ emit report_message(messagetype::MSG_ERROR, r->filename, r->line, 0, error, "");
if (error_ptr != nullptr && !error_reported)
*error_ptr = error;
error_occured = true;
error_reported = true;
} else {
if (false)
- emit report_message(messagetype::INFO, r->filename, r->line, 0,
+ emit report_message(messagetype::MSG_INFO, r->filename, r->line, 0,
expression.dump() + " -> " + QString::number(value), "");
machine::Instruction inst(mem->read_word(r->location, true));
if (!inst.update(value, r)) {
error = tr("instruction update error %1 at line %2, expression %3 -> value %4.")
.arg(error, QString::number(r->line), expression.dump(), QString::number(value));
- emit report_message(messagetype::ERROR, r->filename, r->line, 0, error, "");
+ emit report_message(messagetype::MSG_ERROR, r->filename, r->line, 0, error, "");
if (error_ptr != nullptr && !error_reported)
*error_ptr = error;
error_occured = true;