Bug 743573 - Fix a number of build warnings in dom/; r=mounir

This commit is contained in:
Ms2ger 2012-08-07 09:06:29 +02:00
parent 3df981cb3a
commit 94bf1722ed
39 changed files with 95 additions and 58 deletions

View File

@ -70,7 +70,7 @@ XULSelectControlAccessible::SelectedItems()
xulMultiSelect->GetSelectedCount(&length);
for (PRInt32 index = 0; index < length; index++) {
nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
xulMultiSelect->GetSelectedItem(index, getter_AddRefs(itemElm));
xulMultiSelect->MultiGetSelectedItem(index, getter_AddRefs(itemElm));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
Accessible* item = mDoc->GetAccessible(itemNode);
if (item)
@ -78,15 +78,15 @@ XULSelectControlAccessible::SelectedItems()
false);
}
} else { // Single select?
nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
if(itemNode) {
Accessible* item = mDoc->GetAccessible(itemNode);
if (item)
selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
false);
}
nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
if (itemNode) {
Accessible* item = mDoc->GetAccessible(itemNode);
if (item)
selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
false);
}
}
nsIMutableArray* items = nullptr;
@ -102,7 +102,7 @@ XULSelectControlAccessible::GetSelectedItem(PRUint32 aIndex)
nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
if (multiSelectControl)
multiSelectControl->GetSelectedItem(aIndex, getter_AddRefs(itemElm));
multiSelectControl->MultiGetSelectedItem(aIndex, getter_AddRefs(itemElm));
else if (aIndex == 0)
mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));

View File

@ -395,7 +395,7 @@ interface nsIXHRSendable : nsISupports {
/**
* @deprecated
*/
[deprecated, scriptable, uuid(8ae70a39-edf1-40b4-a992-472d23421c25)]
[scriptable, uuid(8ae70a39-edf1-40b4-a992-472d23421c25)]
interface nsIJSXMLHttpRequest : nsISupports {
};

View File

@ -781,7 +781,7 @@ nsXULElement::RemoveChildAt(PRUint32 aIndex, bool aNotify)
controlElement->GetSelectedCount(&length);
for (PRInt32 i = 0; i < length; i++) {
nsCOMPtr<nsIDOMXULSelectControlItemElement> node;
controlElement->GetSelectedItem(i, getter_AddRefs(node));
controlElement->MultiGetSelectedItem(i, getter_AddRefs(node));
// we need to QI here to do an XPCOM-correct pointercompare
nsCOMPtr<nsIDOMElement> selElem = do_QueryInterface(node);
if (selElem == oldKidElem &&

View File

@ -7,6 +7,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

View File

@ -128,7 +128,6 @@ private:
DOMTimeMilliSec mBeforeUnloadStart;
DOMTimeMilliSec mUnloadStart;
DOMTimeMilliSec mUnloadEnd;
DOMTimeMilliSec mNavigationEnd;
DOMTimeMilliSec mLoadEventStart;
DOMTimeMilliSec mLoadEventEnd;

View File

@ -6,6 +6,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
MODULE = dom
LIBRARY_NAME = dombindings_s

View File

@ -150,14 +150,20 @@ FileRequest::FireProgressEvent(PRUint64 aLoaded, PRUint64 aTotal)
nsRefPtr<nsDOMProgressEvent> event = new nsDOMProgressEvent(nullptr, nullptr);
nsresult rv = event->InitProgressEvent(NS_LITERAL_STRING("progress"),
false, false, false, aLoaded, aTotal);
NS_ENSURE_SUCCESS(rv,);
if (NS_FAILED(rv)) {
return;
}
rv = event->SetTrusted(true);
NS_ENSURE_SUCCESS(rv,);
if (NS_FAILED(rv)) {
return;
}
bool dummy;
rv = DispatchEvent(static_cast<nsIDOMProgressEvent*>(event), &dummy);
NS_ENSURE_SUCCESS(rv,);
if (NS_FAILED(rv)) {
return;
}
}
void

View File

@ -389,7 +389,9 @@ FileService::LockedFileQueue::OnFileHelperComplete(FileHelper* aFileHelper)
mCurrentHelper = nullptr;
nsresult rv = ProcessQueue();
NS_ENSURE_SUCCESS(rv,);
if (NS_FAILED(rv)) {
return;
}
}
}

View File

@ -6,6 +6,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

View File

