summaryrefslogtreecommitdiff
path: root/src/mbgl/util
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-07-01 11:51:54 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-07-01 12:38:33 +0200
commit77e784675687d13439a8104c97c5bb0a9ccd8b01 (patch)
treeac5fe39c7c1d0db0923fec2b00b56291ef0f548e /src/mbgl/util
parentda863c6e52f656bd35c3d3346093a24d747d0bbd (diff)
downloadqtlocation-mapboxgl-77e784675687d13439a8104c97c5bb0a9ccd8b01.tar.gz
[core] code style cleanups
- puts function definitions in a namespace ... {} rather than using namespace ...; - remove trailing whitespace - add trailing newline - protect SQL statements from being formatted by clang-format
Diffstat (limited to 'src/mbgl/util')
-rw-r--r--src/mbgl/util/mat2.cpp4
-rw-r--r--src/mbgl/util/mat3.cpp4
-rw-r--r--src/mbgl/util/raster.cpp4
-rw-r--r--src/mbgl/util/stopwatch.cpp7
-rw-r--r--src/mbgl/util/version_info.cpp2
5 files changed, 16 insertions, 5 deletions
diff --git a/src/mbgl/util/mat2.cpp b/src/mbgl/util/mat2.cpp
index ca60dce9c5..4fb5abafb8 100644
--- a/src/mbgl/util/mat2.cpp
+++ b/src/mbgl/util/mat2.cpp
@@ -24,7 +24,7 @@
#include <cmath>
-using namespace mbgl;
+namespace mbgl {
void matrix::identity(mat2& out) {
out[0] = 1.0f;
@@ -50,3 +50,5 @@ void matrix::scale(mat2& out, const mat2& a, double v0, double v1) {
out[2] = a2 * v1;
out[3] = a3 * v1;
}
+
+} // namespace mbgl
diff --git a/src/mbgl/util/mat3.cpp b/src/mbgl/util/mat3.cpp
index 88c769790e..e2200867ce 100644
--- a/src/mbgl/util/mat3.cpp
+++ b/src/mbgl/util/mat3.cpp
@@ -24,7 +24,7 @@
#include <cmath>
-using namespace mbgl;
+namespace mbgl {
void matrix::identity(mat3& out) {
out[0] = 1.0f;
@@ -93,3 +93,5 @@ void matrix::scale(mat3& out, const mat3& a, double x, double y) {
out[7] = a[7];
out[8] = a[8];
}
+
+} // namespace mbgl
diff --git a/src/mbgl/util/raster.cpp b/src/mbgl/util/raster.cpp
index fc9cc1c256..b4e838ec00 100644
--- a/src/mbgl/util/raster.cpp
+++ b/src/mbgl/util/raster.cpp
@@ -7,7 +7,7 @@
#include <cassert>
#include <cstring>
-using namespace mbgl;
+namespace mbgl {
bool Raster::isLoaded() const {
std::lock_guard<std::mutex> lock(mtx);
@@ -59,3 +59,5 @@ void Raster::upload(gl::ObjectStore& store) {
img.data.reset();
}
}
+
+} // namespace mbgl
diff --git a/src/mbgl/util/stopwatch.cpp b/src/mbgl/util/stopwatch.cpp
index 8cf0f7fd22..d588b79254 100644
--- a/src/mbgl/util/stopwatch.cpp
+++ b/src/mbgl/util/stopwatch.cpp
@@ -7,7 +7,8 @@
#include <iostream>
#include <atomic>
-using namespace mbgl::util;
+namespace mbgl {
+namespace util {
stopwatch::stopwatch(Event event_)
: event(event_), start(Clock::now()) {}
@@ -33,4 +34,8 @@ stopwatch::~stopwatch() {
report(name);
}
}
+
+} // namespace util
+} // namespace mbgl
+
#endif
diff --git a/src/mbgl/util/version_info.cpp b/src/mbgl/util/version_info.cpp
index c545ddcc40..f0fb139bca 100644
--- a/src/mbgl/util/version_info.cpp
+++ b/src/mbgl/util/version_info.cpp
@@ -11,4 +11,4 @@ const char *string = MBGL_VERSION_STRING;
const unsigned int number = MBGL_VERSION;
} // namespace version
-} // namespace mbgl \ No newline at end of file
+} // namespace mbgl