Fix gcc build

Follow up to aosp/776165

TBR: hjd
Change-Id: If9a3a8974134420d6e93d3f28d62d3ab728faf69
diff --git a/src/tracing/api_impl/consumer_api.cc b/src/tracing/api_impl/consumer_api.cc
index 89c0608..69555ee 100644
--- a/src/tracing/api_impl/consumer_api.cc
+++ b/src/tracing/api_impl/consumer_api.cc
@@ -187,7 +187,8 @@
 
   auto state = state_.load();
   if (state != State::kConfigured) {
-    PERFETTO_ELOG("StartTracing(): invalid state (%d)", state);
+    PERFETTO_ELOG("StartTracing(): invalid state (%d)",
+                  static_cast<int>(state));
     return;
   }
   state_ = State::kTracing;
@@ -357,7 +358,8 @@
     return buf;
   }
 
-  PERFETTO_DLOG("ReadTrace(): called in an unexpected state (%d)", state);
+  PERFETTO_DLOG("ReadTrace(): called in an unexpected state (%d)",
+                static_cast<int>(state));
   return buf;
 }
 
diff --git a/src/tracing/api_impl/consumer_api_test.cc b/src/tracing/api_impl/consumer_api_test.cc
index 12183e1..035bd65 100644
--- a/src/tracing/api_impl/consumer_api_test.cc
+++ b/src/tracing/api_impl/consumer_api_test.cc
@@ -82,7 +82,8 @@
 }
 
 void OnStateChanged(Handle handle, State state, void* ptr) {
-  PERFETTO_LOG("Callback: handle=%" PRId64 " state=%d", handle, state);
+  PERFETTO_LOG("Callback: handle=%" PRId64 " state=%d", handle,
+               static_cast<int>(state));
   PERFETTO_CHECK(ptr == &g_pointer);
 }
 
@@ -90,7 +91,7 @@
   std::string cfg = GetConfig(1000);
   auto handle = Create(cfg.data(), cfg.size(), &OnStateChanged, &g_pointer);
   PERFETTO_ILOG("Starting, handle=%" PRId64 " state=%d", handle,
-                PollState(handle));
+                static_cast<int>(PollState(handle)));
   usleep(100000);
   StartTracing(handle);
   // Wait for either completion or error.
@@ -118,7 +119,7 @@
     auto handle = Create(cfg.data(), cfg.size(), &OnStateChanged, &g_pointer);
     handles[i] = handle;
     PERFETTO_ILOG("Creating handle=%" PRId64 " state=%d", handle,
-                  PollState(handle));
+                  static_cast<int>(PollState(handle)));
   }
 
   // Wait that all sessions are connected.