aboutsummaryrefslogtreecommitdiff
path: root/webrtc/base
diff options
context:
space:
mode:
authorNiklas Enbom <niklas.enbom@webrtc.org>2015-12-10 16:16:55 -0800
committerNiklas Enbom <niklas.enbom@webrtc.org>2015-12-11 00:17:03 +0000
commit013e83b31c697c861dec83a4fe78b06e836984dd (patch)
tree663b66f684b7d9997521caef54164c1d8c7b004c /webrtc/base
parentcf846ad60adcfe11740d58a097fbdc8e02b2839b (diff)
downloadwebrtc-013e83b31c697c861dec83a4fe78b06e836984dd.tar.gz
Fix -Wformat error in Win-Clang build
rtc::PlatformThreadId is pid_t (32-bit signed int) on Linux and Mac, but DWORD (32-bit unsigned int) on Windows. Using the %d printf specifier is therefore not correct on Windows, and Clang would warn about it: ..\..\third_party\webrtc\base\event_tracer.cc(124,46) : error: format specifies type 'int' but the argument has type 'rtc::PlatformThreadId' (aka 'unsigned long') [-Werror,-Wformat] e.phase, e.timestamp, e.pid, e.tid); ^~~~~ This commit fixes the problem by explicitly casting to int before printing. BUG=82385 Review URL: https://codereview.webrtc.org/1514253002 . Cr-Commit-Position: refs/heads/master@{#10982}
Diffstat (limited to 'webrtc/base')
-rw-r--r--webrtc/base/event_tracer.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/webrtc/base/event_tracer.cc b/webrtc/base/event_tracer.cc
index dbf85a4e9a..dec323dab1 100644
--- a/webrtc/base/event_tracer.cc
+++ b/webrtc/base/event_tracer.cc
@@ -121,7 +121,7 @@ class EventLogger final {
", \"pid\": %d"
", \"tid\": %d}\n",
has_logged_event ? "," : " ", e.name, e.category_enabled,
- e.phase, e.timestamp, e.pid, e.tid);
+ e.phase, e.timestamp, static_cast<int>(e.pid), e.tid);
has_logged_event = true;
}
if (shutting_down)