Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ce96865 authored by Yiwei Zhang's avatar Yiwei Zhang
Browse files

vkjson: fix the down clamp of report values

std::numeric_limits<double>::min() is the minimum positive value of double,
but we need to clamp to the safe minimum negative double value here.

Bug: 134453786
Test: adb shell cmd gpu vkjson
Change-Id: I7a74f5fd2f48c61c614f70d14ab94a50ecaaad73
parent dcaba1b8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ inline bool IsIntegral(double value) {
// parsing in between C++ and Java, becasue Java json library simply cannot
// handle infinity.
static const double SAFE_DOUBLE_MAX = 0.99 * std::numeric_limits<double>::max();
static const double SAFE_DOUBLE_MIN = 0.99 * std::numeric_limits<double>::min();
static const double SAFE_DOUBLE_MIN = -SAFE_DOUBLE_MAX;

template <typename T> struct EnumTraits;
template <> struct EnumTraits<VkPhysicalDeviceType> {