Modernize the code base to C++11 standards and beyond.
Apply `clang-modernize` (based on Clang 3.6) transformations to the
codebase while making sure to support Clang>=3.4 and GCC>=4.8.
We apply the transformations in parallel to speed up the quite
time consuming process, and use our `clang-format` style file
to automatically format the code respecting our coding conventions.
We use the following self-explanatory transformations:
* AddOverride
* LoopConvert
* PassByValue
* ReplaceAutoPtr
* UseAuto
* UseNullptr
This required a `compile_commands.json` compilation database, e.g.
ccmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1
for CMake or check Bear for a Makefile based solution (or even Ninja).
git ls-files -x '*.cpp|*.h' | \
xargs -I{} -P $(nproc) clang-modernize -p build -final-syntax-check -format -style=file -summary -for-compilers=clang-3.4,gcc-4.8 -include . -exclude third_party {}
Boom!
References:
* http://clang.llvm.org/extra/clang-modernize.html
* http://clang.llvm.org/extra/ModernizerUsage.html
This commit is contained in:
@@ -33,8 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
class extractor
|
||||
{
|
||||
public:
|
||||
extractor(const ExtractorConfig &extractor_config)
|
||||
: config(extractor_config) {}
|
||||
extractor(ExtractorConfig extractor_config) : config(std::move(extractor_config)) {}
|
||||
int run();
|
||||
private:
|
||||
ExtractorConfig config;
|
||||
|
||||
@@ -35,6 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <osrm/coordinate.hpp>
|
||||
#include <utility>
|
||||
|
||||
struct InternalExtractorEdge
|
||||
{
|
||||
@@ -68,18 +69,26 @@ struct InternalExtractorEdge
|
||||
}
|
||||
|
||||
explicit InternalExtractorEdge(NodeID source,
|
||||
NodeID target,
|
||||
NodeID name_id,
|
||||
const WeightData& weight_data,
|
||||
bool forward,
|
||||
bool backward,
|
||||
bool roundabout,
|
||||
bool access_restricted,
|
||||
TravelMode travel_mode,
|
||||
bool is_split)
|
||||
: result(source, target, name_id, 0, forward, backward, roundabout,
|
||||
access_restricted, travel_mode, is_split),
|
||||
weight_data(weight_data)
|
||||
NodeID target,
|
||||
NodeID name_id,
|
||||
WeightData weight_data,
|
||||
bool forward,
|
||||
bool backward,
|
||||
bool roundabout,
|
||||
bool access_restricted,
|
||||
TravelMode travel_mode,
|
||||
bool is_split)
|
||||
: result(source,
|
||||
target,
|
||||
name_id,
|
||||
0,
|
||||
forward,
|
||||
backward,
|
||||
roundabout,
|
||||
access_restricted,
|
||||
travel_mode,
|
||||
is_split),
|
||||
weight_data(std::move(weight_data))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user