Skip to content

Commit 50ade6c

Browse files
committed
use clang-format
1 parent ab4a534 commit 50ade6c

File tree

7 files changed

+162
-146
lines changed

7 files changed

+162
-146
lines changed

.clang-format

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Standard: Cpp11
2+
IndentWidth: 4
3+
AccessModifierOffset: -4
4+
UseTab: Never
5+
BinPackParameters: false
6+
BinPackArguments: false
7+
AllowShortIfStatementsOnASingleLine: true
8+
AllowShortLoopsOnASingleLine: false
9+
AllowShortBlocksOnASingleLine: true
10+
AllowShortFunctionsOnASingleLine: false
11+
AllowAllParametersOfDeclarationOnNextLine: true
12+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
13+
AlwaysBreakTemplateDeclarations: true
14+
NamespaceIndentation: None
15+
PointerBindsToType: true
16+
SpacesInParentheses: false
17+
BreakBeforeBraces: Attach
18+
ColumnLimit: 0
19+
Cpp11BracedListStyle: false

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ distclean: clean
3838
rm -f local.env
3939

4040
format:
41-
@echo "not implmented"
41+
./scripts/format.sh
4242

4343
.PHONY: test bench

bench/run.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1+
#include "../examples/utils.hpp"
12
#include <benchmark/benchmark.h>
2-
#include <string>
33
#include <delaunator.hpp>
4-
#include "../examples/utils.hpp"
4+
#include <string>
55

66
namespace {
7-
void BM_45K_geojson_nodes(benchmark::State& state)
8-
{
9-
std::string points_str = utils::read_file("./test/test-files/osm-nodes-45331-epsg-3857.geojson");
10-
std::vector<double> coords = utils::get_geo_json_points(points_str);
7+
void BM_45K_geojson_nodes(benchmark::State& state) {
8+
std::string points_str = utils::read_file("./test/test-files/osm-nodes-45331-epsg-3857.geojson");
9+
std::vector<double> coords = utils::get_geo_json_points(points_str);
1110

12-
while (state.KeepRunning())
13-
{
14-
delaunator::Delaunator delaunator(coords);
15-
}
11+
while (state.KeepRunning()) {
12+
delaunator::Delaunator delaunator(coords);
1613
}
1714
}
15+
} // namespace
1816

1917
BENCHMARK(BM_45K_geojson_nodes)->Unit(benchmark::kMillisecond);
2018

examples/utils.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
#pragma once
2+
13
#include <fstream>
24
#include <stdexcept>
5+
#include <string>
6+
#include <vector>
37
#include "rapidjson/document.h"
48

59
namespace utils {

0 commit comments

Comments
 (0)