Skip to content

Commit a2d98f8

Browse files
authored
Fix MTRMetricsCollector.mm build failure using clang (project-chip#32330)
- Missing static_cast to int for enum class in a format string
1 parent 28c78af commit a2d98f8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/darwin/Framework/CHIP/MTRMetricsCollector.mm

+5-5
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,19 @@ - (void)handleMetricEvent:(MetricEvent)event
193193
using ValueType = MetricEvent::Value::Type;
194194
switch (event.ValueType()) {
195195
case ValueType::kInt32:
196-
MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: %d", event.key(), event.type(), event.ValueInt32());
196+
MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: %d", event.key(), static_cast<int>(event.type()), event.ValueInt32());
197197
break;
198198
case ValueType::kUInt32:
199-
MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: %u", event.key(), event.type(), event.ValueUInt32());
199+
MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: %u", event.key(), static_cast<int>(event.type()), event.ValueUInt32());
200200
break;
201201
case ValueType::kChipErrorCode:
202-
MTR_LOG_INFO("Received metric event, key: %s, type: %d, error value: %u", event.key(), event.type(), event.ValueErrorCode());
202+
MTR_LOG_INFO("Received metric event, key: %s, type: %d, error value: %u", event.key(), static_cast<int>(event.type()), event.ValueErrorCode());
203203
break;
204204
case ValueType::kUndefined:
205-
MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: nil", event.key(), event.type());
205+
MTR_LOG_INFO("Received metric event, key: %s, type: %d, value: nil", event.key(), static_cast<int>(event.type()));
206206
break;
207207
default:
208-
MTR_LOG_INFO("Received metric event, key: %s, type: %d, unknown value", event.key(), event.type());
208+
MTR_LOG_INFO("Received metric event, key: %s, type: %d, unknown value", event.key(), static_cast<int>(event.type()));
209209
return;
210210
}
211211

0 commit comments

Comments
 (0)