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

Commit 7b1a8c91 authored by Yi Kong's avatar Yi Kong
Browse files

Fix build on ToT Clang

ToT Clang complains about the following error:

frameworks/native/vulkan/vkjson/vkjson.cc:1211:20: error: call to 'ToJsonValue' is ambiguous
 1211 |     object_[key] = ToJsonValue(*value);
      |                    ^~~~~~~~~~~
frameworks/native/vulkan/vkjson/vkjson.cc:1173:20: note: candidate function [with T = char, N = 63]
 1173 | inline Json::Value ToJsonValue(const T (&value)[N]) {
      |                    ^
frameworks/native/vulkan/vkjson/vkjson.cc:1178:20: note: candidate function [with N = 63]
 1178 | inline Json::Value ToJsonValue(const char (&value)[N]) {
      |                    ^

Test: presubmit
Bug: 363682086
Change-Id: Ifa4e8e5df715b1adc99343782a44c8fc302554ae
parent 0c014546
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1169,7 +1169,7 @@ inline Json::Value ArrayToJsonValue(uint32_t count, const T* values) {
  return array;
}

template <typename T, unsigned int N>
template <typename T, size_t N>
inline Json::Value ToJsonValue(const T (&value)[N]) {
  return ArrayToJsonValue(N, value);
}
@@ -1293,7 +1293,7 @@ inline bool AsArray(Json::Value* json_value, uint32_t count, T* values) {
  return true;
}

template <typename T, unsigned int N>
template <typename T, size_t N>
inline bool AsValue(Json::Value* json_value, T (*value)[N]) {
  return AsArray(json_value, N, *value);
}