OSDN Git Service

Change NamedEnum unknow enum string format from hexical to decimal.
[android-x86/frameworks-native.git] / include / input / NamedEnum.h
index 1d987fe..6562348 100644 (file)
@@ -115,7 +115,7 @@ public:
     // Do not specialize it to a large number to avoid performance issues.
     // The recommended maximum enum number to specialize is 64.
     template <typename E>
-    static const std::string string(E val, const char* fallbackFormat = "0x%08x") {
+    static const std::string string(E val, const char* fallbackFormat = "%02d") {
         std::string result;
         std::optional<std::string_view> enumString = enum_name(val);
         result += enumString ? enumString.value() : base::StringPrintf(fallbackFormat, val);