]> granicus.if.org Git - graphviz/commitdiff
replace ASSERT macro with standard assert
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 17 Jul 2021 00:46:09 +0000 (17:46 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 18 Jul 2021 22:13:34 +0000 (15:13 -0700)
The standard libc assert is more familiar to programmers, renders more useful
debugging messages, and is more easily toggled with NDEBUG.

lib/sfio/sfclose.c
lib/sfio/sfhdr.h

index c9408834bd016257f1265cbcc486042d6100ce03..27cac9aa760b8ac6d31f627f2b49ab9439ac2611 100644 (file)
@@ -8,6 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#include       <assert.h>
 #include       <sfio/sfhdr.h>
 #include       <stddef.h>
 
@@ -74,7 +75,7 @@ int sfclose(Sfio_t * f)
            }
        } else {
            f->mode &= ~SF_LOCK;
-           /**/ ASSERT(_Sfpmove);
+           assert(_Sfpmove);
            if ((*_Sfpmove) (f, -1) < 0) {
                SFOPEN(f, 0);
                SFMTXRETURN(f, -1);
index 2f84fd5ee7f5abd4d9b7e900838602804216b6ca..863bb9dde767b0848f5ca6542ccebbd145e99ff4 100644 (file)
@@ -115,12 +115,6 @@ extern "C" {
 #define SF_AVAIL       00020000u       /* was closed, available for reuse      */
 #define SF_LOCAL       00100000u       /* sentinel for a local call            */
 
-#ifdef DEBUG
-#define ASSERT(p)      ((p) ? 0 : (abort(),0) )
-#else
-#define ASSERT(p)
-#endif
-
 /* short-hands */
 #define NIL(t)         ((t)0)
 #ifndef uchar