diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-07-18 09:35:44 +0200 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-07-18 09:35:44 +0200 |
commit | 9db55f741e283d0e52f2cd07090d9403378cd6a5 (patch) | |
tree | d2cd522846707e9da3665e72ef01122fececa3f0 | |
parent | 6fabd7c08a087278a44260335769d0e78aa355ee (diff) | |
download | qtmips-9db55f741e283d0e52f2cd07090d9403378cd6a5.tar.gz qtmips-9db55f741e283d0e52f2cd07090d9403378cd6a5.tar.bz2 qtmips-9db55f741e283d0e52f2cd07090d9403378cd6a5.zip |
Rename Highlighter to HighlighterAsm to preare for alternative C highlighter.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
-rw-r--r-- | libelf/dummy-sigaltstack.c | 10 | ||||
-rw-r--r-- | qtmips_gui/highlighterasm.cpp (renamed from qtmips_gui/highlighter.cpp) | 6 | ||||
-rw-r--r-- | qtmips_gui/highlighterasm.h (renamed from qtmips_gui/highlighter.h) | 10 | ||||
-rw-r--r-- | qtmips_gui/qtmips_gui.pro | 4 | ||||
-rw-r--r-- | qtmips_gui/srceditor.cpp | 4 | ||||
-rw-r--r-- | qtmips_gui/srceditor.h | 4 |
6 files changed, 24 insertions, 14 deletions
diff --git a/libelf/dummy-sigaltstack.c b/libelf/dummy-sigaltstack.c new file mode 100644 index 0000000..b9ab59b --- /dev/null +++ b/libelf/dummy-sigaltstack.c @@ -0,0 +1,10 @@ +#ifdef __EMSCRIPTEN__ + +#include <signal.h> + +int sigaltstack(const stack_t *ss, stack_t *old_ss) +{ + return -1; +} + +#endif diff --git a/qtmips_gui/highlighter.cpp b/qtmips_gui/highlighterasm.cpp index 463bbb3..b996e20 100644 --- a/qtmips_gui/highlighter.cpp +++ b/qtmips_gui/highlighterasm.cpp @@ -35,10 +35,10 @@ /* Based on Qt example released under BSD license */ #include "QStringList" -#include "highlighter.h" +#include "highlighterasm.h" #include "instruction.h" -Highlighter::Highlighter(QTextDocument *parent) +HighlighterAsm::HighlighterAsm(QTextDocument *parent) : QSyntaxHighlighter(parent) { HighlightingRule rule; @@ -111,7 +111,7 @@ Highlighter::Highlighter(QTextDocument *parent) //commentEndExpression = QRegularExpression(QStringLiteral("\\*/")); } -void Highlighter::highlightBlock(const QString &text) +void HighlighterAsm::highlightBlock(const QString &text) { #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) foreach(const HighlightingRule &rule, highlightingRules) diff --git a/qtmips_gui/highlighter.h b/qtmips_gui/highlighterasm.h index 93f1d77..7f27144 100644 --- a/qtmips_gui/highlighter.h +++ b/qtmips_gui/highlighterasm.h @@ -34,8 +34,8 @@ ******************************************************************************/ /* Based on Qt example released under BSD license */ -#ifndef HIGHLIGHTER_H -#define HIGHLIGHTER_H +#ifndef HIGHLIGHTERASM_H +#define HIGHLIGHTERASM_H #include <QSyntaxHighlighter> #include <QTextCharFormat> @@ -46,12 +46,12 @@ class QTextDocument; QT_END_NAMESPACE //! [0] -class Highlighter : public QSyntaxHighlighter +class HighlighterAsm : public QSyntaxHighlighter { Q_OBJECT public: - Highlighter(QTextDocument *parent = 0); + HighlighterAsm(QTextDocument *parent = 0); protected: void highlightBlock(const QString &text) override; @@ -76,4 +76,4 @@ private: }; //! [0] -#endif // HIGHLIGHTER_H +#endif // HIGHLIGHTERASM_H diff --git a/qtmips_gui/qtmips_gui.pro b/qtmips_gui/qtmips_gui.pro index 0f8cab0..1be139e 100644 --- a/qtmips_gui/qtmips_gui.pro +++ b/qtmips_gui/qtmips_gui.pro @@ -76,7 +76,7 @@ SOURCES += \ hinttabledelegate.cpp \ coreview/minimux.cpp \ srceditor.cpp \ - highlighter.cpp \ + highlighterasm.cpp \ messagesdock.cpp \ messagesmodel.cpp \ messagesview.cpp @@ -124,7 +124,7 @@ HEADERS += \ hinttabledelegate.h \ coreview/minimux.h \ srceditor.h \ - highlighter.h \ + highlighterasm.h \ messagesdock.h \ messagesmodel.h \ messagesview.h diff --git a/qtmips_gui/srceditor.cpp b/qtmips_gui/srceditor.cpp index 55f372a..e7502ac 100644 --- a/qtmips_gui/srceditor.cpp +++ b/qtmips_gui/srceditor.cpp @@ -40,7 +40,7 @@ #include <QTextBlock> #include "srceditor.h" -#include "highlighter.h" +#include "highlighterasm.h" void SrcEditor::setup_common() { QFont font; @@ -49,7 +49,7 @@ void SrcEditor::setup_common() { font.setPointSize(10); setFont(font); tname = "Unknown"; - highlighter = new Highlighter(document()); + highlighter = new HighlighterAsm(document()); } SrcEditor::SrcEditor(QWidget *parent) : Super(parent) { diff --git a/qtmips_gui/srceditor.h b/qtmips_gui/srceditor.h index 1fdbb98..02650e5 100644 --- a/qtmips_gui/srceditor.h +++ b/qtmips_gui/srceditor.h @@ -38,8 +38,8 @@ #include <QTextEdit> #include <QString> +#include <QSyntaxHighlighter> #include "qtmipsmachine.h" -#include "highlighter.h" class SrcEditor : public QTextEdit { Q_OBJECT @@ -56,7 +56,7 @@ public: void setCursorToLine(int ln); void setFileName(QString filename); private: - Highlighter *highlighter; + QSyntaxHighlighter *highlighter; void setup_common(); QString fname; QString tname; |