diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 22:23:20 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 22:23:20 +0000 |
commit | 225c8f507421a2eff2ed7a900104431d04ed7e5e (patch) | |
tree | 770b7081fc8f2a15abe4635938e03550f010a526 /chrome/browser | |
parent | f3f0c05dfbcbfec2ecbb79ba9bab6ffc8f93ea32 (diff) | |
download | chromium_src-225c8f507421a2eff2ed7a900104431d04ed7e5e.zip chromium_src-225c8f507421a2eff2ed7a900104431d04ed7e5e.tar.gz chromium_src-225c8f507421a2eff2ed7a900104431d04ed7e5e.tar.bz2 |
linux: build with -Wextra
95% of this is removing "const" from return types, but turning this
on found one bug! (A "for" loop that expected its iterator to go negative but
which was using an unsigned type.)
BUG=34160
Review URL: http://codereview.chromium.org/570012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38266 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
22 files changed, 54 insertions, 49 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.h b/chrome/browser/autocomplete/autocomplete.h index f7de326..d64fd6c 100644 --- a/chrome/browser/autocomplete/autocomplete.h +++ b/chrome/browser/autocomplete/autocomplete.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -233,19 +233,19 @@ class AutocompleteInput { const GURL& canonicalized_url() const { return canonicalized_url_; } // Returns whether inline autocompletion should be prevented. - const bool prevent_inline_autocomplete() const { + bool prevent_inline_autocomplete() const { return prevent_inline_autocomplete_; } // Returns whether, given an input string consisting solely of a substituting // keyword, we should score it like a non-substituting keyword. - const bool prefer_keyword() const { return prefer_keyword_; } + bool prefer_keyword() const { return prefer_keyword_; } // Returns whether providers should avoid scheduling asynchronous work. If // this is true, providers should stop after returning all the // synchronously-available matches. This also means any in-progress // asynchronous work should be canceled, so no later callbacks are fired. - const bool synchronous_only() const { return synchronous_only_; } + bool synchronous_only() const { return synchronous_only_; } // operator==() by another name. bool Equals(const AutocompleteInput& other) const; @@ -778,7 +778,7 @@ class AutocompleteController : public ACProviderListener { // This next is temporary and should go away when // AutocompletePopup::URLsForCurrentSelection() moves to the controller. const AutocompleteResult& latest_result() const { return latest_result_; } - const bool done() const { return done_ && !update_delay_timer_.IsRunning(); } + bool done() const { return done_ && !update_delay_timer_.IsRunning(); } // From AutocompleteProvider::Listener virtual void OnProviderUpdate(bool updated_matches); diff --git a/chrome/browser/autofill/address.cc b/chrome/browser/autofill/address.cc index f39f141..c76f6af 100644 --- a/chrome/browser/autofill/address.cc +++ b/chrome/browser/autofill/address.cc @@ -153,7 +153,8 @@ void Address::set_line2(const string16& line2) { } Address::Address(const Address& address) - : line1_tokens_(address.line1_tokens_), + : FormGroup(), + line1_tokens_(address.line1_tokens_), line2_tokens_(address.line2_tokens_), line1_(address.line1_), line2_(address.line2_), diff --git a/chrome/browser/autofill/address_field.cc b/chrome/browser/autofill/address_field.cc index 0994ac6..a40ad87 100644 --- a/chrome/browser/autofill/address_field.cc +++ b/chrome/browser/autofill/address_field.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -161,7 +161,8 @@ AddressField::AddressField() } AddressField::AddressField(const AddressField& field) - : address1_(field.address1_), + : FormField(), + address1_(field.address1_), address2_(field.address2_), city_(field.city_), state_(field.state_), diff --git a/chrome/browser/autofill/autofill_profile.cc b/chrome/browser/autofill/autofill_profile.cc index cd0438d..caf335a 100644 --- a/chrome/browser/autofill/autofill_profile.cc +++ b/chrome/browser/autofill/autofill_profile.cc @@ -32,7 +32,8 @@ AutoFillProfile::AutoFillProfile() use_billing_address_(true) { } -AutoFillProfile::AutoFillProfile(const AutoFillProfile& source) { +AutoFillProfile::AutoFillProfile(const AutoFillProfile& source) + : FormGroup() { operator=(source); } diff --git a/chrome/browser/autofill/contact_info.cc b/chrome/browser/autofill/contact_info.cc index 266ea8e..37c5714 100644 --- a/chrome/browser/autofill/contact_info.cc +++ b/chrome/browser/autofill/contact_info.cc @@ -150,7 +150,8 @@ string16 ContactInfo::MiddleInitial() const { } ContactInfo::ContactInfo(const ContactInfo& contact_info) - : first_tokens_(contact_info.first_tokens_), + : FormGroup(), + first_tokens_(contact_info.first_tokens_), middle_tokens_(contact_info.middle_tokens_), last_tokens_(contact_info.last_tokens_), first_(contact_info.first_), diff --git a/chrome/browser/autofill/credit_card.cc b/chrome/browser/autofill/credit_card.cc index 0f0d526..d4e5589 100644 --- a/chrome/browser/autofill/credit_card.cc +++ b/chrome/browser/autofill/credit_card.cc @@ -33,7 +33,7 @@ CreditCard::CreditCard(const string16& label, int unique_id) unique_id_(unique_id) { } -CreditCard::CreditCard(const CreditCard& card) { +CreditCard::CreditCard(const CreditCard& card) : FormGroup() { operator=(card); } diff --git a/chrome/browser/autofill/credit_card_field.cc b/chrome/browser/autofill/credit_card_field.cc index 7e0c3d0c..3a2bebc 100644 --- a/chrome/browser/autofill/credit_card_field.cc +++ b/chrome/browser/autofill/credit_card_field.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -153,7 +153,8 @@ CreditCardField::CreditCardField() } CreditCardField::CreditCardField(const CreditCardField& field) - : cardholder_(field.cardholder_), + : FormField(), + cardholder_(field.cardholder_), cardholder_last_(field.cardholder_last_), type_(field.type_), number_(field.number_), diff --git a/chrome/browser/autofill/name_field.cc b/chrome/browser/autofill/name_field.cc index 83f5b16..3510e16 100644 --- a/chrome/browser/autofill/name_field.cc +++ b/chrome/browser/autofill/name_field.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -152,7 +152,8 @@ FirstLastNameField::FirstLastNameField() } FirstLastNameField::FirstLastNameField(const FirstLastNameField& field) - : first_name_(field.first_name_), + : NameField(), + first_name_(field.first_name_), middle_name_(field.middle_name_), last_name_(field.last_name_), middle_initial_(field.middle_initial_) { diff --git a/chrome/browser/autofill/phone_number.cc b/chrome/browser/autofill/phone_number.cc index bdeee11..8c4de77 100644 --- a/chrome/browser/autofill/phone_number.cc +++ b/chrome/browser/autofill/phone_number.cc @@ -130,7 +130,8 @@ void PhoneNumber::set_number(const string16& number) { } PhoneNumber::PhoneNumber(const PhoneNumber& phone_number) - : country_code_(phone_number.country_code_), + : FormGroup(), + country_code_(phone_number.country_code_), city_code_(phone_number.city_code_), number_(phone_number.number_), extension_(phone_number.extension_) { diff --git a/chrome/browser/browser_theme_pack.cc b/chrome/browser/browser_theme_pack.cc index ea1474c..ed45ad0 100644 --- a/chrome/browser/browser_theme_pack.cc +++ b/chrome/browser/browser_theme_pack.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -171,7 +171,7 @@ PersistingImagesTable kPersistingImages[] = { { 59, IDR_LOCATIONBG, NULL } }; -const int GetPersistentIDByName(const std::string& key) { +int GetPersistentIDByName(const std::string& key) { for (size_t i = 0; i < arraysize(kPersistingImages); ++i) { if (kPersistingImages[i].key != NULL && base::strcasecmp(key.c_str(), kPersistingImages[i].key) == 0) { @@ -182,7 +182,7 @@ const int GetPersistentIDByName(const std::string& key) { return -1; } -const int GetPersistentIDByIDR(int idr) { +int GetPersistentIDByIDR(int idr) { for (size_t i = 0; i < arraysize(kPersistingImages); ++i) { if (kPersistingImages[i].idr_id == idr) { return kPersistingImages[i].persistent_id; diff --git a/chrome/browser/character_encoding.cc b/chrome/browser/character_encoding.cc index a1afb4e..cd2693a 100644 --- a/chrome/browser/character_encoding.cc +++ b/chrome/browser/character_encoding.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -112,12 +112,11 @@ class CanonicalEncodingMap { const IdToCanonicalEncodingNameMapType* GetIdToCanonicalEncodingNameMapData(); const CanonicalEncodingNameToIdMapType* GetCanonicalEncodingNameToIdMapData(); const CanonicalNameDisplayNameMapType* GetCanonicalNameDisplayNameMapData(); - std::vector<int>* const locale_dependent_encoding_ids() { + std::vector<int>* locale_dependent_encoding_ids() { return &locale_dependent_encoding_ids_; } - std::vector<CharacterEncoding::EncodingInfo>* const - current_display_encodings() { + std::vector<CharacterEncoding::EncodingInfo>* current_display_encodings() { return ¤t_display_encodings_; } diff --git a/chrome/browser/debugger/devtools_remote_message.h b/chrome/browser/debugger/devtools_remote_message.h index fa37caa..0fa5e97 100644 --- a/chrome/browser/debugger/devtools_remote_message.h +++ b/chrome/browser/debugger/devtools_remote_message.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -48,7 +48,7 @@ class DevToolsRemoteMessage { return content_; } - const int content_length() const { + int content_length() const { return content_.size(); } diff --git a/chrome/browser/dom_ui/dom_ui.h b/chrome/browser/dom_ui/dom_ui.h index 2156b30..5630597 100644 --- a/chrome/browser/dom_ui/dom_ui.h +++ b/chrome/browser/dom_ui/dom_ui.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -89,11 +89,11 @@ class DOMUI { // Returns the transition type that should be used for link clicks on this // DOM UI. This will default to LINK but may be overridden. - const PageTransition::Type link_transition_type() const { + PageTransition::Type link_transition_type() const { return link_transition_type_; } - const int bindings() const { + int bindings() const { return bindings_; } diff --git a/chrome/browser/dom_ui/most_visited_handler.cc b/chrome/browser/dom_ui/most_visited_handler.cc index bf5a0f2..d145638 100644 --- a/chrome/browser/dom_ui/most_visited_handler.cc +++ b/chrome/browser/dom_ui/most_visited_handler.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -264,8 +264,8 @@ void MostVisitedHandler::RemovePinnedURL(const GURL& url) { // Don't call HandleGetMostVisited. Let the client call this as needed. } -const bool MostVisitedHandler::GetPinnedURLAtIndex(const int index, - MostVisitedPage* page) { +bool MostVisitedHandler::GetPinnedURLAtIndex(int index, + MostVisitedPage* page) { // This iterates over all the pinned URLs. It might seem like it is worth // having a map from the index to the item but the number of items is limited // to the number of items the most visited section is showing on the NTP so diff --git a/chrome/browser/dom_ui/most_visited_handler.h b/chrome/browser/dom_ui/most_visited_handler.h index 07be18c..9245cd9 100644 --- a/chrome/browser/dom_ui/most_visited_handler.h +++ b/chrome/browser/dom_ui/most_visited_handler.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -86,7 +86,7 @@ class MostVisitedHandler : public DOMMessageHandler, // Gets the page data for a pinned URL at a given index. This returns // true if found. - const bool GetPinnedURLAtIndex(const int index, MostVisitedPage* page); + bool GetPinnedURLAtIndex(int index, MostVisitedPage* page); void AddPinnedURL(const MostVisitedPage& page, int index); void RemovePinnedURL(const GURL& url); diff --git a/chrome/browser/dom_ui/new_tab_ui.h b/chrome/browser/dom_ui/new_tab_ui.h index d612dd9..264300a 100644 --- a/chrome/browser/dom_ui/new_tab_ui.h +++ b/chrome/browser/dom_ui/new_tab_ui.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -47,7 +47,7 @@ class NewTabUI : public DOMUI, const GURL& gurl); // The current preference version. - static const int current_pref_version() { return current_pref_version_; } + static int current_pref_version() { return current_pref_version_; } class NewTabHTMLSource : public ChromeURLDataManager::DataSource { public: diff --git a/chrome/browser/notifications/balloon_collection.cc b/chrome/browser/notifications/balloon_collection.cc index e148911..224e7bb 100644 --- a/chrome/browser/notifications/balloon_collection.cc +++ b/chrome/browser/notifications/balloon_collection.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -121,9 +121,8 @@ BalloonCollectionImpl::Layout::Layout() { RefreshSystemMetrics(); } -const void BalloonCollectionImpl::Layout::GetMaxLinearSize( - int* max_balloon_size, - int* total_size) const { +void BalloonCollectionImpl::Layout::GetMaxLinearSize(int* max_balloon_size, + int* total_size) const { DCHECK(max_balloon_size && total_size); switch (placement_) { diff --git a/chrome/browser/notifications/balloon_collection.h b/chrome/browser/notifications/balloon_collection.h index 8810b18..14469d9 100644 --- a/chrome/browser/notifications/balloon_collection.h +++ b/chrome/browser/notifications/balloon_collection.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -94,7 +94,7 @@ class BalloonCollectionImpl : public BalloonCollection { // // The size may be a height or length depending on the way that // balloons are laid out. - const void GetMaxLinearSize(int* max_balloon_size, int* total_size) const; + void GetMaxLinearSize(int* max_balloon_size, int* total_size) const; // Refresh the cached values for work area and drawing metrics. // The application should call this method to re-acquire metrics after diff --git a/chrome/browser/safe_browsing/safe_browsing_util.h b/chrome/browser/safe_browsing/safe_browsing_util.h index cd39276..4e9104d 100644 --- a/chrome/browser/safe_browsing/safe_browsing_util.h +++ b/chrome/browser/safe_browsing/safe_browsing_util.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -249,7 +249,7 @@ class SBHostInfo { // Used for serialization. const void* data() const { return data_.get(); } - const int size() const { return size_; } + int size() const { return size_; } private: // Checks data_ for internal consistency. diff --git a/chrome/browser/sync/glue/bookmark_model_associator.h b/chrome/browser/sync/glue/bookmark_model_associator.h index 0a4fcb97..ddfc00e 100644 --- a/chrome/browser/sync/glue/bookmark_model_associator.h +++ b/chrome/browser/sync/glue/bookmark_model_associator.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -34,7 +34,7 @@ class BookmarkChangeProcessor; class BookmarkModelAssociator : public PerDataTypeAssociatorInterface<BookmarkNode, int64> { public: - static const ModelType model_type() { return MODEL_TYPE_BOOKMARKS; } + static ModelType model_type() { return MODEL_TYPE_BOOKMARKS; } explicit BookmarkModelAssociator(ProfileSyncService* sync_service); virtual ~BookmarkModelAssociator() { } diff --git a/chrome/browser/sync/notifier/base/async_dns_lookup.h b/chrome/browser/sync/notifier/base/async_dns_lookup.h index c62aa1f..937db45 100644 --- a/chrome/browser/sync/notifier/base/async_dns_lookup.h +++ b/chrome/browser/sync/notifier/base/async_dns_lookup.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -22,7 +22,7 @@ class AsyncDNSLookup : public talk_base::SignalThread { explicit AsyncDNSLookup(const talk_base::SocketAddress& server); virtual ~AsyncDNSLookup(); - const int error() const { + int error() const { return error_; } diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index 7c6a62e..e9ede55 100644 --- a/chrome/browser/task_manager.cc +++ b/chrome/browser/task_manager.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -260,7 +260,7 @@ std::pair<int, int> TaskManagerModel::GetGroupRangeForResource(int index) if (group->size() == 1) { return std::make_pair(index, 1); } else { - for (size_t i = index; i >= 0; --i) { + for (int i = index; i >= 0; --i) { if (resources_[i] == (*group)[0]) return std::make_pair(i, group->size()); } |