Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Unified Diff: chrome/utility/importer/ie_importer_win.cc

Issue 1390223002: Enforce WARN_UNUSED_RESULT attribute on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/service/cloud_print/print_system_win.cc ('k') | cloud_print/service/win/service_listener.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/importer/ie_importer_win.cc
diff --git a/chrome/utility/importer/ie_importer_win.cc b/chrome/utility/importer/ie_importer_win.cc
index 6bff0e43845d93df8075d573e2ea1321691effb3..bc017acffa81f63a30f63caebbb2ab4291a5b0eb 100644
--- a/chrome/utility/importer/ie_importer_win.cc
+++ b/chrome/utility/importer/ie_importer_win.cc
@@ -160,11 +160,20 @@ struct IEOrderBookmarkComparator {
// };
// where each item_id should correspond to a favorites link file (*.url) in
// the current folder.
-bool ParseFavoritesOrderBlob(
- const Importer* importer,
- const std::vector<uint8>& blob,
- const base::FilePath& path,
- std::map<base::FilePath, uint32>* sort_index) WARN_UNUSED_RESULT {
+// gcc, in its infinite wisdom, only allows WARN_UNUSED_RESULT for prototypes.
+// Clang, to be compatible with gcc, warns if WARN_UNUSED_RESULT is used in a
+// non-gcc compatible manner (-Wgcc-compat). So even though gcc isn't used to
+// build on Windows, declare some prototypes anyway to satisfy Clang's gcc
+// compatibility warnings.
+bool ParseFavoritesOrderBlob(const Importer* importer,
+ const std::vector<uint8>& blob,
+ const base::FilePath& path,
+ std::map<base::FilePath, uint32>* sort_index)
+ WARN_UNUSED_RESULT;
+bool ParseFavoritesOrderBlob(const Importer* importer,
+ const std::vector<uint8>& blob,
+ const base::FilePath& path,
+ std::map<base::FilePath, uint32>* sort_index) {
static const int kItemCountOffset = 16;
static const int kItemListStartOffset = 20;
@@ -212,7 +221,12 @@ bool ParseFavoritesOrderRegistryTree(
const Importer* importer,
const base::win::RegKey& key,
const base::FilePath& path,
- std::map<base::FilePath, uint32>* sort_index) WARN_UNUSED_RESULT {
+ std::map<base::FilePath, uint32>* sort_index) WARN_UNUSED_RESULT;
+bool ParseFavoritesOrderRegistryTree(
+ const Importer* importer,
+ const base::win::RegKey& key,
+ const base::FilePath& path,
+ std::map<base::FilePath, uint32>* sort_index) {
// Parse the order information of the current folder.
DWORD blob_length = 0;
if (key.ReadValue(L"Order", NULL, &blob_length, NULL) == ERROR_SUCCESS) {
@@ -241,9 +255,11 @@ bool ParseFavoritesOrderRegistryTree(
return true;
}
-bool ParseFavoritesOrderInfo(
- const Importer* importer,
- std::map<base::FilePath, uint32>* sort_index) WARN_UNUSED_RESULT {
+bool ParseFavoritesOrderInfo(const Importer* importer,
+ std::map<base::FilePath, uint32>* sort_index)
+ WARN_UNUSED_RESULT;
+bool ParseFavoritesOrderInfo(const Importer* importer,
+ std::map<base::FilePath, uint32>* sort_index) {
base::string16 key_path(importer::GetIEFavoritesOrderKey());
base::win::RegKey key(HKEY_CURRENT_USER, key_path.c_str(), KEY_READ);
if (!key.Valid())
« no previous file with comments | « chrome/service/cloud_print/print_system_win.cc ('k') | cloud_print/service/win/service_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698