Bug 714572 - Fix nearly all clang warnings building image/. r=bholley

--HG--
extra : rebase_source : 585983448ac6dae86d309530d5ddbda856bdcfa9
This commit is contained in:
Jeff Walden 2012-01-02 14:23:41 -06:00
parent 99b28861ed
commit 82023879ca
17 changed files with 60 additions and 36 deletions

View File

@ -39,6 +39,8 @@
#ifndef nsIconChannel_h_
#define nsIconChannel_h_
#include "mozilla/Attributes.h"
#include "nsIChannel.h"
#include "nsIURI.h"
#include "nsIIconURI.h"
@ -49,7 +51,7 @@
* It asks Android for an icon, and creates a new channel for
* that file to which all calls will be proxied.
*/
class nsIconChannel : public nsIChannel {
class nsIconChannel MOZ_FINAL : public nsIChannel {
public:
NS_DECL_ISUPPORTS
NS_FORWARD_NSIREQUEST(mRealChannel->)

View File

@ -283,6 +283,7 @@ moz_gtk_icon_size(const char *name)
return GTK_ICON_SIZE_MENU;
}
#if defined(MOZ_ENABLE_GNOMEUI) || defined(MOZ_ENABLE_GIO)
static PRInt32
GetIconSize(nsIMozIconURI *aIconURI)
{
@ -320,6 +321,7 @@ ScaleIconBuf(GdkPixbuf **aBuf, PRInt32 iconSize)
}
return NS_OK;
}
#endif
#ifdef MOZ_ENABLE_GNOMEUI
nsresult

View File

