Skip to content

Fix clang-tidy warnings/errors #26

@springmeyer

Description

@springmeyer

Since enabling clang-tidy we now have travis job that runs it. To get this travis job passing we'll need to fix these warnings (probably minor, but let's see):

/home/travis/build/mapbox/spatial-algorithms/bench/scaling.cpp:2:1: error: #includes are not sorted properly [llvm-include-order,-warnings-as-errors]
#include <mapbox/geometry.hpp>
^
/home/travis/build/mapbox/spatial-algorithms/bench/scaling.cpp:6:1: error: do not use namespace using-directives; use using-declarations instead [google-build-using-namespace,-warnings-as-errors]
using namespace mapbox::geometry;
^
/home/travis/build/mapbox/spatial-algorithms/bench/scaling.cpp:15:30: error: rand() has limited randomness; use C++11 random library instead [cert-msc30-c,-warnings-as-errors]
        point<double> input{(rand() % 500) / 25.0, (rand() % 500) / 25.0};
                             ^
/home/travis/build/mapbox/spatial-algorithms/bench/scaling.cpp:15:53: error: rand() has limited randomness; use C++11 random library instead [cert-msc30-c,-warnings-as-errors]
        point<double> input{(rand() % 500) / 25.0, (rand() % 500) / 25.0};
                                                    ^

Lots more visible at https://travis-ci.org/mapbox/spatial-algorithms/jobs/339174781#L1021. To see them locally run:

make tidy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions