summaryrefslogtreecommitdiff
path: root/src/mbgl/geometry
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/geometry
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/geometry')
-rw-r--r--src/mbgl/geometry/circle_buffer.cpp4
-rw-r--r--src/mbgl/geometry/debug_font_buffer.cpp4
-rw-r--r--src/mbgl/geometry/elements_buffer.cpp4
-rw-r--r--src/mbgl/geometry/fill_buffer.cpp4
-rw-r--r--src/mbgl/geometry/glyph_atlas.cpp4
-rw-r--r--src/mbgl/geometry/line_atlas.cpp4
-rw-r--r--src/mbgl/geometry/line_buffer.cpp4
7 files changed, 21 insertions, 7 deletions
diff --git a/src/mbgl/geometry/circle_buffer.cpp b/src/mbgl/geometry/circle_buffer.cpp
index 74ccfa8267..cc31fb83bf 100644
--- a/src/mbgl/geometry/circle_buffer.cpp
+++ b/src/mbgl/geometry/circle_buffer.cpp
@@ -4,10 +4,12 @@
#include <climits>
-using namespace mbgl;
+namespace mbgl {
void CircleVertexBuffer::add(vertex_type x, vertex_type y, float ex, float ey) {
vertex_type *vertices = static_cast<vertex_type *>(addElement());
vertices[0] = (x * 2) + ((ex + 1) / 2);
vertices[1] = (y * 2) + ((ey + 1) / 2);
}
+
+} // namespace mbgl
diff --git a/src/mbgl/geometry/debug_font_buffer.cpp b/src/mbgl/geometry/debug_font_buffer.cpp
index 5df67accd6..f64ce8816b 100644
--- a/src/mbgl/geometry/debug_font_buffer.cpp
+++ b/src/mbgl/geometry/debug_font_buffer.cpp
@@ -5,7 +5,7 @@
#include <cmath>
#include <cstring>
-using namespace mbgl;
+namespace mbgl {
void DebugFontBuffer::addText(const char *text, double left, double baseline, double scale) {
uint16_t *coords = nullptr;
@@ -40,3 +40,5 @@ void DebugFontBuffer::addText(const char *text, double left, double baseline, do
left += glyph.width * scale;
}
}
+
+} // namespace mbgl
diff --git a/src/mbgl/geometry/elements_buffer.cpp b/src/mbgl/geometry/elements_buffer.cpp
index 3e2e2794dd..b7d8cb2015 100644
--- a/src/mbgl/geometry/elements_buffer.cpp
+++ b/src/mbgl/geometry/elements_buffer.cpp
@@ -1,6 +1,6 @@
#include <mbgl/geometry/elements_buffer.hpp>
-using namespace mbgl;
+namespace mbgl {
void TriangleElementsBuffer::add(element_type a, element_type b, element_type c) {
element_type *elements = static_cast<element_type *>(addElement());
@@ -14,3 +14,5 @@ void LineElementsBuffer::add(element_type a, element_type b) {
elements[0] = a;
elements[1] = b;
}
+
+} // namespace mbgl
diff --git a/src/mbgl/geometry/fill_buffer.cpp b/src/mbgl/geometry/fill_buffer.cpp
index ee70dfc53b..6cb07ea66a 100644
--- a/src/mbgl/geometry/fill_buffer.cpp
+++ b/src/mbgl/geometry/fill_buffer.cpp
@@ -4,10 +4,12 @@
#include <climits>
-using namespace mbgl;
+namespace mbgl {
void FillVertexBuffer::add(vertex_type x, vertex_type y) {
vertex_type *vertices = static_cast<vertex_type *>(addElement());
vertices[0] = x;
vertices[1] = y;
}
+
+} // namespace mbgl
diff --git a/src/mbgl/geometry/glyph_atlas.cpp b/src/mbgl/geometry/glyph_atlas.cpp
index 37e55c9952..c45a93d24e 100644
--- a/src/mbgl/geometry/glyph_atlas.cpp
+++ b/src/mbgl/geometry/glyph_atlas.cpp
@@ -9,7 +9,7 @@
#include <algorithm>
-using namespace mbgl;
+namespace mbgl {
GlyphAtlas::GlyphAtlas(uint16_t width_, uint16_t height_)
: width(width_),
@@ -197,3 +197,5 @@ void GlyphAtlas::bind(gl::ObjectStore& store) {
MBGL_CHECK_ERROR(glBindTexture(GL_TEXTURE_2D, *texture));
}
}
+
+} // namespace mbgl
diff --git a/src/mbgl/geometry/line_atlas.cpp b/src/mbgl/geometry/line_atlas.cpp
index cf79c874ce..d7ae5b4a60 100644
--- a/src/mbgl/geometry/line_atlas.cpp
+++ b/src/mbgl/geometry/line_atlas.cpp
@@ -9,7 +9,7 @@
#include <sstream>
#include <cmath>
-using namespace mbgl;
+namespace mbgl {
LineAtlas::LineAtlas(GLsizei w, GLsizei h)
: width(w),
@@ -171,3 +171,5 @@ void LineAtlas::bind(gl::ObjectStore& store) {
dirty = false;
}
}
+
+} // namespace mbgl
diff --git a/src/mbgl/geometry/line_buffer.cpp b/src/mbgl/geometry/line_buffer.cpp
index 3d979a2a45..7d2e2eb9a2 100644
--- a/src/mbgl/geometry/line_buffer.cpp
+++ b/src/mbgl/geometry/line_buffer.cpp
@@ -3,7 +3,7 @@
#include <cmath>
-using namespace mbgl;
+namespace mbgl {
GLsizei LineVertexBuffer::add(vertex_type x, vertex_type y, float ex, float ey, bool tx, bool ty, int8_t dir, int32_t linesofar) {
GLsizei idx = index();
@@ -34,3 +34,5 @@ GLsizei LineVertexBuffer::add(vertex_type x, vertex_type y, float ex, float ey,
return idx;
}
+
+} // namespace mbgl