From 60f0e6df4073ed688d9e9875e262e46d65d58a80 Mon Sep 17 00:00:00 2001 From: Masatoshi Kimura Date: Sun, 21 Apr 2013 05:36:43 +0900 Subject: [PATCH] Bug 859020 - Remove the MSVC exemption for FAIL_ON_WARNINGS in dom. r=bz --- dom/audiochannel/AudioChannelService.cpp | 2 +- dom/audiochannel/Makefile.in | 2 -- dom/base/Makefile.in | 2 -- dom/base/nsScreen.cpp | 2 +- dom/indexedDB/Key.cpp | 8 ++++++-- dom/indexedDB/Makefile.in | 2 -- dom/network/src/Makefile.in | 2 -- dom/network/src/TCPSocketParent.cpp | 2 +- dom/power/Makefile.in | 2 -- dom/power/PowerManagerService.cpp | 6 +++--- 10 files changed, 12 insertions(+), 18 deletions(-) diff --git a/dom/audiochannel/AudioChannelService.cpp b/dom/audiochannel/AudioChannelService.cpp index f80b15b02fad..1b7981da33fa 100644 --- a/dom/audiochannel/AudioChannelService.cpp +++ b/dom/audiochannel/AudioChannelService.cpp @@ -515,6 +515,6 @@ AudioChannelService::GetInternalType(AudioChannelType aType, break; } - MOZ_NOT_REACHED(); + MOZ_NOT_REACHED("unexpected audio channel type"); return AUDIO_CHANNEL_INT_LAST; } diff --git a/dom/audiochannel/Makefile.in b/dom/audiochannel/Makefile.in index ace3f8f6dc28..ef93cd4d67bd 100644 --- a/dom/audiochannel/Makefile.in +++ b/dom/audiochannel/Makefile.in @@ -23,9 +23,7 @@ LIBRARY_NAME = domaudiochannel_s LIBXUL_LIBRARY = 1 FORCE_STATIC_LIB = 1 EXPORT_LIBRARY = 1 -ifndef _MSC_VER FAIL_ON_WARNINGS := 1 -endif # !_MSC_VER CPPSRCS += \ AudioChannelService.cpp \ diff --git a/dom/base/Makefile.in b/dom/base/Makefile.in index 07854469e2e6..164ada1772fa 100644 --- a/dom/base/Makefile.in +++ b/dom/base/Makefile.in @@ -12,9 +12,7 @@ include $(DEPTH)/config/autoconf.mk LIBRARY_NAME = jsdombase_s LIBXUL_LIBRARY = 1 FORCE_STATIC_LIB = 1 -ifndef _MSC_VER FAIL_ON_WARNINGS := 1 -endif # !_MSC_VER EXTRA_COMPONENTS = \ SiteSpecificUserAgent.js \ diff --git a/dom/base/nsScreen.cpp b/dom/base/nsScreen.cpp index 7ffcab7f1e8a..dd61f00c9b55 100644 --- a/dom/base/nsScreen.cpp +++ b/dom/base/nsScreen.cpp @@ -390,7 +390,7 @@ nsScreen::MozLockOrientation(const Sequence& aOrientations, // This is only for compilers that don't understand that the previous switch // will always return. - MOZ_NOT_REACHED(); + MOZ_NOT_REACHED("unexpected lock orientation permission value"); return false; } diff --git a/dom/indexedDB/Key.cpp b/dom/indexedDB/Key.cpp index 121fd6c65d53..8b9bb14bf35d 100644 --- a/dom/indexedDB/Key.cpp +++ b/dom/indexedDB/Key.cpp @@ -392,8 +392,10 @@ Key::EncodeNumber(double aFloat, uint8_t aType) Float64Union pun; pun.d = aFloat; + // Note: The subtraction from 0 below is necessary to fix + // MSVC build warning C4146 (negating an unsigned value). uint64_t number = pun.u & PR_UINT64(0x8000000000000000) ? - -pun.u : + (0 - pun.u) : (pun.u | PR_UINT64(0x8000000000000000)); number = NS_SWAP64(number); @@ -416,9 +418,11 @@ Key::DecodeNumber(const unsigned char*& aPos, const unsigned char* aEnd) aPos += sizeof(number); Float64Union pun; + // Note: The subtraction from 0 below is necessary to fix + // MSVC build warning C4146 (negating an unsigned value). pun.u = number & PR_UINT64(0x8000000000000000) ? (number & ~PR_UINT64(0x8000000000000000)) : - -number; + (0 - number); return pun.d; } diff --git a/dom/indexedDB/Makefile.in b/dom/indexedDB/Makefile.in index cb37208a52b6..67768928ee1c 100644 --- a/dom/indexedDB/Makefile.in +++ b/dom/indexedDB/Makefile.in @@ -12,9 +12,7 @@ include $(DEPTH)/config/autoconf.mk LIBRARY_NAME = dom_indexeddb_s LIBXUL_LIBRARY = 1 FORCE_STATIC_LIB = 1 -ifndef _MSC_VER FAIL_ON_WARNINGS := 1 -endif # !_MSC_VER CPPSRCS = \ AsyncConnectionHelper.cpp \ diff --git a/dom/network/src/Makefile.in b/dom/network/src/Makefile.in index 38edafb30bd9..0fd0bfe6be83 100644 --- a/dom/network/src/Makefile.in +++ b/dom/network/src/Makefile.in @@ -12,9 +12,7 @@ include $(DEPTH)/config/autoconf.mk LIBRARY_NAME = dom_network_s LIBXUL_LIBRARY = 1 FORCE_STATIC_LIB = 1 -ifndef _MSC_VER FAIL_ON_WARNINGS := 1 -endif # !_MSC_VER EXTRA_COMPONENTS = \ TCPSocket.js \ diff --git a/dom/network/src/TCPSocketParent.cpp b/dom/network/src/TCPSocketParent.cpp index 8a9d69401828..7d816f2d8af1 100644 --- a/dom/network/src/TCPSocketParent.cpp +++ b/dom/network/src/TCPSocketParent.cpp @@ -109,7 +109,7 @@ TCPSocketParent::RecvData(const SendableData& aData) break; default: - MOZ_NOT_REACHED(); + MOZ_NOT_REACHED("unexpected SendableData type"); return false; } return true; diff --git a/dom/power/Makefile.in b/dom/power/Makefile.in index 214b0f373ac2..08a752265adb 100644 --- a/dom/power/Makefile.in +++ b/dom/power/Makefile.in @@ -12,9 +12,7 @@ include $(DEPTH)/config/autoconf.mk LIBRARY_NAME = dom_power_s LIBXUL_LIBRARY = 1 FORCE_STATIC_LIB = 1 -ifndef _MSC_VER FAIL_ON_WARNINGS := 1 -endif # !_MSC_VER include $(topsrcdir)/dom/dom-config.mk diff --git a/dom/power/PowerManagerService.cpp b/dom/power/PowerManagerService.cpp index f9482a8d9362..a9fac2d65bd0 100644 --- a/dom/power/PowerManagerService.cpp +++ b/dom/power/PowerManagerService.cpp @@ -119,7 +119,7 @@ PowerManagerService::Reboot() // To synchronize any unsaved user data before rebooting. SyncProfile(); hal::Reboot(); - MOZ_NOT_REACHED(); + MOZ_NOT_REACHED("hal::Reboot() shouldn't return"); return NS_OK; } @@ -130,7 +130,7 @@ PowerManagerService::PowerOff() // To synchronize any unsaved user data before powering off. SyncProfile(); hal::PowerOff(); - MOZ_NOT_REACHED(); + MOZ_NOT_REACHED("hal::PowerOff() shouldn't return"); return NS_OK; } @@ -153,7 +153,7 @@ PowerManagerService::Restart() sync(); #endif _exit(0); - MOZ_NOT_REACHED(); + MOZ_NOT_REACHED("_exit() shouldn't return"); return NS_OK; }