From 4c66d2a859776c05767f05472cbfa9519ca01aff Mon Sep 17 00:00:00 2001 From: "craig.schlenter@chromium.org" Date: Tue, 11 May 2010 04:36:05 +0000 Subject: Linux: fix compilation error with gcc 4.5. Avoid a gcc 4.5 warning/error for values that aren't part of NPNVariable. Also drop some unnecessary static_casts by swapping from an int to a size_t in TemplateURLRef's Replacement struct and use platform specific NULL or 0 constants in a couple of places. BUG=43341 TEST=chrome target compiles with gcc 4.5. Review URL: http://codereview.chromium.org/2019002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46889 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/plugins/plugin_host.cc | 2 +- webkit/glue/plugins/webplugin_impl.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'webkit') diff --git a/webkit/glue/plugins/plugin_host.cc b/webkit/glue/plugins/plugin_host.cc index 41d2fa2..a6e0fde 100644 --- a/webkit/glue/plugins/plugin_host.cc +++ b/webkit/glue/plugins/plugin_host.cc @@ -656,7 +656,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { NPError rv = NPERR_GENERIC_ERROR; - switch (variable) { + switch (static_cast(variable)) { case NPNVWindowNPObject: { scoped_refptr plugin = FindInstance(id); NPObject *np_object = plugin->webplugin()->GetWindowScriptNPObject(); diff --git a/webkit/glue/plugins/webplugin_impl.cc b/webkit/glue/plugins/webplugin_impl.cc index 8a0e75e..693232b 100644 --- a/webkit/glue/plugins/webplugin_impl.cc +++ b/webkit/glue/plugins/webplugin_impl.cc @@ -412,7 +412,7 @@ WebPluginImpl::WebPluginImpl( WebFrame* webframe, const WebPluginParams& params, const base::WeakPtr& page_delegate) : windowless_(false), - window_(0), + window_(gfx::kNullPluginWindow), accepts_input_events_(false), page_delegate_(page_delegate), webframe_(webframe), @@ -473,7 +473,7 @@ void WebPluginImpl::SetWindow(gfx::PluginWindowHandle window) { void WebPluginImpl::WillDestroyWindow(gfx::PluginWindowHandle window) { DCHECK_EQ(window, window_); - window_ = 0; + window_ = gfx::kNullPluginWindow; if (page_delegate_) page_delegate_->WillDestroyPluginWindow(window); } -- cgit v1.1