Skip to content

Commit

Permalink
Revert "Fix a ton of compiler warnings."
Browse files Browse the repository at this point in the history
This reverts commit r24792.

TBR=estade

Review URL: http://codereview.chromium.org/179028


git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24796 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
[email protected] committed Aug 28, 2009
1 parent c587407 commit 5a3b914
Show file tree
Hide file tree
Showing 141 changed files with 277 additions and 529 deletions.
5 changes: 1 addition & 4 deletions app/animation.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2006-2008 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.
// Inspired by NSAnimation
Expand Down Expand Up @@ -32,9 +32,6 @@ class AnimationDelegate {
// Called when an animation has been canceled.
virtual void AnimationCanceled(const Animation* animation) {
}

protected:
~AnimationDelegate() {}
};

// Animation
Expand Down
2 changes: 0 additions & 2 deletions app/table_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ class TableModel {
void ClearCollator();

protected:
~TableModel() {}

// Returns the collator used by CompareValues.
icu::Collator* GetCollator();
};
Expand Down
3 changes: 0 additions & 3 deletions app/table_model_observer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class TableModelObserver {

// Invoked when a range of items has been removed.
virtual void OnItemsRemoved(int start, int length) = 0;

protected:
~TableModelObserver() {}
};

#endif // APP_TABLE_MODEL_OBSERVER_H_
11 changes: 1 addition & 10 deletions app/tree_model.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2008 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.

Expand All @@ -21,9 +21,6 @@ class TreeModelNode {
public:
// Returns the title for the node.
virtual const std::wstring& GetTitle() const = 0;

protected:
~TreeModelNode() {}
};

// Observer for the TreeModel. Notified of significant events to the model.
Expand All @@ -48,9 +45,6 @@ class TreeModelObserver {

// Notification that the contents of a node has changed.
virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) = 0;

protected:
~TreeModelObserver() {}
};

// TreeModel ------------------------------------------------------------------
Expand Down Expand Up @@ -89,9 +83,6 @@ class TreeModel {
// default icon. The index is relative to the list of icons returned from
// GetIcons.
virtual int GetIconIndex(TreeModelNode* node) { return -1; }

protected:
~TreeModel() {}
};

#endif // APP_TREE_TREE_MODEL_H_
4 changes: 2 additions & 2 deletions base/field_trial_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ TEST_F(FieldTrialTest, Save) {
}

