From 7d37a4f65e2d5922da6161d8bb5ce664cc5cabcc Mon Sep 17 00:00:00 2001 From: Anush Nadathur Date: Mon, 26 Feb 2024 17:52:51 -0800 Subject: [PATCH] Fix MTRMetricsCollector.mm build failure using clang - Missing static_cast to int for enum class in a format string --- src/darwin/Framework/CHIP/MTRMetricsCollector.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRMetricsCollector.mm b/src/darwin/Framework/CHIP/MTRMetricsCollector.mm index 6387738a7c13c8..e829c57f486729 100644 --- a/src/darwin/Framework/CHIP/MTRMetricsCollector.mm +++ b/src/darwin/Framework/CHIP/MTRMetricsCollector.mm @@ -193,19 +193,19 @@ - (void)handleMetricEvent:(MetricEvent)event using ValueType = MetricEvent::Value::Type; switch (event.ValueType()) { case ValueType::kInt32: - MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: %d", event.key(), event.type(), event.ValueInt32()); + MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: %d", event.key(), static_cast(event.type()), event.ValueInt32()); break; case ValueType::kUInt32: - MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: %u", event.key(), event.type(), event.ValueUInt32()); + MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: %u", event.key(), static_cast(event.type()), event.ValueUInt32()); break; case ValueType::kChipErrorCode: - MTR_LOG_INFO("Received metric event, key: %s, type: %d, error value: %u", event.key(), event.type(), event.ValueErrorCode()); + MTR_LOG_INFO("Received metric event, key: %s, type: %d, error value: %u", event.key(), static_cast(event.type()), event.ValueErrorCode()); break; case ValueType::kUndefined: - MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: nil", event.key(), event.type()); + MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: nil", event.key(), static_cast(event.type())); break; default: - MTR_LOG_INFO("Received metric event, key: %s, type: %d, unknown value", event.key(), event.type()); + MTR_LOG_INFO("Received metric event, key: %s, type: %d, unknown value", event.key(), static_cast(event.type())); return; }