MSVC: Fix narrowing conversion error
MSVC15 compiler requires an explicit
coversion from int32_t to uint32_t
TraceTimestamp {
uint32_t clock_id,
uint64_t_value
}
while GetClockId() is enum BuiltinClock : int32_t
Since all values of enum BuiltinClock are >=0 explicit cast should
not bring any additional problems and is done on most of compilers
automatically anyway
Change-Id: Iad034fbe389beb8739ff03aa1751e03d351a8105
diff --git a/include/perfetto/tracing/internal/track_event_data_source.h b/include/perfetto/tracing/internal/track_event_data_source.h
index 4f083a8..9b64708 100644
--- a/include/perfetto/tracing/internal/track_event_data_source.h
+++ b/include/perfetto/tracing/internal/track_event_data_source.h
@@ -53,7 +53,7 @@
struct TraceTimestampTraits<uint64_t> {
static inline TraceTimestamp ConvertTimestampToTraceTimeNs(
const uint64_t& timestamp) {
- return {internal::TrackEventInternal::GetClockId(), timestamp};
+ return {static_cast<uint32_t>(internal::TrackEventInternal::GetClockId()), timestamp};
}
};