Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang tidy #1286

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Clang tidy #1286

wants to merge 4 commits into from

Commits on Jan 16, 2021

  1. Dump all compile commands to compile_commands.json

    This is in addition to generating Makefiles or Ninja files. It can be
    used by various LLVM tooling like clang-tidy or YouCompleteMe
    uqs committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    2d9d02b View commit details
    Browse the repository at this point in the history
  2. Fix clang-tidy string performance warning

    Ran: clang-tidy -p . -header-filter=".*" "-checks=-*,performance-inefficient-string-concatenation" -fix **/*.cpp
    
    To solve: warning: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation]
    uqs committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    7eabd60 View commit details
    Browse the repository at this point in the history
  3. Apply clang-tidy fixes for performance-type-promotion-in-math-fn

    floor(3) as used previously is the libc floor, which takes a double
    always, so the cast to float is superfluous. floorf(3) would take a
    float argument, but instead of switching to that, use std::floor which
    has the proper overload for double/float, and as of C++11 also has one
    for integral types, so use that directly.
    
    The clang-tidy fixes were massaged manually, as it wasn't quite as
    smart.
    uqs committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    36282f5 View commit details
    Browse the repository at this point in the history
  4. Apply clang-tidy fixes performance-unnecessary-value-param

    The fixes that added std::move (C++11 only) were manually reverted
    again. This sprinkles a ton of const refs all over the place, obviating
    the need to copy-construct Position all the time.
    uqs committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    818be03 View commit details
    Browse the repository at this point in the history