subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmpil...@apache.org
Subject svn commit: r1461775 - /subversion/trunk/subversion/include/svn_error.h
Date Wed, 27 Mar 2013 18:39:56 GMT
Author: cmpilato
Date: Wed Mar 27 18:39:56 2013
New Revision: 1461775

URL: http://svn.apache.org/r1461775
Log:
* subversion/include/svn_error.h
  (SVN_ERR_ASSERT): Make this just a wrapper around SVN_ERR_ASSERT_E.

Modified:
    subversion/trunk/subversion/include/svn_error.h

Modified: subversion/trunk/subversion/include/svn_error.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_error.h?rev=1461775&r1=1461774&r2=1461775&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_error.h (original)
+++ subversion/trunk/subversion/include/svn_error.h Wed Mar 27 18:39:56 2013
@@ -461,10 +461,22 @@ svn_error_t *svn_error_purge_tracing(svn
     abort();                                                 \
   } while (1)
 
-/** Like SVN_ERR_ASSERT(), but append ERR to the returned error chain.
+/** Check that a condition is true: if not, report an error (appending
+ * ERR if non-NULL) and possibly terminate the program.
  *
- * If EXPR is false, return a malfunction error whose chain includes ERR.
- * If EXPR is true, do nothing.  (In particular, this does not clear ERR.)
+ * If the boolean expression @a expr is true, do nothing. Otherwise,
+ * act as determined by the current "malfunction handler" which may have
+ * been specified by a call to svn_error_set_malfunction_handler() or else
+ * is the default handler as specified in that function's documentation. If
+ * the malfunction handler returns, then cause the function using this macro
+ * to return the error object that it generated.
+ *
+ * @note The intended use of this macro is to check a condition that cannot
+ * possibly be false unless there is a bug in the program.
+ *
+ * @note The condition to be checked should not be computationally expensive
+ * if it is reached often, as, unlike traditional "assert" statements, the
+ * evaluation of this expression is not compiled out in release-mode builds.
  *
  * Types: (svn_boolean_t expr, svn_error_t *err)
  *
@@ -485,38 +497,13 @@ svn_error_t *svn_error_purge_tracing(svn
   } while (0)
 #endif
 
-
-/** Check that a condition is true: if not, report an error and possibly
- * terminate the program.
- *
- * If the Boolean expression @a expr is true, do nothing. Otherwise,
- * act as determined by the current "malfunction handler" which may have
- * been specified by a call to svn_error_set_malfunction_handler() or else
- * is the default handler as specified in that function's documentation. If
- * the malfunction handler returns, then cause the function using this macro
- * to return the error object that it generated.
- *
- * @note The intended use of this macro is to check a condition that cannot
- * possibly be false unless there is a bug in the program.
+/** Like SVN_ERR_ASSERT_E(), but with @a err always NULL.
  *
- * @note The condition to be checked should not be computationally expensive
- * if it is reached often, as, unlike traditional "assert" statements, the
- * evaluation of this expression is not compiled out in release-mode builds.
+ * @see SVN_ERR_ASSERT_E()
  *
  * @since New in 1.6.
- *
- * @see SVN_ERR_ASSERT_E()
  */
-#ifdef __clang_analyzer__
-#include <assert.h>
-#define SVN_ERR_ASSERT(expr)       assert((expr))
-#else
-#define SVN_ERR_ASSERT(expr)                                            \
-  do {                                                                  \
-    if (!(expr))                                                        \
-      SVN_ERR(svn_error__malfunction(TRUE, __FILE__, __LINE__, #expr)); \
-  } while (0)
-#endif
+#define SVN_ERR_ASSERT(expr)       SVN_ERR_ASSERT_E(expr, NULL)
 
 /** Similar to SVN_ERR_ASSERT(), but without the option of returning
  * an error to the calling function.



Mime
View raw message