monitor: Remove use of nlohmann::json::get_ptr()
A new version of nlohmann JSON changed how it handles get_ptr and may
not return anything if it's asked for a signed value but internally the
value is unsigned. Instead just use get<>() which doesn't have that
issue.
Tested:
Fan monitor still works, though there is no JSON available right now
that would force a code path that uses this.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I1ba0b66652e4f920d3253827aaa921601c48d1c7
diff --git a/monitor/types.hpp b/monitor/types.hpp
index b5848f5..dceb4da 100644
--- a/monitor/types.hpp
+++ b/monitor/types.hpp
@@ -58,27 +58,27 @@
const std::string& type = "")
{
PropertyValue value;
- if (auto boolPtr = entry.get_ptr<const bool*>())
+ if (entry.is_boolean())
{
if (type.empty() || type == "bool")
{
- value = *boolPtr;
+ value = entry.get<bool>();
return value;
}
}
- if (auto int64Ptr = entry.get_ptr<const int64_t*>())
+ if (entry.is_number_integer())
{
if (type.empty() || type == "int64_t")
{
- value = *int64Ptr;
+ value = entry.get<int64_t>();
return value;
}
}
- if (auto stringPtr = entry.get_ptr<const std::string*>())
+ if (entry.is_string())
{
if (type.empty() || type == "std::string")
{
- value = *stringPtr;
+ value = entry.get<std::string>();
return value;
}
}