From 34b2b007db875a6acb853c5cd2a247fbb32c0f88 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Fri, 20 Nov 2009 06:53:28 +0000 Subject: Add compiler-specific "examine printf format" attributes to printfs. Functions that take a printf-style format get a new annotation, which produces a bunch of compiler warnings when you use printf impoperly. This change adds the annotations and fixes the warnings. We now must use PRId64 for 64-bit numbers and the PRIsz for size_t. Review URL: http://codereview.chromium.org/339059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32600 0039d316-1c4b-4281-b951-d872f2087c98 --- media/base/video_frame_impl_unittest.cc | 6 ++++-- media/filters/ffmpeg_glue.cc | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'media') diff --git a/media/base/video_frame_impl_unittest.cc b/media/base/video_frame_impl_unittest.cc index 9d9573c..d50db36 100644 --- a/media/base/video_frame_impl_unittest.cc +++ b/media/base/video_frame_impl_unittest.cc @@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "media/base/video_frame_impl.h" + +#include "base/format_macros.h" #include "base/string_util.h" #include "media/base/buffers.h" #include "media/base/mock_filters.h" -#include "media/base/video_frame_impl.h" #include "media/base/yuv_convert.h" #include "testing/gtest/include/gtest/gtest.h" @@ -84,7 +86,7 @@ void ExpectFrameColor(media::VideoFrame* yv12_frame, uint32 expect_rgb_color) { rgb_surface.data[VideoSurface::kRGBPlane] + (rgb_surface.strides[VideoSurface::kRGBPlane] * row)); for (size_t col = 0; col < rgb_surface.width; ++col) { - SCOPED_TRACE(StringPrintf("Checking (%u, %u)", row, col)); + SCOPED_TRACE(StringPrintf("Checking (%" PRIuS ", %" PRIuS ")", row, col)); EXPECT_EQ(expect_rgb_color, rgb_row_data[col]); } } diff --git a/media/filters/ffmpeg_glue.cc b/media/filters/ffmpeg_glue.cc index 3c8433c..77b1f33 100644 --- a/media/filters/ffmpeg_glue.cc +++ b/media/filters/ffmpeg_glue.cc @@ -151,7 +151,7 @@ std::string FFmpegGlue::GetProtocolKey(FFmpegURLProtocol* protocol) { // Use the FFmpegURLProtocol's memory address to generate the unique string. // This also has the nice property that adding the same FFmpegURLProtocol // reference will not generate duplicate entries. - return StringPrintf("%s://0x%lx", kProtocol, static_cast(protocol)); + return StringPrintf("%s://%p", kProtocol, static_cast(protocol)); } } // namespace media -- cgit v1.1