Remove warning suppressions and fix many casting bugs

This change removes most warning suppressions, in particular
from production code. In the past we inherit a bunch of -Wno-xxx
suppressions required to build gtest and libprotobuf headers.
Doing so, however, caused the suppressions to propagate back to
the translation units that were including any protobuf header
or any auto-generated .pb.h stub.
This change moves the gtest and probobuf header to be a
system include (-isystem vs -I). Doing so implicitly blacklists
any compiler warning on the headers.
This CL then re-enables warnings and deals with the fall out of
fixes that came out of this.

Bug: 77316877
Test: pefetto_unittests / perfetto_integrationtests
Change-Id: I3a01852ebf7d0b9bf19658ddf117209d129c70be
diff --git a/src/tracing/core/service_impl.h b/src/tracing/core/service_impl.h
index 046e983..c6f7936 100644
--- a/src/tracing/core/service_impl.h
+++ b/src/tracing/core/service_impl.h
@@ -121,7 +121,7 @@
     void DisableTracing() override;
     void ReadBuffers() override;
     void FreeBuffers() override;
-    void Flush(int timeout_ms, FlushCallback) override;
+    void Flush(uint32_t timeout_ms, FlushCallback) override;
 
    private:
     friend class ServiceImpl;
@@ -164,7 +164,7 @@
                      base::ScopedFile);
   void DisableTracing(TracingSessionID);
   void Flush(TracingSessionID tsid,
-             int timeout_ms,
+             uint32_t timeout_ms,
              ConsumerEndpoint::FlushCallback);
   void FlushAndDisableTracing(TracingSessionID);
   void ReadBuffers(TracingSessionID, ConsumerEndpointImpl*);
@@ -211,7 +211,7 @@
 
     size_t num_buffers() const { return buffers_index.size(); }
 
-    int delay_to_next_write_period_ms() const {
+    uint32_t delay_to_next_write_period_ms() const {
       PERFETTO_DCHECK(write_period_ms > 0);
       return write_period_ms -
              (base::GetWallTimeMs().count() % write_period_ms);
@@ -250,9 +250,9 @@
     // trace packets into, rather than returning it to the consumer via
     // OnTraceData().
     base::ScopedFile write_into_file;
-    int write_period_ms = 0;
-    size_t max_file_size_bytes = 0;
-    size_t bytes_written_into_file = 0;
+    uint32_t write_period_ms = 0;
+    uint64_t max_file_size_bytes = 0;
+    uint64_t bytes_written_into_file = 0;
   };
 
   ServiceImpl(const ServiceImpl&) = delete;