Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/nvi/dist/common make the debugging code work ag...



details:   https://anonhg.NetBSD.org/src/rev/2570a7bc40b8
branches:  trunk
changeset: 324999:2570a7bc40b8
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Nov 29 21:57:31 2013 +0000

description:
make the debugging code work again.

diffstat:

 external/bsd/nvi/dist/common/vi_db1.c |  64 +++++++++++++++++-----------------
 1 files changed, 32 insertions(+), 32 deletions(-)

diffs (111 lines):

diff -r a7f0c5de3690 -r 2570a7bc40b8 external/bsd/nvi/dist/common/vi_db1.c
--- a/external/bsd/nvi/dist/common/vi_db1.c     Fri Nov 29 18:20:40 2013 +0000
+++ b/external/bsd/nvi/dist/common/vi_db1.c     Fri Nov 29 21:57:31 2013 +0000
@@ -120,30 +120,30 @@
                l1 = TAILQ_FIRST(&sp->tiq)->lno;
                l2 = TAILQ_LAST(&sp->tiq, _texth)->lno;
                if (l1 <= lno && l2 >= lno) {
-#if defined(DEBUG) && 0
-                       vtrace(sp,
+#if defined(DBDEBUG) && defined(TRACE)
+                       vtrace(
                            "retrieve TEXT buffer line %lu\n", (u_long)lno);
-#endif
-                       for (tp = TAILQ_FIRST(&sp->tiq);
-                           tp->lno != lno; tp = TAILQ_NEXT(tp, q));
-                       if (lenp != NULL)
-                               *lenp = tp->len;
-                       if (pp != NULL)
-                               *pp = tp->lb;
-                       return (0);
-               }
-               /*
-                * Adjust the line number for the number of lines used
-                * by the text input buffers.
-                */
-               if (lno > l2)
-                       lno -= l2 - l1;
-       }
+    #endif
+                           for (tp = TAILQ_FIRST(&sp->tiq);
+                               tp->lno != lno; tp = TAILQ_NEXT(tp, q));
+                           if (lenp != NULL)
+                                   *lenp = tp->len;
+                           if (pp != NULL)
+                                   *pp = tp->lb;
+                           return (0);
+                   }
+                   /*
+                    * Adjust the line number for the number of lines used
+                    * by the text input buffers.
+                    */
+                   if (lno > l2)
+                           lno -= l2 - l1;
+           }
 
-       /* Look-aside into the cache, and see if the line we want is there. */
-       if (lno == sp->c_lno) {
-#if defined(DEBUG) && 0
-               vtrace(sp, "retrieve cached line %lu\n", (u_long)lno);
+           /* Look-aside into the cache, and see if the line we want is there. */
+           if (lno == sp->c_lno) {
+    #if defined(DBDEBUG) && defined(TRACE)
+                   vtrace("retrieve cached line %lu\n", (u_long)lno);
 #endif
                if (lenp != NULL)
                        *lenp = sp->c_len;
@@ -198,8 +198,8 @@
        sp->c_lno = lno;
        sp->c_len = wlen;
 
-#if defined(DEBUG) && 0
-       vtrace(sp, "retrieve DB line %lu\n", (u_long)lno);
+#if defined(DBDEBUG) && defined(TRACE)
+       vtrace("retrieve DB line %lu\n", (u_long)lno);
 #endif
        if (lenp != NULL)
                *lenp = wlen;
@@ -220,8 +220,8 @@
        DBT key;
        EXF *ep;
 
-#if defined(DEBUG) && 0
-       vtrace(sp, "delete line %lu\n", (u_long)lno);
+#if defined(DBDEBUG) && defined(TRACE)
+       vtrace("delete line %lu\n", (u_long)lno);
 #endif
        /* Check for no underlying file. */
        if ((ep = sp->ep) == NULL) {
@@ -285,8 +285,8 @@
        size_t flen;
        int rval;
 
-#if defined(DEBUG) && 0
-       vtrace(sp, "append to %lu: len %u {%.*s}\n", lno, len, MIN(len, 20), p);
+#if defined(DBDEBUG) && defined(TRACE)
+       vtrace("append to %lu: len %u {%.*s}\n", lno, len, MIN(len, 20), p);
 #endif
        /* Check for no underlying file. */
        if ((ep = sp->ep) == NULL) {
@@ -360,8 +360,8 @@
        size_t flen;
        int rval;
 
-#if defined(DEBUG) && 0
-       vtrace(sp, "insert before %lu: len %lu {%.*s}\n",
+#if defined(DBDEBUG) && defined(TRACE)
+       vtrace("insert before %lu: len %lu {%.*s}\n",
            (u_long)lno, (u_long)len, MIN(len, 20), p);
 #endif
        /* Check for no underlying file. */
@@ -426,8 +426,8 @@
        const char *fp;
        size_t flen;
 
-#if defined(DEBUG) && 0
-       vtrace(sp, "replace line %lu: len %lu {%.*s}\n",
+#if defined(DBDEBUG) && defined(TRACE)
+       vtrace("replace line %lu: len %lu {%.*s}\n",
            (u_long)lno, (u_long)len, MIN(len, 20), p);
 #endif
        /* Check for no underlying file. */



Home | Main Index | Thread Index | Old Index