From 8f1326e02a8fe54c01c2bd85803c7158e2559efb Mon Sep 17 00:00:00 2001 From: Andreas Stallinger Date: Thu, 3 Mar 2016 20:16:20 +0100 Subject: [PATCH] build: clang warning cleanup * unused member in undoredocontroller * int - size_t comparion * virtual destructor ASTVisitor added * braces when && and || in same if * 1 warning left: isNamedDeclUnnamed in ASTVisitor is unused --- src/lib/component/controller/FeatureController.cpp | 4 ++-- src/lib/component/controller/UndoRedoController.cpp | 1 - src/lib/component/controller/UndoRedoController.h | 1 - src/lib/data/Storage.cpp | 2 +- src/lib_parser/data/parser/cxx/ASTVisitor.cpp | 6 ++++-- src/lib_parser/data/parser/cxx/ASTVisitor.h | 4 +--- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/lib/component/controller/FeatureController.cpp b/src/lib/component/controller/FeatureController.cpp index 87048686..50fb4b93 100644 --- a/src/lib/component/controller/FeatureController.cpp +++ b/src/lib/component/controller/FeatureController.cpp @@ -115,8 +115,8 @@ void FeatureController::handleMessage(MessageZoom* message) int maxSize = settings->getFontSizeMax(); int minSize = settings->getFontSizeMin(); - if (fontSize >= maxSize && zoomIn - || fontSize <= minSize && !zoomIn) + if ((fontSize >= maxSize && zoomIn) + || (fontSize <= minSize && !zoomIn)) { return; } diff --git a/src/lib/component/controller/UndoRedoController.cpp b/src/lib/component/controller/UndoRedoController.cpp index b13edeff..2dc7d1cd 100644 --- a/src/lib/component/controller/UndoRedoController.cpp +++ b/src/lib/component/controller/UndoRedoController.cpp @@ -9,7 +9,6 @@ UndoRedoController::UndoRedoController(StorageAccess* storageAccess) : m_activationTranslator(storageAccess) - , m_storageAccess(storageAccess) , m_lastCommand(nullptr, 0) { } diff --git a/src/lib/component/controller/UndoRedoController.h b/src/lib/component/controller/UndoRedoController.h index 722b1bfc..cce664bd 100644 --- a/src/lib/component/controller/UndoRedoController.h +++ b/src/lib/component/controller/UndoRedoController.h @@ -93,7 +93,6 @@ private: bool checkCommandCausesTokenActivation(const Command& command) const; ActivationTranslator m_activationTranslator; - StorageAccess* m_storageAccess; Command m_lastCommand; diff --git a/src/lib/data/Storage.cpp b/src/lib/data/Storage.cpp index 9c874e81..99b30261 100644 --- a/src/lib/data/Storage.cpp +++ b/src/lib/data/Storage.cpp @@ -201,7 +201,7 @@ void Storage::onError(const ParseLocation& location, const std::string& message, m_sqliteStorage.addError(message, fatal, location.filePath.str(), location.startLineNumber, location.startColumnNumber); - if (totalErrorCount != getErrorCount().total) + if ((int)totalErrorCount != getErrorCount().total) { MessageShowErrors msg(getErrorCount()); msg.setSendAsTask(false); diff --git a/src/lib_parser/data/parser/cxx/ASTVisitor.cpp b/src/lib_parser/data/parser/cxx/ASTVisitor.cpp index 76567659..132fe8b9 100644 --- a/src/lib_parser/data/parser/cxx/ASTVisitor.cpp +++ b/src/lib_parser/data/parser/cxx/ASTVisitor.cpp @@ -44,6 +44,10 @@ ASTVisitor::ASTVisitor(clang::ASTContext* context, clang::Preprocessor* preproce m_childContextNameGenerator = std::make_shared(nullptr, m_declNameCache); } +ASTVisitor::~ASTVisitor() +{ +} + bool ASTVisitor::VisitTranslationUnitDecl(clang::TranslationUnitDecl* decl) { //decl->dump(); @@ -860,8 +864,6 @@ bool ASTVisitor::VisitDecl(clang::Decl *d) bool ASTVisitor::VisitTypeLoc(clang::TypeLoc tl) { - clang::TypeLoc::TypeLocClass tlc = tl.getTypeLocClass(); - if (!tl.getAs().isNull()) { const clang::TagTypeLoc &ttl = tl.castAs(); diff --git a/src/lib_parser/data/parser/cxx/ASTVisitor.h b/src/lib_parser/data/parser/cxx/ASTVisitor.h index 745a7a0c..36b5ee42 100644 --- a/src/lib_parser/data/parser/cxx/ASTVisitor.h +++ b/src/lib_parser/data/parser/cxx/ASTVisitor.h @@ -120,10 +120,8 @@ public: std::shared_ptr m_nameCache; }; - - - ASTVisitor(clang::ASTContext* context, clang::Preprocessor* preprocessor, ParserClient* client, FileRegister* fileRegister); + virtual ~ASTVisitor(); // Left for debugging purposes. Uncomment to see a colored ast-dump of the parsed file. virtual bool VisitTranslationUnitDecl(clang::TranslationUnitDecl* decl);