From 7d16824fda7086fbeb0a1deae3fc0abdf0c4832d Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 30 Nov 2016 10:17:47 -0800 Subject: [core] Functions must have at least one stop This is already enforced by the style validator in mapbox-gl-style-spec. Enforce it here too. --- src/mbgl/style/property_evaluator.cpp | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/mbgl/style/property_evaluator.cpp b/src/mbgl/style/property_evaluator.cpp index c19f722100..bfebc38728 100644 --- a/src/mbgl/style/property_evaluator.cpp +++ b/src/mbgl/style/property_evaluator.cpp @@ -10,30 +10,6 @@ namespace mbgl { namespace style { -template -T defaultStopsValue(); - -template <> bool defaultStopsValue() { return true; } -template <> float defaultStopsValue() { return 1.0f; } -template <> Color defaultStopsValue() { return { 0, 0, 0, 1 }; } -template <> std::vector defaultStopsValue() { return {{ 1, 0 }}; } -template <> std::vector defaultStopsValue() { return {{}}; } -template <> std::array defaultStopsValue() { return {{ 0, 0 }}; } -template <> std::array defaultStopsValue() { return {{ 0, 0, 0, 0 }}; } - -template <> std::string defaultStopsValue() { return {}; } -template <> TranslateAnchorType defaultStopsValue() { return {}; } -template <> RotateAnchorType defaultStopsValue() { return {}; } -template <> CirclePitchScaleType defaultStopsValue() { return {}; } -template <> LineCapType defaultStopsValue() { return {}; } -template <> LineJoinType defaultStopsValue() { return {}; } -template <> SymbolPlacementType defaultStopsValue() { return {}; } -template <> TextAnchorType defaultStopsValue() { return {}; } -template <> TextJustifyType defaultStopsValue() { return {}; } -template <> TextTransformType defaultStopsValue() { return {}; } -template <> AlignmentType defaultStopsValue() { return {}; } -template <> IconTextFitType defaultStopsValue() { return {}; }; - template T PropertyEvaluator::operator()(const Function& fn) const { float base = fn.getBase(); @@ -80,7 +56,8 @@ T PropertyEvaluator::operator()(const Function& fn) const { return smaller_val; } else { // No stop defined. - return defaultStopsValue(); + assert(false); + return T(); } } -- cgit v1.2.1