Bug 780489: Fix some compiler warnings in plugin and mac code. r=smichaud
authorJosh Aas <joshmoz@gmail.com>
Tue, 07 Aug 2012 00:09:23 -0400
changeset 101631 533e0681e6ff2d4909e5d7ea0f8a47d607c0b954
parent 101630 b6fb1ca1cfc9ecad3c4a2310a73fd66a6a30e131
child 101632 5a6ac05db368df50b92e501801436c127733ff25
push idunknown
push userunknown
push dateunknown
reviewerssmichaud
bugs780489
milestone17.0a1
Bug 780489: Fix some compiler warnings in plugin and mac code. r=smichaud
dom/plugins/base/nsPluginHost.cpp
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginInstanceParent.h
widget/cocoa/nsFilePicker.mm
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -2196,17 +2196,17 @@ nsresult nsPluginHost::ScanPluginsDirect
     if (!seenBefore) {
       // We have a valid new plugin so report that plugins have changed.
       *aPluginsChanged = true;
     }
     
     // Avoid adding different versions of the same plugin if they are running 
     // in-process, otherwise we risk undefined behaviour.
     if (!nsNPAPIPlugin::RunPluginOOP(pluginTag)) {
-      if (nsPluginTag *duplicate = HaveSamePlugin(pluginTag)) {
+      if (HaveSamePlugin(pluginTag)) {
         continue;
       }
     }
     
     // Don't add the same plugin again if it hasn't changed
     if (nsPluginTag* duplicate = FirstPluginWithPath(pluginTag->mFullPath)) {
       if (LL_EQ(pluginTag->mLastModifiedTime, duplicate->mLastModifiedTime)) {
         continue;
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -7,17 +7,16 @@
 #include "PluginInstanceParent.h"
 #include "BrowserStreamParent.h"
 #include "PluginBackgroundDestroyer.h"
 #include "PluginModuleParent.h"
 #include "PluginStreamParent.h"
 #include "StreamNotifyParent.h"
 #include "npfunctions.h"
 #include "nsAutoPtr.h"
-#include "mozilla/unused.h"
 #include "gfxASurface.h"
 #include "gfxContext.h"
 #include "gfxPlatform.h"
 #include "gfxSharedImageSurface.h"
 #include "nsNPAPIPluginInstance.h"
 #ifdef MOZ_X11
 #include "gfxXlibSurface.h"
 #endif
--- a/dom/plugins/ipc/PluginInstanceParent.h
+++ b/dom/plugins/ipc/PluginInstanceParent.h
@@ -23,16 +23,17 @@
 #include "nsHashKeys.h"
 #include "nsRect.h"
 #include "gfxASurface.h"
 #include "ImageLayers.h"
 #ifdef MOZ_X11
 class gfxXlibSurface;
 #endif
 #include "nsGUIEvent.h"
+#include "mozilla/unused.h"
 
 namespace mozilla {
 namespace plugins {
 
 class PBrowserStreamParent;
 class PluginModuleParent;
 
 class PluginInstanceParent : public PPluginInstanceParent
@@ -275,17 +276,17 @@ public:
     nsresult BeginUpdateBackground(const nsIntRect& aRect,
                                    gfxContext** aCtx);
     nsresult EndUpdateBackground(gfxContext* aCtx,
                                  const nsIntRect& aRect);
 #if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
     nsresult HandleGUIEvent(const nsGUIEvent& anEvent, bool* handled);
 #endif
 
-    void DidComposite() { SendNPP_DidComposite(); }
+    void DidComposite() { unused << SendNPP_DidComposite(); }
 
 private:
     // Create an appropriate platform surface for a background of size
     // |aSize|.  Return true if successful.
     bool CreateBackground(const nsIntSize& aSize);
     void DestroyBackground();
     SurfaceDescriptor BackgroundDescriptor() /*const*/;
 
--- a/widget/cocoa/nsFilePicker.mm
+++ b/widget/cocoa/nsFilePicker.mm
@@ -516,18 +516,17 @@ nsFilePicker::GetFilterList()
     return nil;
   }
 
   // The extensions in filterWide are in the format "*.ext" but are expected
   // in the format "ext" by NSOpenPanel. So we need to filter some characters.
   NSMutableString* filterString = [[[NSMutableString alloc] initWithString:
                                     [NSString stringWithCharacters:filterWide.get()
 				              length:filterWide.Length()]] autorelease];
-  NSCharacterSet *set = [NSCharacterSet characterSetWithCharactersInString:
-                          [NSString stringWithString:@". *"]];
+  NSCharacterSet *set = [NSCharacterSet characterSetWithCharactersInString:@". *"];
   NSRange range = [filterString rangeOfCharacterFromSet:set];
   while (range.length) {
     [filterString replaceCharactersInRange:range withString:@""];
     range = [filterString rangeOfCharacterFromSet:set];
   }
 
   return [[[NSArray alloc] initWithArray:
            [filterString componentsSeparatedByString:@";"]] autorelease];