[clang-tools-extra] r241160 - [clang-tidy] minor coding style tweak. make functions static.

Daniel Marjamaki daniel.marjamaki at evidente.se
Wed Jul 1 06:29:27 PDT 2015


Author: danielmarjamaki
Date: Wed Jul  1 08:29:27 2015
New Revision: 241160

URL: http://llvm.org/viewvc/llvm-project?rev=241160&view=rev
Log:
[clang-tidy] minor coding style tweak. make functions static.

Modified:
    clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp?rev=241160&r1=241159&r2=241160&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp Wed Jul  1 08:29:27 2015
@@ -38,33 +38,33 @@ private:
   Preprocessor *PP;
   MacroParenthesesCheck *Check;
 };
+} // namespace
 
 /// Is argument surrounded properly with parentheses/braces/squares/commas?
-bool isSurroundedLeft(const Token &T) {
+static bool isSurroundedLeft(const Token &T) {
   return T.isOneOf(tok::l_paren, tok::l_brace, tok::l_square, tok::comma,
                    tok::semi);
 }
 
 /// Is argument surrounded properly with parentheses/braces/squares/commas?
-bool isSurroundedRight(const Token &T) {
+static bool isSurroundedRight(const Token &T) {
   return T.isOneOf(tok::r_paren, tok::r_brace, tok::r_square, tok::comma,
                    tok::semi);
 }
 
 /// Is given TokenKind a keyword?
-bool isKeyword(const Token &T) {
+static bool isKeyword(const Token &T) {
   /// \TODO better matching of keywords to avoid false positives
   return T.isOneOf(tok::kw_case, tok::kw_const, tok::kw_struct);
 }
 
 /// Warning is written when one of these operators are not within parentheses.
-bool isWarnOp(const Token &T) {
+static bool isWarnOp(const Token &T) {
   /// \TODO This is an initial list of operators. It can be tweaked later to
   /// get more positives or perhaps avoid some false positive.
   return T.isOneOf(tok::plus, tok::minus, tok::star, tok::slash, tok::percent,
                    tok::amp, tok::pipe, tok::caret);
 }
-}
 
 void MacroParenthesesPPCallbacks::replacementList(const Token &MacroNameTok,
                                                   const MacroInfo *MI) {





More information about the cfe-commits mailing list