]> git.siccegge.de Git - frida/frida.git/commitdiff
Use -Wextra and be -Wextra-clean
authorChristoph Egger <Christoph.Egger@cs.fau.de>
Tue, 3 Mar 2015 19:15:18 +0000 (20:15 +0100)
committerChristoph Egger <Christoph.Egger@cs.fau.de>
Tue, 3 Mar 2015 19:15:18 +0000 (20:15 +0100)
CMakeLists.txt
src/disassembler/Disassembler.hxx
src/disassembler/llvm/LLVMDisassembler.cxx
src/disassembler/llvm/LLVMDisassembler.hxx
src/gui/Mainwindow.cxx
src/gui/dialogs/SimpleStringDialog.cxx
src/gui/widgets/BasicBlockWidget.cxx
src/gui/widgets/ScriptingDock.cxx

index f309be772d5e2970f7ca5b40ab2542d29ce79256..7b8663434be6b35fe27badfd74ac85a01d69e8b5 100644 (file)
@@ -34,10 +34,11 @@ string(REPLACE -O2 "" LLVM_CFLAGS ${LLVM_CFLAGS})
 string(REPLACE -fno-exceptions "" LLVM_CFLAGS ${LLVM_CFLAGS})
 string(REPLACE -fno-rtti "" LLVM_CFLAGS ${LLVM_CFLAGS})
 string(REPLACE -DNDEBUG "" LLVM_CFLAGS ${LLVM_CFLAGS})
+string(REPLACE -I "-isystem" LLVM_CFLAGS ${LLVM_CFLAGS})
 
 separate_arguments(LLVM_CFLAGS)
 add_definitions(${LLVM_CFLAGS})
-add_definitions(-std=c++11 -Wall)
+add_definitions(-std=c++11 -Wall -Wextra)
 add_definitions(-DQT_NO_KEYWORDS)
 
 separate_arguments(LLVM_LDFLAGS)
index 776796a8dc22e230201a2cc9f775a284d0cb756f..fe240a93c46eae6798d32e6817cea66ab051a09c 100644 (file)
@@ -10,7 +10,7 @@ class InformationManager;
 
 class Disassembler {
 public:
-       Disassembler(const std::string& filename, InformationManager* manager) {}
+       Disassembler() {}
        virtual ~Disassembler() {}
 
        virtual void start() = 0;
@@ -21,9 +21,6 @@ public:
                                          std::function<void (uint8_t*, size_t, const std::string&,
                                                              const std::string&)> fun) = 0;
        virtual Function * disassembleFunctionAt(uint64_t address, const std::string& name = "") = 0;
-protected:
-       virtual bool isFunctionCall(uint64_t address) = 0;
-       virtual bool isJump(uint64_t address) = 0;
 };
 
 #endif
index aeca994c1339c6c72964f334a15746d252abdc22..abfafa48e61d566de36c3b8879c555de84290561 100644 (file)
@@ -48,7 +48,7 @@ template <typename ELFT>
 LLVMDisassembler<ELFT>::LLVMDisassembler(const std::string& filename,
                                          InformationManager* manager,
                                          ELFObjectFile<ELFT>* file)
-       : Disassembler(filename, manager)
+       : Disassembler()
        , logger(log4cxx::Logger::getLogger("LLVMDisassembler"))
        , triple("unknown-unknown-unknown")
        , manager(manager)
index d00381b7ed962862c8be6e26008cdf94d06f9da8..6c55b44d5d855e2ee8ea19ace28940c9da7a4629 100644 (file)
@@ -32,10 +32,6 @@ public:
 
        Function * disassembleFunctionAt(uint64_t address, const std::string& name = "");
 
-protected:
-       bool isFunctionCall(uint64_t address) {return false;}
-       bool isJump(uint64_t address) {return false;}
-
 private:
        typedef llvm::object::ELFFile<ELFT> ELFO;
 
index 47ab2a3eda39b0447d26c3259e351546302e474e..0c08892642dd760b4f5e611254e9c8c67de2467e 100644 (file)
@@ -116,7 +116,7 @@ void Mainwindow::switchMainPlaneToAddress(uint64_t address) {
        }
 }
 
-void Mainwindow::switchMainPlane(int index) {
+void Mainwindow::switchMainPlane(int) {
        stackedWidget->setCurrentWidget(objects_list[listWidget->currentItem()]);
 }
 
index 8bea6e916f12bdafcac2cadb3a2cea4dd2c44770..0adb71e4f821f2d50ce0e6c9f488bf1665f2f069 100644 (file)
@@ -20,7 +20,6 @@ SimpleStringDialog::SimpleStringDialog(const QString& title) {
 }
 
 QString SimpleStringDialog::result() {
-       bool ok;
        QString result = edit->text();
        return result;
 }
index 1f34255343aafbf12d2d80c1e2d2169b83b31a87..908c85e8c31c63f4833ce663550cb8f2a7f9b7e1 100644 (file)
@@ -154,8 +154,8 @@ void BasicBlockWidget::addItem(uint8_t* bytes, size_t num_bytes,
        _table->cellAt(row, 1).firstCursorPosition().insertHtml(line);
 }
 
-void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
-                  QWidget *widget) {
+void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem*,
+                  QWidget*) {
        width = 10 + _widget->boundingRect().width();
        height = 25 + _widget->boundingRect().height();
        if (width < 250) width = 250;
index 86bc7665e6c7b6ec4041912c706f989e48e1cc8a..ce00030473be583013b5fc2eac81a9dbd8ec2591 100644 (file)
@@ -1,7 +1,7 @@
 #include "ScriptingDock.hxx"
 
 namespace {
-       SCM handler (void *data, SCM tag, SCM throw_args) {
+       SCM handler (void*, SCM tag, SCM throw_args) {
                scm_handle_by_message_noexit ((void*)"foo", tag, throw_args);
                return SCM_BOOL_F;
        }