@ -37,6 +37,8 @@
#ifndef nsIconChannel_h_
#define nsIconChannel_h_
#include "mozilla/Attributes.h"
#include "nsIChannel.h"
#include "nsIStreamListener.h"
#include "nsIURI.h"
@ -48,7 +50,7 @@
* gtk/gnome for an icon, saves it as a tmp icon, and creates a new channel for
* that file to which all calls will be proxied.
*/
class nsIconChannel : public nsIChannel {
class nsIconChannel MOZ_FINAL : public nsIChannel {
public:
NS_DECL_ISUPPORTS
NS_FORWARD_NSIREQUEST(mRealChannel->)

View File

@ -41,6 +41,8 @@
#ifndef nsIconChannel_h___
#define nsIconChannel_h___
#include "mozilla/Attributes.h"
#include "nsCOMPtr.h"
#include "nsXPIDLString.h"
#include "nsIChannel.h"
@ -53,7 +55,7 @@
class nsIFile;
class nsIconChannel : public nsIChannel, public nsIStreamListener
class nsIconChannel MOZ_FINAL : public nsIChannel, public nsIStreamListener
{
public:
NS_DECL_ISUPPORTS

View File

@ -41,6 +41,8 @@
#ifndef nsIconChannel_h___
#define nsIconChannel_h___
#include "mozilla/Attributes.h"
#include "nsCOMPtr.h"
#include "nsXPIDLString.h"
#include "nsIChannel.h"
@ -53,7 +55,7 @@
class nsIFile;
class nsIconChannel : public nsIChannel, public nsIStreamListener
class nsIconChannel MOZ_FINAL : public nsIChannel, public nsIStreamListener
{
public:
NS_DECL_ISUPPORTS

View File

@ -38,6 +38,8 @@
#ifndef nsIconChannel_h_
#define nsIconChannel_h_
#include "mozilla/Attributes.h"
#include "nsIChannel.h"
#include "nsIStreamListener.h"
#include "nsIURI.h"
@ -49,7 +51,7 @@
* qt for an icon, and creates a new channel for
* that file to which all calls will be proxied.
*/
class nsIconChannel : public nsIChannel {
class nsIconChannel MOZ_FINAL : public nsIChannel {
public:
NS_DECL_ISUPPORTS
NS_FORWARD_NSIREQUEST(mRealChannel->)

View File

@ -40,6 +40,8 @@
#ifndef nsIconChannel_h___
#define nsIconChannel_h___
#include "mozilla/Attributes.h"
#include "nsCOMPtr.h"
#include "nsXPIDLString.h"
#include "nsIChannel.h"
@ -55,7 +57,7 @@
class nsIFile;
class nsIconChannel : public nsIChannel, public nsIStreamListener
class nsIconChannel MOZ_FINAL : public nsIChannel, public nsIStreamListener
{
public:
NS_DECL_ISUPPORTS

View File

@ -35,11 +35,12 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Attributes.h"
#include "mozilla/ReentrantMonitor.h"
#include "imgIEncoder.h"
#include "BMPFileHeaders.h"
#include "mozilla/ReentrantMonitor.h"
#include "nsCOMPtr.h"
#define NS_BMPENCODER_CID \
@ -53,7 +54,7 @@
// Provides BMP encoding functionality. Use InitFromData() to do the
// encoding. See that function definition for encoding options.
class nsBMPEncoder : public imgIEncoder
class nsBMPEncoder MOZ_FINAL : public imgIEncoder
{
typedef mozilla::ReentrantMonitor ReentrantMonitor;
public:

View File

@ -50,15 +50,13 @@ using namespace mozilla::imagelib;
NS_IMPL_THREADSAFE_ISUPPORTS3(nsICOEncoder, imgIEncoder, nsIInputStream, nsIAsyncInputStream)
nsICOEncoder::nsICOEncoder() : mFinished(false),
mImageBufferStart(nsnull),
nsICOEncoder::nsICOEncoder() : mImageBufferStart(nsnull),
mImageBufferCurr(0),
mImageBufferSize(0),
mImageBufferReadPoint(0),
mCallback(nsnull),
mCallbackTarget(nsnull),
mNotifyThreshold(0),
mUsePNG(true)
mFinished(false),
mUsePNG(true),
mNotifyThreshold(0)
{
}

View File

@ -35,10 +35,11 @@
*
* ***** END LICENSE BLOCK ***** */
#include "imgIEncoder.h"
#include "mozilla/Attributes.h"
#include "mozilla/ReentrantMonitor.h"
#include "imgIEncoder.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "ICOFileHeaders.h"
@ -57,7 +58,7 @@ class nsPNGEncoder;
// Provides ICO encoding functionality. Use InitFromData() to do the
// encoding. See that function definition for encoding options.
class nsICOEncoder : public imgIEncoder
class nsICOEncoder MOZ_FINAL : public imgIEncoder
{
typedef mozilla::ReentrantMonitor ReentrantMonitor;
public:

View File

@ -35,10 +35,11 @@
*
* ***** END LICENSE BLOCK ***** */
#include "imgIEncoder.h"
#include "mozilla/Attributes.h"
#include "mozilla/ReentrantMonitor.h"
#include "imgIEncoder.h"
#include "nsCOMPtr.h"
#include <png.h>
@ -54,7 +55,7 @@
// Provides PNG encoding functionality. Use InitFromData() to do the
// encoding. See that function definition for encoding options.
class nsPNGEncoder : public imgIEncoder
class nsPNGEncoder MOZ_FINAL : public imgIEncoder
{
typedef mozilla::ReentrantMonitor ReentrantMonitor;
public:

View File

@ -138,4 +138,4 @@ enum ERLEState {
eRLEStateAbsoluteModePadded ///< As above, but another byte of data has to be read as padding
};
#endif
#endif

View File

@ -48,13 +48,13 @@ Decoder::Decoder(RasterImage &aImage, imgIDecoderObserver* aObserver)
: mImage(aImage)
, mObserver(aObserver)
, mDecodeFlags(0)
, mDecodeDone(false)
, mDataError(false)
, mFrameCount(0)
, mFailCode(NS_OK)
, mInitialized(false)
, mSizeDecode(false)
, mInFrame(false)
, mDecodeDone(false)
, mDataError(false)
, mIsAnimated(false)
{
}

View File

@ -41,6 +41,8 @@
#ifndef mozilla_imagelib_SVGDocumentWrapper_h_
#define mozilla_imagelib_SVGDocumentWrapper_h_
#include "mozilla/Attributes.h"
#include "nsCOMPtr.h"
#include "nsIStreamListener.h"
#include "nsIObserver.h"
@ -62,9 +64,9 @@ class nsSVGSVGElement;
namespace mozilla {
namespace imagelib {
class SVGDocumentWrapper : public nsIStreamListener,
public nsIObserver,
nsSupportsWeakReference
class SVGDocumentWrapper MOZ_FINAL : public nsIStreamListener,
public nsIObserver,
nsSupportsWeakReference
{
public:
SVGDocumentWrapper();

View File

@ -37,6 +37,10 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Attributes.h"
#include "mozilla/FunctionTimer.h"
#include "mozilla/Preferences.h"
#include "ImageLogging.h"
#include "imgLoader.h"
#include "imgRequestProxy.h"
@ -89,9 +93,6 @@
#include "nsIContentSecurityPolicy.h"
#include "nsIChannelPolicy.h"
#include "mozilla/FunctionTimer.h"
#include "mozilla/Preferences.h"
#include "nsContentUtils.h"
using namespace mozilla;
@ -136,7 +137,7 @@ static void PrintImageDecoders()
#endif
class imgMemoryReporter :
class imgMemoryReporter MOZ_FINAL :
public nsIMemoryReporter
{
public:
@ -759,7 +760,7 @@ nsresult imgLoader::CreateNewProxyForRequest(imgRequest *aRequest, nsILoadGroup
return NS_OK;
}
class imgCacheObserver : public nsIObserver
class imgCacheObserver MOZ_FINAL : public nsIObserver
{
public:
NS_DECL_ISUPPORTS
@ -783,7 +784,8 @@ imgCacheObserver::Observe(nsISupports* aSubject, const char* aTopic, const PRUni
return NS_OK;
}
class imgCacheExpirationTracker : public nsExpirationTracker<imgCacheEntry, 3>
class imgCacheExpirationTracker MOZ_FINAL
: public nsExpirationTracker<imgCacheEntry, 3>
{
enum { TIMEOUT_SECONDS = 10 };
public:

View File

@ -41,6 +41,8 @@
#ifndef imgLoader_h__
#define imgLoader_h__
#include "mozilla/Attributes.h"
#include "imgILoader.h"
#include "imgICache.h"
#include "nsWeakReference.h"
@ -392,9 +394,10 @@ private:
* nsIInterfaceRequestor and gives out itself for nsIProgressEventSink calls,
* and forwards everything else to the channel's notification callbacks.
*/
class nsProgressNotificationProxy : public nsIProgressEventSink
, public nsIChannelEventSink
, public nsIInterfaceRequestor
class nsProgressNotificationProxy MOZ_FINAL
: public nsIProgressEventSink
, public nsIChannelEventSink
, public nsIInterfaceRequestor
{
public:
nsProgressNotificationProxy(nsIChannel* channel,

View File

@ -39,6 +39,8 @@
#ifndef NSEXPIRATIONTRACKER_H_
#define NSEXPIRATIONTRACKER_H_
#include "mozilla/Attributes.h"
#include "prlog.h"
#include "nsTArray.h"
#include "nsITimer.h"