summaryrefslogtreecommitdiff
path: root/include/mbgl/util
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/util')
-rw-r--r--include/mbgl/util/color.hpp6
-rw-r--r--include/mbgl/util/exception.hpp16
-rw-r--r--include/mbgl/util/projection.hpp6
-rw-r--r--include/mbgl/util/range.hpp4
4 files changed, 16 insertions, 16 deletions
diff --git a/include/mbgl/util/color.hpp b/include/mbgl/util/color.hpp
index 6491f75801..4be380fde3 100644
--- a/include/mbgl/util/color.hpp
+++ b/include/mbgl/util/color.hpp
@@ -20,15 +20,15 @@ public:
static optional<Color> parse(const std::string&);
};
-inline bool operator==(const Color& colorA, const Color& colorB) {
+constexpr bool operator==(const Color& colorA, const Color& colorB) {
return colorA.r == colorB.r && colorA.g == colorB.g && colorA.b == colorB.b && colorA.a == colorB.a;
}
-inline bool operator!=(const Color& colorA, const Color& colorB) {
+constexpr bool operator!=(const Color& colorA, const Color& colorB) {
return !(colorA == colorB);
}
-inline Color operator*(const Color& color, float alpha) {
+constexpr Color operator*(const Color& color, float alpha) {
return {
color.r * alpha,
color.g * alpha,
diff --git a/include/mbgl/util/exception.hpp b/include/mbgl/util/exception.hpp
index b73a94fcd2..7c331636d4 100644
--- a/include/mbgl/util/exception.hpp
+++ b/include/mbgl/util/exception.hpp
@@ -6,23 +6,23 @@ namespace mbgl {
namespace util {
struct Exception : std::runtime_error {
- inline Exception(const char *msg) : std::runtime_error(msg) {}
- inline Exception(const std::string &msg) : std::runtime_error(msg) {}
+ Exception(const char *msg) : std::runtime_error(msg) {}
+ Exception(const std::string &msg) : std::runtime_error(msg) {}
};
struct SpriteImageException : Exception {
- inline SpriteImageException(const char *msg) : Exception(msg) {}
- inline SpriteImageException(const std::string &msg) : Exception(msg) {}
+ SpriteImageException(const char *msg) : Exception(msg) {}
+ SpriteImageException(const std::string &msg) : Exception(msg) {}
};
struct MisuseException : Exception {
- inline MisuseException(const char *msg) : Exception(msg) {}
- inline MisuseException(const std::string &msg) : Exception(msg) {}
+ MisuseException(const char *msg) : Exception(msg) {}
+ MisuseException(const std::string &msg) : Exception(msg) {}
};
struct ShaderException : Exception {
- inline ShaderException(const char *msg) : Exception(msg) {}
- inline ShaderException(const std::string &msg) : Exception(msg) {}
+ ShaderException(const char *msg) : Exception(msg) {}
+ ShaderException(const std::string &msg) : Exception(msg) {}
};
} // namespace util
diff --git a/include/mbgl/util/projection.hpp b/include/mbgl/util/projection.hpp
index 76c60f5cd8..eb45088580 100644
--- a/include/mbgl/util/projection.hpp
+++ b/include/mbgl/util/projection.hpp
@@ -11,14 +11,14 @@ namespace mbgl {
class Projection {
public:
- static inline double getMetersPerPixelAtLatitude(double lat, double zoom) {
+ static double getMetersPerPixelAtLatitude(double lat, double zoom) {
const double constrainedZoom = util::clamp(zoom, util::MIN_ZOOM, util::MAX_ZOOM);
const double mapPixelWidthAtZoom = std::pow(2.0, constrainedZoom) * util::tileSize;
const double constrainedLatitude = util::clamp(lat, -util::LATITUDE_MAX, util::LATITUDE_MAX);
return std::cos(constrainedLatitude * util::DEG2RAD) * util::M2PI * util::EARTH_RADIUS_M / mapPixelWidthAtZoom;
}
- static inline ProjectedMeters projectedMetersForLatLng(const LatLng& latLng) {
+ static ProjectedMeters projectedMetersForLatLng(const LatLng& latLng) {
const double constrainedLatitude = util::clamp(latLng.latitude, -util::LATITUDE_MAX, util::LATITUDE_MAX);
const double constrainedLongitude = util::clamp(latLng.longitude, -util::LONGITUDE_MAX, util::LONGITUDE_MAX);
@@ -31,7 +31,7 @@ public:
return ProjectedMeters(northing, easting);
}
- static inline LatLng latLngForProjectedMeters(const ProjectedMeters& projectedMeters) {
+ static LatLng latLngForProjectedMeters(const ProjectedMeters& projectedMeters) {
double latitude = (2 * std::atan(std::exp(projectedMeters.northing / util::EARTH_RADIUS_M)) - (M_PI / 2)) * util::RAD2DEG;
double longitude = projectedMeters.easting * util::RAD2DEG / util::EARTH_RADIUS_M;
diff --git a/include/mbgl/util/range.hpp b/include/mbgl/util/range.hpp
index d04164afb7..8da2dd45bb 100644
--- a/include/mbgl/util/range.hpp
+++ b/include/mbgl/util/range.hpp
@@ -13,12 +13,12 @@ public:
};
template <class T>
-inline bool operator==(const Range<T>& a, const Range<T>& b) {
+bool operator==(const Range<T>& a, const Range<T>& b) {
return a.min == b.min && a.max == b.max;
}
template <class T>
-inline bool operator!=(const Range<T>& a, const Range<T>& b) {
+bool operator!=(const Range<T>& a, const Range<T>& b) {
return !(a == b);
}