Bug 826983 - Enable FAIL_ON_WARNINGS on MSVC in editor/. r=ehsan
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Mon, 07 Jan 2013 04:41:46 +0900
changeset 126920 7afccc6bbb95dc12fa37e2f603ac2278a4a49e60
parent 126919 4727f845406afad1f7b490dc7a60332830824482
child 126921 809d2d699155f31444b26ec00c6fb7bfe5f5b6e1
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs826983
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 826983 - Enable FAIL_ON_WARNINGS on MSVC in editor/. r=ehsan
editor/composer/src/Makefile.in
editor/composer/src/nsComposerCommandsUpdater.cpp
editor/libeditor/base/Makefile.in
editor/libeditor/base/nsEditor.cpp
--- a/editor/composer/src/Makefile.in
+++ b/editor/composer/src/Makefile.in
@@ -11,19 +11,17 @@ VPATH		= @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= editor
 LIBRARY_NAME	= composer
 EXPORT_LIBRARY = 1
 IS_COMPONENT	= 1
 MODULE_NAME	= nsComposerModule
 LIBXUL_LIBRARY	= 1
-ifndef _MSC_VER
 FAIL_ON_WARNINGS = 1
-endif # !_MSC_VER
 
 
 CPPSRCS  = \
            nsComposeTxtSrvFilter.cpp            \
            nsComposerController.cpp       \
            nsComposerCommands.cpp         \
            nsComposerDocumentCommands.cpp \
            nsComposerRegistration.cpp     \
--- a/editor/composer/src/nsComposerCommandsUpdater.cpp
+++ b/editor/composer/src/nsComposerCommandsUpdater.cpp
@@ -242,38 +242,38 @@ nsComposerCommandsUpdater::PrimeUpdateTi
                                         nsITimer::TYPE_ONE_SHOT);
 }
 
 
 void nsComposerCommandsUpdater::TimerCallback()
 {
   // if the selection state has changed, update stuff
   bool isCollapsed = SelectionIsCollapsed();
-  if (isCollapsed != mSelectionCollapsed)
+  if (static_cast<int8_t>(isCollapsed) != mSelectionCollapsed)
   {
     UpdateCommandGroup(NS_LITERAL_STRING("select"));
     mSelectionCollapsed = isCollapsed;
   }
-  
+
   // isn't this redundant with the UpdateCommandGroup above?
   // can we just nuke the above call? or create a meta command group?
   UpdateCommandGroup(NS_LITERAL_STRING("style"));
 }
 
 nsresult
 nsComposerCommandsUpdater::UpdateDirtyState(bool aNowDirty)
 {
-  if (mDirtyState != aNowDirty)
+  if (mDirtyState != static_cast<int8_t>(aNowDirty))
   {
     UpdateCommandGroup(NS_LITERAL_STRING("save"));
     UpdateCommandGroup(NS_LITERAL_STRING("undo"));
     mDirtyState = aNowDirty;
   }
-  
-  return NS_OK;  
+
+  return NS_OK;
 }
 
 nsresult
 nsComposerCommandsUpdater::UpdateCommandGroup(const nsAString& aCommandGroup)
 {
   nsCOMPtr<nsPICommandUpdater> commandUpdater = GetCommandUpdater();
   NS_ENSURE_TRUE(commandUpdater, NS_ERROR_FAILURE);
 
--- a/editor/libeditor/base/Makefile.in
+++ b/editor/libeditor/base/Makefile.in
@@ -10,19 +10,17 @@ VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 TEST_DIRS += tests
 
 MODULE		= editor
 LIBRARY_NAME	= editorbase_s
 LIBXUL_LIBRARY	= 1
-ifndef _MSC_VER
 FAIL_ON_WARNINGS = 1
-endif # !_MSC_VER
 
 
 # Internal header files, needed by other editor sublibs:
 INTERNAL_HDR_DIR = ../internal
 
 CPPSRCS		=                           \
 		nsEditor.cpp                \
 		nsEditorCommands.cpp        \
--- a/editor/libeditor/base/nsEditor.cpp
+++ b/editor/libeditor/base/nsEditor.cpp
@@ -2601,28 +2601,28 @@ nsEditor::NotifyDocumentListeners(TDocum
     case eDocumentToBeDestroyed:
       for (i = 0; i < numListeners;i++)
       {
         rv = listeners[i]->NotifyDocumentWillBeDestroyed();
         if (NS_FAILED(rv))
           break;
       }
       break;
-  
+
     case eDocumentStateChanged:
       {
         bool docIsDirty;
         rv = GetDocumentModified(&docIsDirty);
         NS_ENSURE_SUCCESS(rv, rv);
-        
-        if (docIsDirty == mDocDirtyState)
+
+        if (static_cast<int8_t>(docIsDirty) == mDocDirtyState)
           return NS_OK;
-        
-        mDocDirtyState = (int8_t)docIsDirty;
-        
+
+        mDocDirtyState = docIsDirty;
+
         for (i = 0; i < numListeners;i++)
         {
           rv = listeners[i]->NotifyDocumentStateChanged(mDocDirtyState);
           if (NS_FAILED(rv))
             break;
         }
       }
       break;