OSDN Git Service

Adapt to google::protobuf::int64 type change
authorColin Cross <ccross@android.com>
Wed, 14 Aug 2019 16:37:07 +0000 (09:37 -0700)
committerColin Cross <ccross@android.com>
Wed, 14 Aug 2019 23:32:22 +0000 (16:32 -0700)
Protobuf 3.9.1 redefines google::protobuf::int64 from long long
to int64_t, which is sometimes long and sometimes long long.  Use
PRIi64 to print it.  Also temporarily cast to int64_t to decouple
this change from the change that updates protobuf.

Bug: 117607748
Test: m checkbuild
Change-Id: I482b957d2262e5001140ed1153c7de2b17facae2

cmds/incidentd/src/WorkDirectory.cpp

index 0570c3a..e826061 100644 (file)
@@ -209,7 +209,7 @@ void log_envelope(const ReportFileProto& envelope) {
     }
     ALOGD("  data_file=%s", envelope.data_file().c_str());
     ALOGD("  privacy_policy=%d", envelope.privacy_policy());
-    ALOGD("  data_file_size=%lld", envelope.data_file_size());
+    ALOGD("  data_file_size=%" PRIi64, (int64_t)envelope.data_file_size());
     ALOGD("  completed=%d", envelope.completed());
     ALOGD("}");
 }