@ -1393,8 +1393,7 @@ IDBObjectStore::ConvertActorsToBlobs(
NS_ASSERTION(aFiles.IsEmpty(), "Should be empty!");
if (!aActors.IsEmpty()) {
ContentChild* contentChild = ContentChild::GetSingleton();
NS_ASSERTION(contentChild, "This should never be null!");
NS_ASSERTION(ContentChild::GetSingleton(), "This should never be null!");
PRUint32 length = aActors.Length();
aFiles.SetCapacity(length);

View File

@ -105,7 +105,8 @@ Key::EncodeJSValInternal(JSContext* aCx, const jsval aVal,
{
NS_ENSURE_TRUE(aRecursionDepth < MaxRecursionDepth, NS_ERROR_DOM_INDEXEDDB_DATA_ERR);
PR_STATIC_ASSERT(eMaxType * MaxArrayCollapse < 256);
MOZ_STATIC_ASSERT(eMaxType * MaxArrayCollapse < 256,
"Unable to encode jsvals.");
if (JSVAL_IS_STRING(aVal)) {
nsDependentJSString str;

View File

@ -6,6 +6,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

View File

@ -24,7 +24,8 @@ namespace {
// If JS_STRUCTURED_CLONE_VERSION changes then we need to update our major
// schema version.
PR_STATIC_ASSERT(JS_STRUCTURED_CLONE_VERSION == 1);
MOZ_STATIC_ASSERT(JS_STRUCTURED_CLONE_VERSION == 1,
"Need to update the major schema version.");
// Major schema version. Bump for almost everything.
const PRUint32 kMajorSchemaVersion = 12;
@ -36,8 +37,10 @@ const PRUint32 kMinorSchemaVersion = 0;
// The schema version we store in the SQLite database is a (signed) 32-bit
// integer. The major version is left-shifted 4 bits so the max value is
// 0xFFFFFFF. The minor version occupies the lower 4 bits and its max is 0xF.
PR_STATIC_ASSERT(kMajorSchemaVersion <= 0xFFFFFFF);
PR_STATIC_ASSERT(kMajorSchemaVersion <= 0xF);
MOZ_STATIC_ASSERT(kMajorSchemaVersion <= 0xFFFFFFF,
"Major version needs to fit in 28 bits.");
MOZ_STATIC_ASSERT(kMinorSchemaVersion <= 0xF,
"Minor version needs to fit in 4 bits.");
inline
PRInt32
@ -1800,7 +1803,8 @@ OpenDatabaseHelper::CreateDatabaseConnection(
}
else {
// This logic needs to change next time we change the schema!
PR_STATIC_ASSERT(kSQLiteSchemaVersion == PRInt32((12 << 4) + 0));
MOZ_STATIC_ASSERT(kSQLiteSchemaVersion == PRInt32((12 << 4) + 0),
"Need upgrade code from schema version increase.");
while (schemaVersion != kSQLiteSchemaVersion) {
if (schemaVersion == 4) {

View File

@ -314,7 +314,7 @@ class IndexedDBObjectStoreRequestChild : public IndexedDBRequestChildBase
typedef ipc::ObjectStoreRequestParams ParamsUnionType;
typedef ParamsUnionType::Type RequestType;
RequestType mRequestType;
DebugOnly<RequestType> mRequestType;
public:
IndexedDBObjectStoreRequestChild(AsyncConnectionHelper* aHelper,
@ -337,7 +337,7 @@ class IndexedDBIndexRequestChild : public IndexedDBRequestChildBase
typedef ipc::IndexRequestParams ParamsUnionType;
typedef ParamsUnionType::Type RequestType;
RequestType mRequestType;
DebugOnly<RequestType> mRequestType;
public:
IndexedDBIndexRequestChild(AsyncConnectionHelper* aHelper, IDBIndex* aIndex,
@ -359,7 +359,7 @@ class IndexedDBCursorRequestChild : public IndexedDBRequestChildBase
typedef ipc::CursorRequestParams ParamsUnionType;
typedef ParamsUnionType::Type RequestType;
RequestType mRequestType;
DebugOnly<RequestType> mRequestType;
public:
IndexedDBCursorRequestChild(AsyncConnectionHelper* aHelper,

View File

@ -1197,9 +1197,7 @@ IndexedDBObjectStoreRequestParent::ConvertBlobActors(
if (!aActors.IsEmpty()) {
// Walk the chain to get to ContentParent.
ContentParent* contentParent =
mObjectStore->Transaction()->Database()->GetContentParent();
MOZ_ASSERT(contentParent);
MOZ_ASSERT(mObjectStore->Transaction()->Database()->GetContentParent());
uint32_t length = aActors.Length();
aBlobs.SetCapacity(length);

View File

@ -494,7 +494,7 @@ class IndexedDBObjectStoreRequestParent : public IndexedDBRequestParentBase
typedef ipc::ObjectStoreRequestParams ParamsUnionType;
typedef ParamsUnionType::Type RequestType;
RequestType mRequestType;
DebugOnly<RequestType> mRequestType;
typedef ipc::AddParams AddParams;
typedef ipc::PutParams PutParams;
@ -550,7 +550,7 @@ class IndexedDBIndexRequestParent : public IndexedDBRequestParentBase
typedef ipc::IndexRequestParams ParamsUnionType;
typedef ParamsUnionType::Type RequestType;
RequestType mRequestType;
DebugOnly<RequestType> mRequestType;
typedef ipc::GetKeyParams GetKeyParams;
typedef ipc::GetAllKeysParams GetAllKeysParams;
@ -596,7 +596,7 @@ class IndexedDBCursorRequestParent : public IndexedDBRequestParentBase
typedef ipc::CursorRequestParams ParamsUnionType;
typedef ParamsUnionType::Type RequestType;
RequestType mRequestType;
DebugOnly<RequestType> mRequestType;
typedef ipc::ContinueParams ContinueParams;

View File

@ -7,6 +7,7 @@ topsrcdir = @top_srcdir@
srcdir = @srcdir@
relativesrcdir = @relativesrcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

View File

@ -29,5 +29,6 @@ interface nsIDOMXULMultiSelectControlElement : nsIDOMXULSelectControlElement
// XXX - temporary, pending implementation of scriptable,
// mutable nsIDOMNodeList for selectedItems
readonly attribute long selectedCount;
[binaryname(MultiGetSelectedItem)]
nsIDOMXULSelectControlItemElement getSelectedItem(in long index);
};

View File

@ -189,9 +189,6 @@ private:
InfallibleTArray<nsAutoPtr<AlertObserver> > mAlertObservers;
nsRefPtr<ConsoleListener> mConsoleListener;
#ifdef ANDROID
gfxIntSize mScreenSize;
#endif
/**
* An ID unique to the process containing our corresponding
@ -204,6 +201,10 @@ private:
AppInfo mAppInfo;
#ifdef ANDROID
gfxIntSize mScreenSize;
#endif
static ContentChild* sSingleton;
DISALLOW_EVIL_CONSTRUCTORS(ContentChild);

View File

@ -127,7 +127,7 @@ CrashReporterParent::GenerateChildData(const AnnotationTable* processNotes)
mNotes.Put(NS_LITERAL_CSTRING("ProcessType"), type);
char startTime[32];
sprintf(startTime, "%lld", static_cast<PRInt64>(mStartTime));
sprintf(startTime, "%lld", static_cast<long long>(mStartTime));
mNotes.Put(NS_LITERAL_CSTRING("StartupTime"), nsDependentCString(startTime));
if (!mAppNotes.IsEmpty())

View File

@ -14,6 +14,7 @@ LIBRARY_NAME = domipc_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
EXPORT_LIBRARY = 1
FAIL_ON_WARNINGS := 1
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
TEST_DIRS += tests

View File

@ -7,6 +7,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

View File

@ -23,6 +23,7 @@ static int gNotOptimized;
#include "AndroidBridge.h"
#include "android_npapi.h"
#include <android/log.h>
#undef ALOG
#define ALOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoJavaEnv", ## args)
#endif

View File

@ -101,6 +101,7 @@ using mozilla::plugins::PluginModuleParent;
#include "android_npapi.h"
#include "ANPBase.h"
#include "AndroidBridge.h"
#undef LOG
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
#endif

View File

@ -170,7 +170,6 @@ nsNPAPIPluginInstance::nsNPAPIPluginInstance()
mDrawingModel(kDefaultDrawingModel),
#ifdef MOZ_WIDGET_ANDROID
mANPDrawingModel(0),
mOnScreen(true),
mFullScreenOrientation(dom::eScreenOrientation_LandscapePrimary),
mWakeLocked(false),
mFullScreen(false),
@ -191,6 +190,9 @@ nsNPAPIPluginInstance::nsNPAPIPluginInstance()
#else
mUsePluginLayersPref(false)
#endif
#ifdef MOZ_WIDGET_ANDROID
, mOnScreen(true)
#endif
{
mNPP.pdata = NULL;
mNPP.ndata = this;

View File

@ -2201,7 +2201,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
// 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;
}
}

View File

@ -6,6 +6,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

View File

@ -1218,9 +1218,9 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
(void) mPluginIface->setwindow(&mData, &mWindow);
#elif defined(ANDROID)
# warning Need Android impl
// TODO: Need Android impl
#elif defined(MOZ_WIDGET_QT)
# warning Need QT-nonX impl
// TODO: Need QT-nonX impl
#else
# error Implement me for your OS
#endif
@ -3520,8 +3520,8 @@ PluginInstanceChild::ShowPluginFrame()
}
#endif
NS_ASSERTION(mWindow.width == (mWindow.clipRect.right - mWindow.clipRect.left) &&
mWindow.height == (mWindow.clipRect.bottom - mWindow.clipRect.top),
NS_ASSERTION(mWindow.width == uint32_t(mWindow.clipRect.right - mWindow.clipRect.left) &&
mWindow.height == uint32_t(mWindow.clipRect.bottom - mWindow.clipRect.top),
"Clip rect should be same size as window when using layers");
// Clear accRect here to be able to pass

View File

@ -222,10 +222,10 @@ PluginInstanceParent::AnswerNPN_GetValue_NPNVnetscapeWindow(NativeWindowHandle*
#elif defined(XP_MACOSX)
intptr_t id;
#elif defined(ANDROID)
#warning Need Android impl
// TODO: Need Android impl
int id;
#elif defined(MOZ_WIDGET_QT)
# warning Need Qt non X impl
// TODO: Need Qt non X impl
int id;
#else
#warning Implement me
@ -1020,7 +1020,7 @@ PluginInstanceParent::NPP_SetWindow(const NPWindow* aWindow)
if (mDrawingModel == NPDrawingModelCoreAnimation ||
mDrawingModel == NPDrawingModelInvalidatingCoreAnimation) {
mIOSurface = MacIOSurface::CreateIOSurface(window.width, window.height);
} else if (mShWidth * mShHeight != window.width * window.height) {
} else if (uint32_t(mShWidth * mShHeight) != window.width * window.height) {
if (mShWidth != 0 && mShHeight != 0) {
DeallocShmem(mShSurface);
mShWidth = 0;

View File

@ -27,6 +27,7 @@
#ifdef MOZ_X11
class gfxXlibSurface;
#endif
#include "mozilla/unused.h"
#include "nsGUIEvent.h"
namespace mozilla {
@ -280,7 +281,7 @@ public:
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

View File

@ -313,9 +313,8 @@ PluginModuleParent::CrashReporter()
{
return static_cast<CrashReporterParent*>(ManagedPCrashReporterParent()[0]);
}
#endif
#ifdef MOZ_CRASHREPORTER
#ifdef MOZ_CRASHREPORTER_INJECTOR
static void
RemoveMinidump(nsIFile* minidump)
{
@ -329,6 +328,7 @@ RemoveMinidump(nsIFile* minidump)
extraFile->Remove(true);
}
}
#endif // MOZ_CRASHREPORTER_INJECTOR
void
PluginModuleParent::ProcessFirstMinidump()

View File

@ -7,6 +7,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

View File

@ -7,6 +7,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

View File

@ -7,6 +7,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

View File

@ -63,6 +63,8 @@ protected:
class nsJSURI : public nsSimpleURI
{
public:
using nsSimpleURI::Read;
using nsSimpleURI::Write;
nsJSURI() {}

View File

@ -7,6 +7,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

View File

@ -1,11 +1,12 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# # License, v. 2.0. If a copy of the MPL was not distributed with this file,
# # You can obtain one at http://mozilla.org/MPL/2.0/.
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

View File

@ -65,7 +65,8 @@ using mozilla::Preferences;
// The maximum number of threads to use for workers, overridable via pref.
#define MAX_WORKERS_PER_DOMAIN 10
PR_STATIC_ASSERT(MAX_WORKERS_PER_DOMAIN >= 1);
MOZ_STATIC_ASSERT(MAX_WORKERS_PER_DOMAIN >= 1,
"We should allow at least one worker per domain.");
// The default number of seconds that close handlers will be allowed to run.
#define MAX_SCRIPT_RUN_TIME_SEC 10
@ -139,7 +140,8 @@ const char* gStringChars[] = {
// thread.
};
PR_STATIC_ASSERT(NS_ARRAY_LENGTH(gStringChars) == ID_COUNT);
MOZ_STATIC_ASSERT(NS_ARRAY_LENGTH(gStringChars) == ID_COUNT,
"gStringChars should have the right length.");
enum {
PREF_strict = 0,
@ -177,7 +179,8 @@ const char* gPrefsToWatch[] = {
#endif
};
PR_STATIC_ASSERT(NS_ARRAY_LENGTH(gPrefsToWatch) == PREF_COUNT);
MOZ_STATIC_ASSERT(NS_ARRAY_LENGTH(gPrefsToWatch) == PREF_COUNT,
"gPrefsToWatch should have the right length.");
int
PrefCallback(const char* aPrefName, void* aClosure)

View File

@ -961,8 +961,11 @@ CreateDedicatedWorkerGlobalScope(JSContext* aCx)
if (worker->IsChromeWorker() &&
(!chromeworker::InitClass(aCx, global, workerProto, false) ||
!DefineChromeWorkerFunctions(aCx, global)) ||
!DefineOSFileConstants(aCx, global)) {
!DefineChromeWorkerFunctions(aCx, global))) {
return NULL;
}
if (!DefineOSFileConstants(aCx, global)) {
return NULL;
}