Bug 1457813 - Part 4: Remove NS_PRECONDITION definition. r?froydnj draft
authorChris Peterson <cpeterson@mozilla.com>
Fri, 27 Apr 2018 21:42:24 -0700
changeset 790930 272fcd796ae534301e0819b762ef117355f4e516
parent 790929 99faa5ba5a2d074f83d7aa46a62eff148926c13e
push id108649
push usercpeterson@mozilla.com
push dateThu, 03 May 2018 06:11:06 +0000
reviewersfroydnj
bugs1457813
milestone61.0a1
Bug 1457813 - Part 4: Remove NS_PRECONDITION definition. r?froydnj MozReview-Commit-ID: 1QAsgoWpXDn
editor/libeditor/HTMLEditUtils.cpp
tools/coverity/model.cpp
xpcom/base/nsDebug.h
--- a/editor/libeditor/HTMLEditUtils.cpp
+++ b/editor/libeditor/HTMLEditUtils.cpp
@@ -8,17 +8,17 @@
 #include "TextEditUtils.h"              // for TextEditUtils
 #include "mozilla/ArrayUtils.h"         // for ArrayLength
 #include "mozilla/Assertions.h"         // for MOZ_ASSERT, etc.
 #include "mozilla/EditorBase.h"         // for EditorBase
 #include "mozilla/dom/Element.h"        // for Element, nsINode
 #include "nsAString.h"                  // for nsAString::IsEmpty
 #include "nsCOMPtr.h"                   // for nsCOMPtr, operator==, etc.
 #include "nsCaseTreatment.h"
-#include "nsDebug.h"                    // for NS_PRECONDITION, etc.
+#include "nsDebug.h"                    // for NS_ASSERTION, etc.
 #include "nsError.h"                    // for NS_SUCCEEDED
 #include "nsGkAtoms.h"                  // for nsGkAtoms, nsGkAtoms::a, etc.
 #include "nsHTMLTags.h"
 #include "nsAtom.h"                    // for nsAtom
 #include "nsIDOMNode.h"                 // for nsIDOMNode
 #include "nsNameSpaceManager.h"        // for kNameSpaceID_None
 #include "nsLiteralString.h"            // for NS_LITERAL_STRING
 #include "nsString.h"                   // for nsAutoString
--- a/tools/coverity/model.cpp
+++ b/tools/coverity/model.cpp
@@ -45,18 +45,16 @@ MOZ_ReportCrash(const char* aStr, const 
 #define MOZ_ASSERT(expr) assert(!!(expr))
 
 #define NS_ASSERTION(expr, msg) assert(!!(expr))
 
 #define PORT_Assert(expr) assert(!!(expr))
 
 #define PR_ASSERT(expr) assert(!!(expr))
 
-#define NS_PRECONDITION(expr, msg) assert(!!(expr))
-
 // Kills Structurally dead code (UNREACHABLE)
 #define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(_class)                   \
   NS_IMETHODIMP_(bool)                                                         \
   NS_CYCLE_COLLECTION_CLASSNAME(_class)::CanSkipThisReal(void* p)              \
   {                                                                            \
     __coverity_panic__();                                                      \
     _class* tmp = DowncastCCParticipant<_class>(p);
 
--- a/xpcom/base/nsDebug.h
+++ b/xpcom/base/nsDebug.h
@@ -101,21 +101,16 @@ inline void MOZ_PretendNoReturn()
       MOZ_PretendNoReturn();                                         \
     }                                                         \
   } while(0)
 #else
 #define NS_ASSERTION(expr, str)        do { /* nothing */ } while(0)
 #endif
 
 /**
- * NS_PRECONDITION is a synonym for NS_ASSERTION.
- */
-#define NS_PRECONDITION(expr, str) NS_ASSERTION(expr, str)
-
-/**
  * This macros triggers a program failure if executed. It indicates that
  * an attempt was made to execute a codepath which should not be reachable.
  */
 #ifdef DEBUG
 #define NS_NOTREACHED(str)                                    \
   do {                                                        \
     NS_DebugBreak(NS_DEBUG_ASSERTION, str, "Not Reached", __FILE__, __LINE__); \
     MOZ_PretendNoReturn();                                    \