From 6a9f24ac29bd42561d4c1750b0131551b09eae19 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 15 Apr 2016 09:42:49 +0200 Subject: [PATCH] Removed unneeded const return qualifiers, replaced a couple old c-casts, and updated FindLibClang.cmake --- cmake/Modules/FindLibClang.cmake | 6 +++++- src/Cursor.cc | 4 ++-- src/Cursor.h | 2 +- src/Token.cc | 4 ++-- src/Token.h | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cmake/Modules/FindLibClang.cmake b/cmake/Modules/FindLibClang.cmake index 38efd25..23ec229 100644 --- a/cmake/Modules/FindLibClang.cmake +++ b/cmake/Modules/FindLibClang.cmake @@ -14,7 +14,11 @@ # Known LLVM release numbers. # most recent versions come first -set(LIBCLANG_KNOWN_LLVM_VERSIONS 3.7 +set(LIBCLANG_KNOWN_LLVM_VERSIONS 3.9 + 3.8.1 + 3.8 + 3.7.1 + 3.7 3.6.2 3.6.1 3.6 diff --git a/src/Cursor.cc b/src/Cursor.cc index 1bc2081..8ed74de 100644 --- a/src/Cursor.cc +++ b/src/Cursor.cc @@ -2,8 +2,8 @@ #include "Utility.h" #include -const clang::CursorKind clang::Cursor::get_kind() { - return (CursorKind) clang_getCursorKind(this->cx_cursor); +clang::CursorKind clang::Cursor::get_kind() { + return static_cast(clang_getCursorKind(this->cx_cursor)); } clang::SourceLocation clang::Cursor::get_source_location() const { diff --git a/src/Cursor.h b/src/Cursor.h index 2b410d7..b395183 100644 --- a/src/Cursor.h +++ b/src/Cursor.h @@ -177,7 +177,7 @@ namespace clang { class Cursor { public: Cursor(const CXCursor &cx_cursor) : cx_cursor(cx_cursor) {} - const CursorKind get_kind(); + CursorKind get_kind(); SourceLocation get_source_location() const; SourceRange get_source_range() const; std::string get_spelling() const; diff --git a/src/Token.cc b/src/Token.cc index 372616c..95be709 100644 --- a/src/Token.cc +++ b/src/Token.cc @@ -20,6 +20,6 @@ std::string clang::Token::get_spelling() { return clang::to_string(clang_getTokenSpelling(cx_tu, cx_token)); } -const clang::TokenKind clang::Token::get_kind() { - return (TokenKind) clang_getTokenKind(cx_token); +clang::TokenKind clang::Token::get_kind() { + return static_cast(clang_getTokenKind(cx_token)); } diff --git a/src/Token.h b/src/Token.h index 0dd957b..e212961 100644 --- a/src/Token.h +++ b/src/Token.h @@ -20,7 +20,7 @@ namespace clang { Token(CXTranslationUnit &cx_tu, CXToken &cx_token, CXCursor &cx_cursor): cx_tu(cx_tu), cx_token(cx_token), cx_cursor(cx_cursor), offsets(get_source_range().get_offsets()) {}; public: - const TokenKind get_kind(); + TokenKind get_kind(); std::string get_spelling(); SourceLocation get_source_location(); SourceRange get_source_range();