diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 06:53:28 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 06:53:28 +0000 |
commit | 34b2b007db875a6acb853c5cd2a247fbb32c0f88 (patch) | |
tree | 6dc39bc9f10d6e8eedcdf14821ba9e96b5ccab51 /chrome/common/extensions/extension_unittest.cc | |
parent | 24b857793e27aded8d804a112a5fe6c77e28b081 (diff) | |
download | chromium_src-34b2b007db875a6acb853c5cd2a247fbb32c0f88.zip chromium_src-34b2b007db875a6acb853c5cd2a247fbb32c0f88.tar.gz chromium_src-34b2b007db875a6acb853c5cd2a247fbb32c0f88.tar.bz2 |
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
Diffstat (limited to 'chrome/common/extensions/extension_unittest.cc')
-rw-r--r-- | chrome/common/extensions/extension_unittest.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc index db54776..330478c 100644 --- a/chrome/common/extensions/extension_unittest.cc +++ b/chrome/common/extensions/extension_unittest.cc @@ -2,12 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/common/extensions/extension.h" + +#include "base/format_macros.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/string_util.h" #include "base/path_service.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/extension_error_reporter.h" #include "chrome/common/json_value_serializer.h" @@ -472,9 +474,11 @@ TEST(ExtensionTest, UpdateUrls) { DictionaryValue input_value; #if defined(OS_WIN) - FilePath path(StringPrintf(L"c:\\extension%i", i)); + // (Why %Iu below? This is the single file in the whole code base that + // might make use of a WidePRIuS; let's not encourage any more.) + FilePath path(StringPrintf(L"c:\\extension%Iu", i)); #else - FilePath path(StringPrintf("/extension%i", i)); + FilePath path(StringPrintf("/extension%" PRIuS, i)); #endif Extension extension(path); std::string error; @@ -494,9 +498,11 @@ TEST(ExtensionTest, UpdateUrls) { for (size_t i = 0; i < invalid.size(); i++) { DictionaryValue input_value; #if defined(OS_WIN) - FilePath path(StringPrintf(L"c:\\extension%i", i)); + // (Why %Iu below? This is the single file in the whole code base that + // might make use of a WidePRIuS; let's not encourage any more.) + FilePath path(StringPrintf(L"c:\\extension%Iu", i)); #else - FilePath path(StringPrintf("/extension%i", i)); + FilePath path(StringPrintf("/extension%" PRIuS, i)); #endif Extension extension(path); std::string error; |