summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcraig.schlenter@chromium.org <craig.schlenter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-13 16:27:18 +0000
committercraig.schlenter@chromium.org <craig.schlenter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-13 16:27:18 +0000
commit8b8fab971151ba246c0930fa25c68b705f6a6c0b (patch)
tree0c6a51a8823d8fa36636e16ffa5e85a480c8716d
parent0d75bad6ecfdb9c7611f1001c5a1e9a0347b2337 (diff)
downloadchromium_src-8b8fab971151ba246c0930fa25c68b705f6a6c0b.zip
chromium_src-8b8fab971151ba246c0930fa25c68b705f6a6c0b.tar.gz
chromium_src-8b8fab971151ba246c0930fa25c68b705f6a6c0b.tar.bz2
Linux: fix a bunch of NULL vs. 0 issues spotted by gcc 4.5.
There are more gcc 4.5 issues to be solved so GYP_DEFINES=='werror=' is still required to build with 4.5 even with these changes. BUG=66652 TEST=compiles with gcc 4.5 and trybots Review URL: http://codereview.chromium.org/6186008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71325 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--app/gtk_dnd_util_unittest.cc8
-rw-r--r--chrome/browser/automation/automation_provider_observers.cc2
-rw-r--r--chrome/browser/gtk/options/languages_page_gtk_unittest.cc2
-rw-r--r--chrome/browser/history/top_sites.cc4
-rw-r--r--chrome/browser/ppapi_plugin_process_host.cc8
-rw-r--r--chrome/browser/process_singleton_uitest.cc2
-rw-r--r--chrome/browser/sync/syncable/syncable.cc2
-rw-r--r--chrome/browser/ui/tabs/dock_info_unittest.cc4
-rw-r--r--chrome/common/plugin_messages.cc4
-rw-r--r--chrome/renderer/pepper_plugin_delegate_impl.cc2
-rw-r--r--chrome/renderer/render_view_browsertest.cc2
-rw-r--r--courgette/streams_unittest.cc8
-rw-r--r--ipc/ipc_tests.cc6
13 files changed, 27 insertions, 27 deletions
diff --git a/app/gtk_dnd_util_unittest.cc b/app/gtk_dnd_util_unittest.cc
index 1de8991..cefc6dd 100644
--- a/app/gtk_dnd_util_unittest.cc
+++ b/app/gtk_dnd_util_unittest.cc
@@ -46,7 +46,7 @@ TEST(GtkDndUtilTest, ExtractNamedURLInvalidURL) {
GURL url;
string16 title;
- EXPECT_EQ(false, gtk_dnd_util::ExtractNamedURL(&data, &url, &title));
+ EXPECT_FALSE(gtk_dnd_util::ExtractNamedURL(&data, &url, &title));
}
TEST(GtkDndUtilTest, ExtractNamedURLInvalidInput) {
@@ -56,13 +56,13 @@ TEST(GtkDndUtilTest, ExtractNamedURLInvalidInput) {
data.data = NULL;
data.length = 0;
- EXPECT_EQ(false, gtk_dnd_util::ExtractNamedURL(&data, &url, &title));
+ EXPECT_FALSE(gtk_dnd_util::ExtractNamedURL(&data, &url, &title));
guchar empty_data[] = "";
data.data = empty_data;
data.length = 0;
- EXPECT_EQ(false, gtk_dnd_util::ExtractNamedURL(&data, &url, &title));
+ EXPECT_FALSE(gtk_dnd_util::ExtractNamedURL(&data, &url, &title));
const std::string kTitle = "title";
Pickle pickle;
@@ -73,5 +73,5 @@ TEST(GtkDndUtilTest, ExtractNamedURLInvalidInput) {
data.data = test_data.get();
data.length = pickle.size();
- EXPECT_EQ(false, gtk_dnd_util::ExtractNamedURL(&data, &url, &title));
+ EXPECT_FALSE(gtk_dnd_util::ExtractNamedURL(&data, &url, &title));
}
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 925a1bf..c6719bb 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -1431,7 +1431,7 @@ NTPInfoObserver::NTPInfoObserver(
: automation_(automation),
reply_message_(reply_message),
consumer_(consumer),
- request_(NULL),
+ request_(0),
ntp_info_(new DictionaryValue) {
top_sites_ = automation_->profile()->GetTopSites();
if (!top_sites_) {
diff --git a/chrome/browser/gtk/options/languages_page_gtk_unittest.cc b/chrome/browser/gtk/options/languages_page_gtk_unittest.cc
index d861c35..0cb6298 100644
--- a/chrome/browser/gtk/options/languages_page_gtk_unittest.cc
+++ b/chrome/browser/gtk/options/languages_page_gtk_unittest.cc
@@ -256,7 +256,7 @@ TEST_F(LanguagesPageGtkTest, EnableSpellChecking) {
gtk_button_clicked(GTK_BUTTON(page.enable_spellchecking_checkbox_));
EXPECT_EQ(FALSE, gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(page.enable_spellchecking_checkbox_)));
- EXPECT_EQ(false, profile_->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck));
+ EXPECT_FALSE(profile_->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck));
gtk_button_clicked(GTK_BUTTON(page.enable_spellchecking_checkbox_));
EXPECT_EQ(TRUE, gtk_toggle_button_get_active(
diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc
index 1635523..a1c0a17 100644
--- a/chrome/browser/history/top_sites.cc
+++ b/chrome/browser/history/top_sites.cc
@@ -443,7 +443,7 @@ void TopSites::DiffMostVisited(const MostVisitedURLList& old_list,
CancelableRequestProvider::Handle TopSites::StartQueryForMostVisited() {
DCHECK(loaded_);
if (!profile_)
- return NULL;
+ return 0;
HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
// |hs| may be null during unit tests.
@@ -454,7 +454,7 @@ CancelableRequestProvider::Handle TopSites::StartQueryForMostVisited() {
&cancelable_consumer_,
NewCallback(this, &TopSites::OnTopSitesAvailableFromHistory));
}
- return NULL;
+ return 0;
}
TopSites::~TopSites() {
diff --git a/chrome/browser/ppapi_plugin_process_host.cc b/chrome/browser/ppapi_plugin_process_host.cc
index c90d1f4..225cc80 100644
--- a/chrome/browser/ppapi_plugin_process_host.cc
+++ b/chrome/browser/ppapi_plugin_process_host.cc
@@ -28,7 +28,7 @@ void PpapiPluginProcessHost::Init(const FilePath& path,
reply_msg_.reset(reply_msg);
if (!CreateChannel()) {
- ReplyToRenderer(NULL, IPC::ChannelHandle());
+ ReplyToRenderer(base::kNullProcessHandle, IPC::ChannelHandle());
return;
}
@@ -38,7 +38,7 @@ void PpapiPluginProcessHost::Init(const FilePath& path,
FilePath exe_path = ChildProcessHost::GetChildPath(plugin_launcher.empty());
if (exe_path.empty()) {
- ReplyToRenderer(NULL, IPC::ChannelHandle());
+ ReplyToRenderer(base::kNullProcessHandle, IPC::ChannelHandle());
return;
}
@@ -92,13 +92,13 @@ void PpapiPluginProcessHost::OnChannelConnected(int32 peer_pid) {
PpapiMsg_LoadPlugin* msg = new PpapiMsg_LoadPlugin(
plugins_renderer_handle, plugin_path_, filter_->render_process_id());
if (!Send(msg)) // Just send an empty handle on failure.
- ReplyToRenderer(NULL, IPC::ChannelHandle());
+ ReplyToRenderer(base::kNullProcessHandle, IPC::ChannelHandle());
// This function will result in OnChannelCreated getting called to finish.
}
void PpapiPluginProcessHost::OnChannelError() {
if (reply_msg_.get())
- ReplyToRenderer(NULL, IPC::ChannelHandle());
+ ReplyToRenderer(base::kNullProcessHandle, IPC::ChannelHandle());
}
void PpapiPluginProcessHost::OnPluginLoaded(
diff --git a/chrome/browser/process_singleton_uitest.cc b/chrome/browser/process_singleton_uitest.cc
index 38a0e48..f3ea3b4 100644
--- a/chrome/browser/process_singleton_uitest.cc
+++ b/chrome/browser/process_singleton_uitest.cc
@@ -38,7 +38,7 @@ class ChromeStarter : public base::RefCountedThreadSafe<ChromeStarter> {
explicit ChromeStarter(int timeout_ms, const FilePath& user_data_dir)
: ready_event_(false /* manual */, false /* signaled */),
done_event_(false /* manual */, false /* signaled */),
- process_handle_(NULL),
+ process_handle_(base::kNullProcessHandle),
process_terminated_(false),
timeout_ms_(timeout_ms),
user_data_dir_(user_data_dir) {
diff --git a/chrome/browser/sync/syncable/syncable.cc b/chrome/browser/sync/syncable/syncable.cc
index 2794efa..60140ac 100644
--- a/chrome/browser/sync/syncable/syncable.cc
+++ b/chrome/browser/sync/syncable/syncable.cc
@@ -1087,7 +1087,7 @@ BaseTransaction::BaseTransaction(Directory* directory)
dirkernel_(NULL),
name_(NULL),
source_file_(NULL),
- line_(NULL),
+ line_(0),
writer_(INVALID) {
}
diff --git a/chrome/browser/ui/tabs/dock_info_unittest.cc b/chrome/browser/ui/tabs/dock_info_unittest.cc
index ee4557e..8bb52a5 100644
--- a/chrome/browser/ui/tabs/dock_info_unittest.cc
+++ b/chrome/browser/ui/tabs/dock_info_unittest.cc
@@ -101,7 +101,7 @@ TEST(DockInfoTest, IsCloseToMonitorPoint) {
TEST(DockInfoTest, IsValidForPoint) {
DockInfo d;
- EXPECT_EQ(false, d.IsValidForPoint(gfx::Point(0, 0)));
+ EXPECT_FALSE(d.IsValidForPoint(gfx::Point(0, 0)));
d.set_monitor_bounds(gfx::Rect(0, 0, kPopupWidth, kPopupHeight));
d.set_hot_spot(gfx::Point(0, 0));
d.set_type(DockInfo::LEFT_HALF);
@@ -126,7 +126,7 @@ TEST(DockInfoTest, equals) {
DockInfo dd;
EXPECT_EQ(true, d.equals(dd));
d.set_type(DockInfo::MAXIMIZE);
- EXPECT_EQ(false, d.equals(dd));
+ EXPECT_FALSE(d.equals(dd));
}
TEST(DockInfoTest, CheckMonitorPoint) {
diff --git a/chrome/common/plugin_messages.cc b/chrome/common/plugin_messages.cc
index d9117ff..26d2aec 100644
--- a/chrome/common/plugin_messages.cc
+++ b/chrome/common/plugin_messages.cc
@@ -57,8 +57,8 @@ NPVariant_Param::~NPVariant_Param() {
PluginMsg_UpdateGeometry_Param::PluginMsg_UpdateGeometry_Param()
: transparent(false),
#if !defined(OS_MACOSX)
- windowless_buffer(NULL),
- background_buffer(NULL)
+ windowless_buffer(TransportDIB::DefaultHandleValue()),
+ background_buffer(TransportDIB::DefaultHandleValue())
#else
ack_key(-1)
#endif // !defined(OS_MACOSX)
diff --git a/chrome/renderer/pepper_plugin_delegate_impl.cc b/chrome/renderer/pepper_plugin_delegate_impl.cc
index bdbee23..d96fe71 100644
--- a/chrome/renderer/pepper_plugin_delegate_impl.cc
+++ b/chrome/renderer/pepper_plugin_delegate_impl.cc
@@ -384,7 +384,7 @@ PepperPluginDelegateImpl::CreatePepperPlugin(const FilePath& path) {
return module; // Return the NULL module.
// Out of process: have the browser start the plugin process for us.
- base::ProcessHandle plugin_process_handle = NULL;
+ base::ProcessHandle plugin_process_handle = base::kNullProcessHandle;
IPC::ChannelHandle channel_handle;
render_view_->Send(new ViewHostMsg_OpenChannelToPepperPlugin(
path, &plugin_process_handle, &channel_handle));
diff --git a/chrome/renderer/render_view_browsertest.cc b/chrome/renderer/render_view_browsertest.cc
index 51303e4..ad145e7 100644
--- a/chrome/renderer/render_view_browsertest.cc
+++ b/chrome/renderer/render_view_browsertest.cc
@@ -676,7 +676,7 @@ TEST_F(RenderViewTest, OnHandleKeyboardEvent) {
// We format a string that emulates a DOM-event string produced hy
// our JavaScript function. (See the above comment for the format.)
static char expected_result[1024];
- expected_result[0] = NULL;
+ expected_result[0] = 0;
base::snprintf(&expected_result[0],
sizeof(expected_result),
"\n" // texts in the <input> element
diff --git a/courgette/streams_unittest.cc b/courgette/streams_unittest.cc
index 63393a3..e82c2d7 100644
--- a/courgette/streams_unittest.cc
+++ b/courgette/streams_unittest.cc
@@ -174,7 +174,7 @@ TEST(StreamsTest, StreamSetReadWrite) {
courgette::SourceStreamSet subset1;
bool can_read_1 = in.ReadSet(&subset1);
EXPECT_EQ(true, can_read_1);
- EXPECT_EQ(false, in.Empty());
+ EXPECT_FALSE(in.Empty());
courgette::SourceStreamSet subset2;
bool can_read_2 = in.ReadSet(&subset2);
@@ -183,10 +183,10 @@ TEST(StreamsTest, StreamSetReadWrite) {
courgette::SourceStreamSet subset3;
bool can_read_3 = in.ReadSet(&subset3);
- EXPECT_EQ(false, can_read_3);
+ EXPECT_FALSE(can_read_3);
- EXPECT_EQ(false, subset1.Empty());
- EXPECT_EQ(false, subset1.Empty());
+ EXPECT_FALSE(subset1.Empty());
+ EXPECT_FALSE(subset1.Empty());
uint32 datum;
EXPECT_EQ(true, subset1.stream(3)->ReadVarint32(&datum));
diff --git a/ipc/ipc_tests.cc b/ipc/ipc_tests.cc
index 7c0b718..93276f4 100644
--- a/ipc/ipc_tests.cc
+++ b/ipc/ipc_tests.cc
@@ -90,7 +90,7 @@ base::ProcessHandle IPCChannelTest::SpawnChild(ChildType child_type,
fds_to_map.push_back(std::pair<int, int>(ipcfd, kPrimaryIPCChannel + 3));
}
- base::ProcessHandle ret = NULL;
+ base::ProcessHandle ret = base::kNullProcessHandle;
switch (child_type) {
case TEST_CLIENT:
ret = MultiProcessTest::SpawnChild("RunTestClient",
@@ -123,7 +123,7 @@ base::ProcessHandle IPCChannelTest::SpawnChild(ChildType child_type,
debug_on_start);
break;
default:
- return NULL;
+ return base::kNullProcessHandle;
break;
}
return ret;
@@ -367,7 +367,7 @@ MULTIPROCESS_TEST_MAIN(RunTestClient) {
// run message loop
MessageLoop::current()->Run();
// return true;
- return NULL;
+ return 0;
}
#endif // !PERFORMANCE_TEST