Don't use C-style cast.
I thought Type{valueOfOtherPrimitiveType} is a fancy way of doing static
cast. It's not. In fact, it's the same as (Type)valueOfOtherType.
Bug: 241599082
Test: make -k100 tidy-hardware-interfaces-radio
Change-Id: I85ddbe54601b9111030013be85226b90f3d2fe6f
diff --git a/radio/aidl/compat/libradiocompat/sim/structs.cpp b/radio/aidl/compat/libradiocompat/sim/structs.cpp
index bfbff02..00db2b8 100644
--- a/radio/aidl/compat/libradiocompat/sim/structs.cpp
+++ b/radio/aidl/compat/libradiocompat/sim/structs.cpp
@@ -65,7 +65,7 @@
return {
.mcc = carrier.mcc,
.mnc = carrier.mnc,
- .matchType = V1_0::CarrierMatchType{carrier.matchType},
+ .matchType = static_cast<V1_0::CarrierMatchType>(carrier.matchType),
.matchData = carrier.matchData,
};
}
@@ -107,7 +107,7 @@
V1_6::ImsiEncryptionInfo toHidl_1_6(const aidl::ImsiEncryptionInfo& info) {
return {
.base = toHidl(info),
- .keyType = V1_6::PublicKeyType{info.keyType},
+ .keyType = static_cast<V1_6::PublicKeyType>(info.keyType),
};
}