diff --git a/Application/src/commons/common/gui/IMGUIBase.cpp b/Application/src/commons/common/gui/IMGUIBase.cpp index ac869f5999dc738efd814adde811b6c4936fb200..3cff68eb2a590b2dd6012b29566c4014ff9a9aae 100644 --- a/Application/src/commons/common/gui/IMGUIBase.cpp +++ b/Application/src/commons/common/gui/IMGUIBase.cpp @@ -851,8 +851,8 @@ void PolyFillScanFlood(ImDrawList *draw, std::vector<ImVec2> *poly, ImColor colo ImVec2 fp = poly->at(0); for (size_t i = 0; i < polysize - 1; i++) { - ImVec2 pa = poly->at(i); - ImVec2 pb = poly->at(i+1); + ImVec2 pa = (*poly)[i]; + ImVec2 pb = (*poly)[i+1]; // jump double/dud points if (pa.x == pb.x && pa.y == pb.y) continue; @@ -862,7 +862,7 @@ void PolyFillScanFlood(ImDrawList *draw, std::vector<ImVec2> *poly, ImColor colo // hull, jump the next segment and reset the first-point if ((!jump) && (fp.x == pb.x) && (fp.y == pb.y)) { if (i < polysize - 2) { - fp = poly->at(i + 2); + fp = (*poly)[i + 2]; jump = 1; i++; } diff --git a/Application/src/commons/common/misc/metastring.h b/Application/src/commons/common/misc/metastring.h index 40f57d0f3ce07cb8009e5b8bc5bed3e14866b2d3..7eaaa5c55b9d508fc63899d5e82308b20881ed97 100644 --- a/Application/src/commons/common/misc/metastring.h +++ b/Application/src/commons/common/misc/metastring.h @@ -1077,6 +1077,7 @@ void fail_type(From&& value) { template<typename To, typename From> constexpr To sign_cast(From&& value) { +#ifndef NDEBUG using FromType = typename remove_cvref<From>::type; using ToType = typename remove_cvref<To>::type; @@ -1096,12 +1097,13 @@ constexpr To sign_cast(From&& value) { fail_type<To, From>(std::forward<From>(value)); } } - +#endif return static_cast<To>(std::forward<From>(value)); } template<typename To, typename From> constexpr bool check_narrow_cast(const From& value) { +#ifndef NDEBUG using FromType = typename remove_cvref<From>::type; using ToType = typename remove_cvref<To>::type; @@ -1165,10 +1167,14 @@ constexpr bool check_narrow_cast(const From& value) { #endif return value >= 0 && static_cast<unsigned_t>(value) <= static_cast<unsigned_t>(std::numeric_limits<To>::max()); } +#else + return true; +#endif } template<typename To, typename From> constexpr To narrow_cast(From&& value, struct tag::warn_on_error) { +#ifndef NDEBUG if (!check_narrow_cast<To, From>(value)) { auto vstr = Meta::toStr(value); auto lstr = Meta::toStr(std::numeric_limits<To>::min()); @@ -1178,12 +1184,13 @@ constexpr To narrow_cast(From&& value, struct tag::warn_on_error) { auto fstr = Meta::name<From>(); Warning("Value '%S' in narrowing conversion of %S -> %S is not within limits [%S,%S].", &vstr, &fstr, &tstr, &lstr, &rstr); } - +#endif return static_cast<To>(std::forward<From>(value)); } template<typename To, typename From> constexpr To narrow_cast(From&& value, struct tag::fail_on_error) { +#ifndef NDEBUG if (!check_narrow_cast<To, From>(value)) { auto vstr = Meta::toStr(value); auto lstr = Meta::toStr(std::numeric_limits<To>::min()); @@ -1193,7 +1200,7 @@ constexpr To narrow_cast(From&& value, struct tag::fail_on_error) { auto fstr = Meta::name<From>(); U_EXCEPTION("Value '%S' in narrowing conversion of %S -> %S is not within limits [%S,%S].", &vstr, &fstr, &tstr, &lstr, &rstr); } - +#endif return static_cast<To>(std::forward<From>(value)); }