diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-05-25 21:14:18 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-05-25 21:35:37 +0200 |
commit | e2bcea90fce8a1e05e517c615d21d845e955f53d (patch) | |
tree | 208da7ad0db235a13b5ae6d360279a624e46fb95 /src/mbgl/util | |
parent | 6368403f433cfbfed1547d4167a9836fa2942a97 (diff) | |
download | qtlocation-mapboxgl-e2bcea90fce8a1e05e517c615d21d845e955f53d.tar.gz |
[core] use #pragma once instead of ifdef include guards
Diffstat (limited to 'src/mbgl/util')
35 files changed, 35 insertions, 140 deletions
diff --git a/src/mbgl/util/assert.hpp b/src/mbgl/util/assert.hpp index 0c2f63f8fe..47fc13f94e 100644 --- a/src/mbgl/util/assert.hpp +++ b/src/mbgl/util/assert.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_ASSERT -#define MBGL_UTIL_ASSERT +#pragma once #include <cassert> @@ -9,5 +8,3 @@ ((void)((expr) ? ((void)0) : ((void)fprintf(stderr, "%s:%u: failed assertion `%s'\n", \ __FILE__, __LINE__, #expr), \ abort()))) - -#endif diff --git a/src/mbgl/util/async_task.hpp b/src/mbgl/util/async_task.hpp index ce273c664c..69746c3eb3 100644 --- a/src/mbgl/util/async_task.hpp +++ b/src/mbgl/util/async_task.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_ASYNC_TASK -#define MBGL_UTIL_ASYNC_TASK +#pragma once #include <mbgl/util/noncopyable.hpp> @@ -23,5 +22,3 @@ private: } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/channel.hpp b/src/mbgl/util/channel.hpp index a48156f120..319205b444 100644 --- a/src/mbgl/util/channel.hpp +++ b/src/mbgl/util/channel.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_CHANNEL -#define MBGL_UTIL_CHANNEL +#pragma once #include <mbgl/util/noncopyable.hpp> @@ -35,5 +34,3 @@ private: }; } - -#endif diff --git a/src/mbgl/util/clip_id.hpp b/src/mbgl/util/clip_id.hpp index dd580111cb..064a7acf94 100644 --- a/src/mbgl/util/clip_id.hpp +++ b/src/mbgl/util/clip_id.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_CLIP_IDS -#define MBGL_UTIL_CLIP_IDS +#pragma once #include <bitset> #include <string> @@ -35,5 +34,3 @@ struct ClipID { ::std::ostream& operator<<(::std::ostream& os, const ClipID& rhs); } // namespace mbgl - -#endif diff --git a/src/mbgl/util/clip_lines.hpp b/src/mbgl/util/clip_lines.hpp index a4a5c5fb8a..19ab3ac201 100644 --- a/src/mbgl/util/clip_lines.hpp +++ b/src/mbgl/util/clip_lines.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_CLIP_LINES -#define MBGL_UTIL_CLIP_LINES +#pragma once #include <map> #include <string> @@ -15,5 +14,3 @@ GeometryCollection clipLines(const GeometryCollection &lines, } // end namespace util } // end namespace mbgl - -#endif diff --git a/src/mbgl/util/compression.hpp b/src/mbgl/util/compression.hpp index 2e7a8bbc0c..8f89a3ac03 100644 --- a/src/mbgl/util/compression.hpp +++ b/src/mbgl/util/compression.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_COMPRESSION -#define MBGL_UTIL_COMPRESSION +#pragma once #include <string> @@ -11,5 +10,3 @@ std::string decompress(const std::string &raw); } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/dtoa.hpp b/src/mbgl/util/dtoa.hpp index 00c2c25ce2..17614732db 100644 --- a/src/mbgl/util/dtoa.hpp +++ b/src/mbgl/util/dtoa.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_DTOA -#define MBGL_UTIL_DTOA +#pragma once #include <string> @@ -18,5 +17,3 @@ inline std::string dtoa(double value) { } // end namespace util } // end namespace mbgl - -#endif diff --git a/src/mbgl/util/exclusive.hpp b/src/mbgl/util/exclusive.hpp index bb3395996b..946604af69 100644 --- a/src/mbgl/util/exclusive.hpp +++ b/src/mbgl/util/exclusive.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_EXCLUSIVE -#define MBGL_UTIL_EXCLUSIVE +#pragma once #include <memory> #include <mutex> @@ -26,5 +25,3 @@ private: } // end namespace util } // end namespace mbgl - -#endif diff --git a/src/mbgl/util/http_header.hpp b/src/mbgl/util/http_header.hpp index b5a6403782..8a83356977 100644 --- a/src/mbgl/util/http_header.hpp +++ b/src/mbgl/util/http_header.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_HTTP_HEADER -#define MBGL_UTIL_HTTP_HEADER +#pragma once #include <mbgl/util/optional.hpp> #include <mbgl/util/chrono.hpp> @@ -21,5 +20,3 @@ public: } // namespace http } // namespace mbgl - -#endif diff --git a/src/mbgl/util/intersection_tests.hpp b/src/mbgl/util/intersection_tests.hpp index a6e4308039..a3ffe65cbf 100644 --- a/src/mbgl/util/intersection_tests.hpp +++ b/src/mbgl/util/intersection_tests.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_INTERSECTION_TESTS -#define MBGL_UTIL_INTERSECTION_TESTS +#pragma once #include <mbgl/tile/geometry_tile.hpp> @@ -12,5 +11,3 @@ bool multiPolygonIntersectsMultiPolygon(const GeometryCollection&, const Geometr } } // namespace mbgl - -#endif diff --git a/src/mbgl/util/io.hpp b/src/mbgl/util/io.hpp index 1bcfe56af6..2679eb5360 100644 --- a/src/mbgl/util/io.hpp +++ b/src/mbgl/util/io.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_IO -#define MBGL_UTIL_IO +#pragma once #include <string> #include <stdexcept> @@ -20,5 +19,3 @@ void deleteFile(const std::string& filename); } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/mapbox.hpp b/src/mbgl/util/mapbox.hpp index 56c40df7ca..951cbc5a4b 100644 --- a/src/mbgl/util/mapbox.hpp +++ b/src/mbgl/util/mapbox.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_MAPBOX -#define MBGL_UTIL_MAPBOX +#pragma once #include <string> #include <mbgl/style/types.hpp> @@ -24,5 +23,3 @@ extern const uint64_t DEFAULT_OFFLINE_TILE_COUNT_LIMIT; } // namespace mapbox } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/mat2.hpp b/src/mbgl/util/mat2.hpp index c89088950d..6a25ef0f1e 100644 --- a/src/mbgl/util/mat2.hpp +++ b/src/mbgl/util/mat2.hpp @@ -20,8 +20,7 @@ // // 3. This notice may not be removed or altered from any source distribution. -#ifndef MBGL_UTIL_MAT2 -#define MBGL_UTIL_MAT2 +#pragma once #include <array> @@ -37,5 +36,3 @@ void scale(mat2& out, const mat2& a, double v0, double v1); } // namespace matrix } // namespace mbgl - -#endif diff --git a/src/mbgl/util/mat3.hpp b/src/mbgl/util/mat3.hpp index b0ecb17467..ca4955fe5f 100644 --- a/src/mbgl/util/mat3.hpp +++ b/src/mbgl/util/mat3.hpp @@ -20,8 +20,7 @@ // // 3. This notice may not be removed or altered from any source distribution. -#ifndef MBGL_UTIL_MAT3 -#define MBGL_UTIL_MAT3 +#pragma once #include <array> @@ -38,5 +37,3 @@ void scale(mat3& out, const mat3& a, double x, double y); } // namespace matrix } // namespace mbgl - -#endif diff --git a/src/mbgl/util/mat4.hpp b/src/mbgl/util/mat4.hpp index 80bd912554..2adeba8821 100644 --- a/src/mbgl/util/mat4.hpp +++ b/src/mbgl/util/mat4.hpp @@ -20,8 +20,7 @@ // // 3. This notice may not be removed or altered from any source distribution. -#ifndef MBGL_UTIL_MAT4 -#define MBGL_UTIL_MAT4 +#pragma once #include <array> @@ -48,5 +47,3 @@ void transformMat4(vec4& out, const vec4& a, const mat4& m); } // namespace matrix } // namespace mbgl - -#endif // MBGL_UTIL_MAT4 diff --git a/src/mbgl/util/math.hpp b/src/mbgl/util/math.hpp index f93743f211..ef60f76ffe 100644 --- a/src/mbgl/util/math.hpp +++ b/src/mbgl/util/math.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_MATH -#define MBGL_UTIL_MATH +#pragma once #include <cmath> #include <array> @@ -113,5 +112,3 @@ uint32_t ceil_log2(uint64_t x); } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/merge_lines.hpp b/src/mbgl/util/merge_lines.hpp index 55ad79036e..b1f216148d 100644 --- a/src/mbgl/util/merge_lines.hpp +++ b/src/mbgl/util/merge_lines.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_MERGELINES -#define MBGL_UTIL_MERGELINES +#pragma once #include <map> #include <string> @@ -25,5 +24,3 @@ void mergeLines(std::vector<SymbolFeature> &features); } // end namespace util } // end namespace mbgl - -#endif diff --git a/src/mbgl/util/premultiply.hpp b/src/mbgl/util/premultiply.hpp index f64f3f4555..532c7cb11d 100644 --- a/src/mbgl/util/premultiply.hpp +++ b/src/mbgl/util/premultiply.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_PREMULTIPLY -#define MBGL_UTIL_PREMULTIPLY +#pragma once #include <mbgl/util/image.hpp> @@ -11,5 +10,3 @@ UnassociatedImage unpremultiply(PremultipliedImage&&); } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/ptr.hpp b/src/mbgl/util/ptr.hpp index 7e8f8ecc18..2dc8118181 100644 --- a/src/mbgl/util/ptr.hpp +++ b/src/mbgl/util/ptr.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_PTR -#define MBGL_UTIL_PTR +#pragma once #include <memory> #include <cassert> @@ -25,5 +24,3 @@ public: }; } // namespace util } // namespace mbgl - -#endif
\ No newline at end of file diff --git a/src/mbgl/util/rapidjson.hpp b/src/mbgl/util/rapidjson.hpp index c9aad871d9..7262e8545c 100644 --- a/src/mbgl/util/rapidjson.hpp +++ b/src/mbgl/util/rapidjson.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_RAPIDJSON -#define MBGL_UTIL_RAPIDJSON +#pragma once #include <rapidjson/document.h> #include <rapidjson/error/en.h> @@ -10,5 +9,3 @@ using JSDocument = rapidjson::GenericDocument<rapidjson::UTF8<>, rapidjson::CrtA using JSValue = rapidjson::GenericValue<rapidjson::UTF8<>, rapidjson::CrtAllocator>; } // namespace mbgl - -#endif diff --git a/src/mbgl/util/raster.hpp b/src/mbgl/util/raster.hpp index 0a275a197c..8eef8d6c75 100644 --- a/src/mbgl/util/raster.hpp +++ b/src/mbgl/util/raster.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_RASTER -#define MBGL_UTIL_RASTER +#pragma once #include <mbgl/gl/gl.hpp> #include <mbgl/gl/texture_pool.hpp> @@ -60,5 +59,3 @@ private: }; } // namespace mbgl - -#endif diff --git a/src/mbgl/util/rect.hpp b/src/mbgl/util/rect.hpp index 1dc8cb8af9..2b877db40d 100644 --- a/src/mbgl/util/rect.hpp +++ b/src/mbgl/util/rect.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_RECT -#define MBGL_UTIL_RECT +#pragma once namespace mbgl { @@ -23,5 +22,3 @@ struct Rect { inline bool hasArea() const { return w != 0 && h != 0; } }; } // namespace mbgl - -#endif diff --git a/src/mbgl/util/std.hpp b/src/mbgl/util/std.hpp index bab5c1494d..974e21329c 100644 --- a/src/mbgl/util/std.hpp +++ b/src/mbgl/util/std.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_STD -#define MBGL_UTIL_STD +#pragma once #include <memory> #include <type_traits> @@ -26,5 +25,3 @@ void erase_if(Container &container, Predicate pred) { } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/stopwatch.hpp b/src/mbgl/util/stopwatch.hpp index a79ad92617..23086b1747 100644 --- a/src/mbgl/util/stopwatch.hpp +++ b/src/mbgl/util/stopwatch.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_STOPWATCH -#define MBGL_UTIL_STOPWATCH +#pragma once #include <mbgl/platform/event.hpp> #include <mbgl/util/chrono.hpp> @@ -37,5 +36,3 @@ class stopwatch { #endif } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/thread.hpp b/src/mbgl/util/thread.hpp index d54d998ab4..9efd5ea92f 100644 --- a/src/mbgl/util/thread.hpp +++ b/src/mbgl/util/thread.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_THREAD -#define MBGL_UTIL_THREAD +#pragma once #include <future> #include <thread> @@ -140,5 +139,3 @@ Thread<Object>::~Thread() { } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/thread_context.hpp b/src/mbgl/util/thread_context.hpp index 9c00ef25cf..60b32b3b2a 100644 --- a/src/mbgl/util/thread_context.hpp +++ b/src/mbgl/util/thread_context.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_THREAD_CONTEXT -#define MBGL_UTIL_THREAD_CONTEXT +#pragma once #include <string> @@ -21,5 +20,3 @@ public: } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/thread_local.hpp b/src/mbgl/util/thread_local.hpp index 5405037358..c3364c5d42 100644 --- a/src/mbgl/util/thread_local.hpp +++ b/src/mbgl/util/thread_local.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_THREAD_LOCAL -#define MBGL_UTIL_THREAD_LOCAL +#pragma once #include <mbgl/util/noncopyable.hpp> @@ -55,5 +54,3 @@ private: } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/tile_cover.hpp b/src/mbgl/util/tile_cover.hpp index aab96c8436..2d32d8bf41 100644 --- a/src/mbgl/util/tile_cover.hpp +++ b/src/mbgl/util/tile_cover.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_TILE_COVER -#define MBGL_UTIL_TILE_COVER +#pragma once #include <mbgl/tile/tile_id.hpp> #include <mbgl/style/types.hpp> @@ -21,5 +20,3 @@ std::vector<UnwrappedTileID> tileCover(const LatLngBounds&, int32_t z); } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/token.hpp b/src/mbgl/util/token.hpp index 722b08f773..149661e47e 100644 --- a/src/mbgl/util/token.hpp +++ b/src/mbgl/util/token.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_TOKEN -#define MBGL_UTIL_TOKEN +#pragma once #include <map> #include <string> @@ -40,5 +39,3 @@ std::string replaceTokens(const std::string &source, const Lookup &lookup) { } // end namespace util } // end namespace mbgl - -#endif diff --git a/src/mbgl/util/transition.hpp b/src/mbgl/util/transition.hpp index a947a9ad18..8176c6895a 100644 --- a/src/mbgl/util/transition.hpp +++ b/src/mbgl/util/transition.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_TRANSITION -#define MBGL_UTIL_TRANSITION +#pragma once #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/chrono.hpp> @@ -74,5 +73,3 @@ private: } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/url.hpp b/src/mbgl/util/url.hpp index 8baa94be1d..b9c66261df 100644 --- a/src/mbgl/util/url.hpp +++ b/src/mbgl/util/url.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_URL -#define MBGL_UTIL_URL +#pragma once #include <string> @@ -12,5 +11,3 @@ std::string percentDecode(const std::string&); } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/utf.hpp b/src/mbgl/util/utf.hpp index 286036c094..02aabfc4c2 100644 --- a/src/mbgl/util/utf.hpp +++ b/src/mbgl/util/utf.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_UTF -#define MBGL_UTIL_UTF +#pragma once #include <memory> @@ -20,5 +19,3 @@ class utf8_to_utf32 { } // namespace mbgl } // namespace util - -#endif diff --git a/src/mbgl/util/variant.hpp b/src/mbgl/util/variant.hpp index cf8e578591..68a1208a17 100644 --- a/src/mbgl/util/variant.hpp +++ b/src/mbgl/util/variant.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_VARIANT -#define MBGL_UTIL_VARIANT +#pragma once #include <mapbox/variant.hpp> @@ -9,5 +8,3 @@ template <typename... T> using variant = mapbox::util::variant<T...>; } // namespace mbgl - -#endif diff --git a/src/mbgl/util/work_queue.hpp b/src/mbgl/util/work_queue.hpp index 788cfb4d2d..3f6328fb57 100644 --- a/src/mbgl/util/work_queue.hpp +++ b/src/mbgl/util/work_queue.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_WORK_QUEUE -#define MBGL_UTIL_WORK_QUEUE +#pragma once #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/async_request.hpp> @@ -39,5 +38,3 @@ private: } // namespace util } // namespace mbgl - -#endif diff --git a/src/mbgl/util/worker.hpp b/src/mbgl/util/worker.hpp index ee237b6aeb..e07b8b8b44 100644 --- a/src/mbgl/util/worker.hpp +++ b/src/mbgl/util/worker.hpp @@ -1,5 +1,4 @@ -#ifndef MBGL_UTIL_WORKER -#define MBGL_UTIL_WORKER +#pragma once #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/thread.hpp> @@ -61,5 +60,3 @@ private: std::size_t current = 0; }; } // namespace mbgl - -#endif |