TEST_F(FieldTrialTest, Restore) {
EXPECT_TRUE(NULL == FieldTrialList::Find("Some_name"));
EXPECT_TRUE(NULL == FieldTrialList::Find("xxx"));
EXPECT_EQ(NULL, FieldTrialList::Find("Some_name"));
EXPECT_EQ(NULL, FieldTrialList::Find("xxx"));

FieldTrialList::StringAugmentsState("Some_name/Winner/xxx/yyyy/");

Expand Down
3 changes: 0 additions & 3 deletions base/file_descriptor_shuffle.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ class InjectionDelegate {
virtual bool Move(int src, int dest) = 0;
// Delete an element of the domain.
virtual void Close(int fd) = 0;

protected:
~InjectionDelegate() {}
};

// An implementation of the InjectionDelegate interface using the file
Expand Down
10 changes: 5 additions & 5 deletions base/multiprocess_test.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2006-2008 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.

#ifndef BASE_MULTIPROCESS_TEST_H_
#define BASE_MULTIPROCESS_TEST_H_
#ifndef BASE_MULTIPROCESS_TEST_H__
#define BASE_MULTIPROCESS_TEST_H__

#include "base/base_switches.h"
#include "base/command_line.h"
Expand Down Expand Up @@ -106,7 +106,7 @@ class MultiProcessTest : public PlatformTest {
const base::file_handle_mapping_vector& fds_to_map,
bool debug_on_start) {
CommandLine cl(*CommandLine::ForCurrentProcess());
base::ProcessHandle handle = 0;
base::ProcessHandle handle = static_cast<base::ProcessHandle>(NULL);
cl.AppendSwitchWithValue(kRunClientProcess, procname);

if (debug_on_start)
Expand All @@ -118,4 +118,4 @@ class MultiProcessTest : public PlatformTest {
#endif
};

#endif // BASE_MULTIPROCESS_TEST_H_
#endif // BASE_MULTIPROCESS_TEST_H__
11 changes: 6 additions & 5 deletions base/process_util_linux.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2008 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.

Expand Down Expand Up @@ -259,6 +259,7 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const {
int private_kb = 0;
int pss_kb = 0;
bool have_pss = false;
const int kPssAdjust = 0.5;
if (!file_util::ReadFileToString(stat_file, &smaps))
return false;

Expand All @@ -277,12 +278,12 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const {
return false;
}
if (StartsWithASCII(last_key_name, "Shared_", 1)) {
shared_kb += StringToInt(tokenizer.token());
shared_kb += StringToInt(tokenizer.token());
} else if (StartsWithASCII(last_key_name, "Private_", 1)) {
private_kb += StringToInt(tokenizer.token());
private_kb += StringToInt(tokenizer.token());
} else if (StartsWithASCII(last_key_name, "Pss", 1)) {
have_pss = true;
pss_kb += StringToInt(tokenizer.token());
have_pss = true;
pss_kb += StringToInt(tokenizer.token()) + kPssAdjust;
}
state = KEY_NAME;
break;
Expand Down
4 changes: 2 additions & 2 deletions base/process_util_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ MULTIPROCESS_TEST_MAIN(SimpleChildProcess) {
TEST_F(ProcessUtilTest, SpawnChild) {
ProcessHandle handle = this->SpawnChild(L"SimpleChildProcess");

ASSERT_NE(0, handle);
ASSERT_NE(static_cast<ProcessHandle>(NULL), handle);
EXPECT_TRUE(WaitForSingleProcess(handle, 5000));
base::CloseProcessHandle(handle);
}
Expand All @@ -62,7 +62,7 @@ MULTIPROCESS_TEST_MAIN(SlowChildProcess) {
TEST_F(ProcessUtilTest, KillSlowChild) {
remove("SlowChildProcess.die");
ProcessHandle handle = this->SpawnChild(L"SlowChildProcess");
ASSERT_NE(0, handle);
ASSERT_NE(static_cast<ProcessHandle>(NULL), handle);
FILE *fp = fopen("SlowChildProcess.die", "w");
fclose(fp);
EXPECT_TRUE(base::WaitForSingleProcess(handle, 5000));
Expand Down
4 changes: 2 additions & 2 deletions base/stats_table_unittest.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2006-2008 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.

Expand Down Expand Up @@ -208,7 +208,7 @@ TEST_F(StatsTableTest, MultipleProcesses) {
// Spawn the processes.
for (int16 index = 0; index < kMaxProcs; index++) {
procs[index] = this->SpawnChild(L"StatsTableMultipleProcessMain");
EXPECT_NE(0, procs[index]);
EXPECT_NE(static_cast<ProcessHandle>(NULL), procs[index]);
}

// Wait for the processes to finish.
Expand Down
5 changes: 1 addition & 4 deletions base/system_monitor.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2008 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.

Expand Down Expand Up @@ -72,9 +72,6 @@ class SystemMonitor {

// Notification that the system is resuming.
virtual void OnResume(SystemMonitor*) = 0;

protected:
~PowerObserver() {}
};

// Add a new observer.
Expand Down
6 changes: 1 addition & 5 deletions base/task.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2006-2008 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.

Expand Down Expand Up @@ -678,7 +678,6 @@ template <typename ReturnValue>
struct CallbackWithReturnValue {
class Type {
public:
virtual ~Type() {}
virtual ReturnValue Run() = 0;
};
};
Expand All @@ -694,9 +693,6 @@ class CallbackWithReturnValueImpl
virtual ReturnValue Run() {
return (this->obj_->*(this->meth_))();
}

protected:
~CallbackWithReturnValueImpl() {}
};

template <class T, typename ReturnValue>
Expand Down
1 change: 0 additions & 1 deletion base/third_party/dmg_fp/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ List of changes made to original code:
- made some minor changes to allow clean compilation under g++ -Wall, see
gcc_warnings.patch.
- made some minor changes to build on 64-bit, see gcc_64_bit.patch.
- made some implicit type converisons explicit, see type_conversion.patch.
6 changes: 3 additions & 3 deletions base/third_party/dmg_fp/dtoa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,7 @@ hexnan
CONST char *s;
int c1, havedig, udx0, xshift;

if (!hexdig[static_cast<int>('0')])
if (!hexdig['0'])
hexdig_init();
x[0] = x[1] = 0;
havedig = xshift = 0;
Expand Down Expand Up @@ -3283,7 +3283,7 @@ strtod
#ifdef Avoid_Underflow
if (bc.scale && y <= 2*P*Exp_msk1) {
if (aadj <= 0x7fffffff) {
if ((z = static_cast<ULong>(aadj)) <= 0)
if ((z = aadj) <= 0)
z = 1;
aadj = z;
aadj1 = bc.dsign ? aadj : -aadj;
Expand Down Expand Up @@ -3837,7 +3837,7 @@ dtoa
*/
dval(&eps) = 0.5/tens[ilim-1] - dval(&eps);
for(i = 0;;) {
L = static_cast<long>(dval(&u));
L = dval(&u);
dval(&u) -= L;
*s++ = '0' + (int)L;
if (dval(&u) < dval(&eps))
Expand Down
9 changes: 4 additions & 5 deletions base/time.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2006-2008 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.

Expand Down Expand Up @@ -51,7 +51,7 @@ int64 TimeDelta::InMicroseconds() const {
Time Time::FromTimeT(time_t tt) {
if (tt == 0)
return Time(); // Preserve 0 so we can tell it doesn't exist.
return Time((tt * kMicrosecondsPerSecond) + kTimeTToMicrosecondsOffset);
return (tt * kMicrosecondsPerSecond) + kTimeTToMicrosecondsOffset;
}

time_t Time::ToTimeT() const {
Expand All @@ -62,9 +62,8 @@ time_t Time::ToTimeT() const {

// static
Time Time::FromDoubleT(double dt) {
return Time(static_cast<int64>((dt *
static_cast<double>(kMicrosecondsPerSecond)) +
kTimeTToMicrosecondsOffset));
return (dt * static_cast<double>(kMicrosecondsPerSecond)) +
kTimeTToMicrosecondsOffset;
}

double Time::ToDoubleT() const {
Expand Down
8 changes: 4 additions & 4 deletions base/time.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2006-2008 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.

Expand Down Expand Up @@ -313,10 +313,10 @@ class Time {

// Return a new time modified by some delta.
Time operator+(TimeDelta delta) const {
return Time(us_ + delta.delta_);
return us_ + delta.delta_;
}
Time operator-(TimeDelta delta) const {
return Time(us_ - delta.delta_);
return us_ - delta.delta_;
}

// Comparison operators
Expand Down Expand Up @@ -350,7 +350,7 @@ class Time {
// |is_local = true| or UTC |is_local = false|.
static Time FromExploded(bool is_local, const Exploded& exploded);

explicit Time(int64 us) : us_(us) {
Time(int64 us) : us_(us) {
}

// The representation of Jan 1, 1970 UTC in microseconds since the
Expand Down
2 changes: 1 addition & 1 deletion base/time_posix.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2006-2008 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.

Expand Down
5 changes: 1 addition & 4 deletions base/waitable_event.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2006-2008 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.

Expand Down Expand Up @@ -121,9 +121,6 @@ class WaitableEvent {
// pointers match then this function is called as a final check. See the
// comments in ~Handle for why.
virtual bool Compare(void* tag) = 0;

protected:
~Waiter() {}
};

private:
Expand Down
6 changes: 3 additions & 3 deletions base/waitable_event_watcher_unittest.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2006-2008 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.

Expand Down Expand Up @@ -38,7 +38,7 @@ void RunTest_BasicSignal(MessageLoop::Type message_loop_type) {
WaitableEvent event(true, false);

WaitableEventWatcher watcher;
EXPECT_TRUE(NULL == watcher.GetWatchedEvent());
EXPECT_EQ(NULL, watcher.GetWatchedEvent());

QuitDelegate delegate;
watcher.StartWatching(&event, &delegate);
Expand All @@ -48,7 +48,7 @@ void RunTest_BasicSignal(MessageLoop::Type message_loop_type) {

MessageLoop::current()->Run();

EXPECT_TRUE(NULL == watcher.GetWatchedEvent());
EXPECT_EQ(NULL, watcher.GetWatchedEvent());
}

void RunTest_BasicCancel(MessageLoop::Type message_loop_type) {
Expand Down
4 changes: 1 addition & 3 deletions chrome/browser/autocomplete/autocomplete.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2006-2008 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.

Expand Down Expand Up @@ -466,8 +466,6 @@ class AutocompleteProvider
// them all again when this is called anyway, so such a parameter wouldn't
// actually be useful.
virtual void OnProviderUpdate(bool updated_matches) = 0;
protected:
~ACProviderListener() {}
};

AutocompleteProvider(ACProviderListener* listener,
Expand Down
4 changes: 1 addition & 3 deletions chrome/browser/autocomplete/autocomplete_edit.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2006-2008 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.

Expand Down Expand Up @@ -51,8 +51,6 @@ class AutocompleteEditController {

// Returns the title of the current page.
virtual std::wstring GetTitle() const = 0;
protected:
~AutocompleteEditController() {}
};

class AutocompleteEditModel {
Expand Down
Loading

0 comments on commit 5a3b914

Please sign in to comment.