1. 20 3月, 2019 1 次提交
  2. 01 3月, 2019 5 次提交
  3. 24 1月, 2019 2 次提交
  4. 21 1月, 2019 2 次提交
  5. 18 1月, 2019 8 次提交
  6. 16 1月, 2019 8 次提交
    • H
      STYLE: Avoid unnecessary conversions from size_t to unsigned int · 21a41856
      Hans Johnson 提交于
      Make the index values consistent with size_t.
      21a41856
    • H
      STYLE: Pefer = delete to explicitly trivial implementations · d1173204
      Hans Johnson 提交于
      This check replaces undefined special member functions with
      = delete;. The explicitly deleted function declarations enable more
      opportunities in optimization, because the compiler might treat
      explicitly delted functions as noops.
      
      Additionally, the C++11 use of = delete more clearly expreses the
      intent for the special member functions.
      
      SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
      BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD
      
      cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
      run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-equals-delete  -header-filter=.* -fix
      d1173204
    • H
      STYLE: Pefer = default to explicitly trivial implementations · e3e05c70
      Hans Johnson 提交于
      This check replaces default bodies of special member functions with
      = default;. The explicitly defaulted function declarations enable more
      opportunities in optimization, because the compiler might treat
      explicitly defaulted functions as trivial.
      
      Additionally, the C++11 use of = default more clearly expreses the
      intent for the special member functions.
      
      SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
      BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD
      
      cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
      run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-equals-default  -header-filter=.* -fix
      e3e05c70
    • H
      STYLE: Use default member initialization · e817e4fc
      Hans Johnson 提交于
      Converts a default constructor’s member initializers into the new
      default member initializers in C++11. Other member initializers that match the
      default member initializer are removed. This can reduce repeated code or allow
      use of ‘= default’.
      
      SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
      BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD
      
      cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
      run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-default-member-init  -header-filter=.* -fix
      e817e4fc
    • H
      PERF: Allow compiler to choose best way to construct a copy · b5093e81
      Hans Johnson 提交于
      With move semantics added to the language and the standard library updated with
      move constructors added for many types it is now interesting to take an
      argument directly by value, instead of by const-reference, and then copy. This
      check allows the compiler to take care of choosing the best way to construct
      the copy.
      
      The transformation is usually beneficial when the calling code passes an rvalue
      and assumes the move construction is a cheap operation. This short example
      illustrates how the construction of the value happens:
      
      SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
      BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD
      
      cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
      run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-pass-by-value  -header-filter=.* -fix
      b5093e81
    • H
      STYLE: Use auto for variable type matches the type of the initializer expression · 1fc3de7c
      Hans Johnson 提交于
      This check is responsible for using the auto type specifier for variable
      declarations to improve code readability and maintainability.
      
      The auto type specifier will only be introduced in situations where the
      variable type matches the type of the initializer expression. In other words
      auto should deduce the same type that was originally spelled in the source
      
      SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
      BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD
      
      cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
      run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-auto -header-filter = .* -fix
      1fc3de7c
    • H
      STYLE: Use range-based loops from C++11 · cbeed7b0
      Hans Johnson 提交于
      C++11 Range based for loops can be used in
      
      Used as a more readable equivalent to the traditional for loop operating over a
      range of values, such as all elements in a container, in the forward direction..
      
      Range based loopes are more explicit for only computing the
      end location once for containers.
      
      SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
      BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD
      
      cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
      run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-loop-convert  -header-filter=.* -fix
      cbeed7b0
    • H
      PERF: readability container size empty · 3beadff4
      Hans Johnson 提交于
      The emptiness of a container should be checked using the empty() method
      instead of the size() method. It is not guaranteed that size() is a
      constant-time function, and it is generally more efficient and also
      shows clearer intent to use empty(). Furthermore some containers may
      implement the empty() method but not implement the size() method. Using
      empty() whenever possible makes it easier to switch to another container
      in the future.
      
      SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
      BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD
      
      cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
      run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,readability-container-size-empty  -header-filter=.* -fix
      3beadff4
  7. 15 1月, 2019 8 次提交
  8. 13 1月, 2019 3 次提交
  9. 12 1月, 2019 2 次提交
  10. 31 12月, 2018 1 次提交
    • F
      fiexd “Cannot take the address of a bit field.” · 7d16e101
      fangguo 提交于
      
      ```c++
       #include <iostream>
      
      class TestBool
      {
      public:
          TestBool():addChildValues_(){}
          TestBool(int):addChildValues_(false){}
          bool addChildValues_ : 1;
          bool indented_ : 1;
      };
      
      
      int main()
      {
          std::cout << "\n TestBool () addChildValues_ = " << TestBool().addChildValues_;
          std::cout << "\n TestBool false addChildValues_ = " << TestBool(3).addChildValues_;
          return 0;
      }
      ```
      
      ```text
      root@osssvr-1 # /opt/SUNWspro/prod/bin/CC  testbool.cpp -o testbool   
      Error: Cannot take the address of a bit field.
      1 Error(s) detected.
      ```
      7d16e101