cvs-cvs
[Top][All Lists]
Advanced

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

[Cvs-cvs] ccvs doc/stamp-vti doc/version.texi src/ChangeL...


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs doc/stamp-vti doc/version.texi src/ChangeL...
Date: Sun, 28 Oct 2007 18:29:54 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Derek Robert Price <dprice>     07/10/28 18:29:54

Modified files:
        doc            : stamp-vti version.texi 
        src            : ChangeLog hash.c tag.c 

Log message:
        * hash.c, tag.c: Use TRACE_NULL as needed.  Some cleanup.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/doc/stamp-vti?cvsroot=cvs&r1=1.205&r2=1.206
http://cvs.savannah.gnu.org/viewcvs/ccvs/doc/version.texi?cvsroot=cvs&r1=1.207&r2=1.208
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&r1=1.3545&r2=1.3546
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/hash.c?cvsroot=cvs&r1=1.52&r2=1.53
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/tag.c?cvsroot=cvs&r1=1.153&r2=1.154

Patches:
Index: doc/stamp-vti
===================================================================
RCS file: /cvsroot/cvs/ccvs/doc/stamp-vti,v
retrieving revision 1.205
retrieving revision 1.206
diff -u -b -r1.205 -r1.206
--- doc/stamp-vti       19 Oct 2007 21:53:49 -0000      1.205
+++ doc/stamp-vti       28 Oct 2007 18:29:53 -0000      1.206
@@ -1,4 +1,4 @@
address@hidden UPDATED 19 October 2007
address@hidden UPDATED 28 October 2007
 @set UPDATED-MONTH October 2007
 @set EDITION 1.12.13.1
 @set VERSION 1.12.13.1

Index: doc/version.texi
===================================================================
RCS file: /cvsroot/cvs/ccvs/doc/version.texi,v
retrieving revision 1.207
retrieving revision 1.208
diff -u -b -r1.207 -r1.208
--- doc/version.texi    19 Oct 2007 21:53:49 -0000      1.207
+++ doc/version.texi    28 Oct 2007 18:29:53 -0000      1.208
@@ -1,4 +1,4 @@
address@hidden UPDATED 19 October 2007
address@hidden UPDATED 28 October 2007
 @set UPDATED-MONTH October 2007
 @set EDITION 1.12.13.1
 @set VERSION 1.12.13.1

Index: src/ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3545
retrieving revision 1.3546
diff -u -b -r1.3545 -r1.3546
--- src/ChangeLog       28 Oct 2007 17:44:16 -0000      1.3545
+++ src/ChangeLog       28 Oct 2007 18:29:54 -0000      1.3546
@@ -1,5 +1,7 @@
 2007-10-28  Derek Price  <address@hidden>
 
+       * hash.c, tag.c: Use TRACE_NULL as needed.  Some cleanup.
+
        * server.h (TRACE_PTR): Abstract cross-platform printing of pointers.
        * hash.c, recurse.c, tag.c: Use new macro.
 

Index: src/hash.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/hash.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- src/hash.c  28 Oct 2007 17:44:17 -0000      1.52
+++ src/hash.c  28 Oct 2007 18:29:54 -0000      1.53
@@ -406,7 +406,11 @@
 
 
 /*
- * walk a list with a specific proc
+ * Walk LIST, calling PROC for each node in LIST and preserving CLOSURE.  Does
+ * nothing when LIST is NULL or empty.
+ *
+ * RETURNS
+ *   The sum total of each of the integers returned by all calls to PROC.
  */
 int
 walklist (List *list, int (*proc) (Node *, void *), void *closure)
@@ -417,8 +421,7 @@
     TRACE (TRACE_FLOW, "walklist (list=%s, proc=%s, closure=%s)",
           TRACE_PTR (list, 0), TRACE_PTR (proc, 1), TRACE_PTR (closure, 2));
 
-    if (list == NULL)
-       return 0;
+    if (!list) return 0;
 
     head = list->list;
     for (p = head->next; p != head; p = p->next)
@@ -540,13 +543,13 @@
 static int
 printnode (Node *node, void *closure)
 {
-    if (node == NULL)
+    if (!node)
     {
-       (void) printf("NULL node.\n");
+       printf ("NULL node.\n");
        return 0;
     }
 
-    printf("Node at %s: type=%s, key=%s = \"%s\", data=%s, next=%s, prev=%s\n",
+    printf ("Node at %s: type=%s, key=%s = \"%s\", data=%s, next=%s, 
prev=%s\n",
           TRACE_PTR (node, 0), nodetypestring(node->type),
           TRACE_PTR (node->key, 1), node->key, TRACE_PTR (node->data, 2),
           TRACE_PTR (node->next, 3), TRACE_PTR (node->prev, 4));

Index: src/tag.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/tag.c,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -b -r1.153 -r1.154
--- src/tag.c   28 Oct 2007 17:44:17 -0000      1.153
+++ src/tag.c   28 Oct 2007 18:29:54 -0000      1.154
@@ -442,10 +442,9 @@
           "rtag_proc (argc=%d, argv=%s, xwhere=%s,\n"
       "                mwhere=%s, mfile=%s, shorten=%d,\n"
       "                local_specified=%d, mname=%s, msg=%s)",
-           argc, TRACE_PTR (argv, 0), xwhere ? xwhere : "(null)",
-           mwhere ? mwhere : "(null)", mfile ? mfile : "(null)",
-           shorten, local_specified,
-           mname ? mname : "(null)", msg ? msg : "(null)" );
+          argc, TRACE_PTR (argv, 0), TRACE_NULL (xwhere),
+          TRACE_NULL (mwhere), TRACE_NULL (mfile), shorten,
+          local_specified, TRACE_NULL (mname), TRACE_NULL (msg));
 
     if (is_rtag)
     {
@@ -453,17 +452,16 @@
                               + strlen (argv[0])
                              + (mfile == NULL ? 0 : strlen (mfile) + 1)
                               + 2);
-       (void) sprintf (repository, "%s/%s", current_parsed_root->directory,
-                        argv[0]);
+       sprintf (repository, "%s/%s", current_parsed_root->directory, argv[0]);
        where = xmalloc (strlen (argv[0])
-                         + (mfile == NULL ? 0 : strlen (mfile) + 1)
+                         + (mfile ? strlen (mfile) + 1 : 0)
                         + 1);
-       (void) strcpy (where, argv[0]);
+       strcpy (where, argv[0]);
 
        /* If MFILE isn't null, we need to set up to do only part of the
          * module.
          */
-       if (mfile != NULL)
+       if (mfile)
        {
            char *cp;
            char *path;
@@ -471,25 +469,25 @@
            /* If the portion of the module is a path, put the dir part on
              * REPOS.
              */
-           if ((cp = strrchr (mfile, '/')) != NULL)
+           if (cp = strrchr (mfile, '/'))
            {
                *cp = '\0';
-               (void) strcat (repository, "/");
-               (void) strcat (repository, mfile);
-               (void) strcat (where, "/");
-               (void) strcat (where, mfile);
+               strcat (repository, "/");
+               strcat (repository, mfile);
+               strcat (where, "/");
+               strcat (where, mfile);
                mfile = cp + 1;
            }
 
            /* take care of the rest */
            path = xmalloc (strlen (repository) + strlen (mfile) + 5);
-           (void) sprintf (path, "%s/%s", repository, mfile);
+           sprintf (path, "%s/%s", repository, mfile);
            if (isdir (path))
            {
                /* directory means repository gets the dir tacked on */
-               (void) strcpy (repository, path);
-               (void) strcat (where, "/");
-               (void) strcat (where, mfile);
+               strcpy (repository, path);
+               strcat (where, "/");
+               strcat (where, mfile);
            }
            else
            {
@@ -523,7 +521,7 @@
         repository = "";
     }
 
-    if (numtag != NULL && !numtag_validated)
+    if (numtag && !numtag_validated)
     {
        tag_check_valid (numtag, argc - 1, argv + 1, local_specified, 0,
                         repository, false);
@@ -540,9 +538,7 @@
                           CVS_LOCK_READ, where, 1, repository);
 
     if (err)
-    {
        error (1, 0, "correct the above errors first!");
-    }
 
     /* It would be nice to provide consistency with respect to
        commits; however CVS lacks the infrastructure to do that (see
@@ -556,8 +552,7 @@
         repository);
     dellist (&mtlist);
     if (which & W_REPOS) free (repository);
-    if (where != NULL)
-       free (where);
+    if (where) free (where);
     return err;
 }
 
@@ -1633,9 +1628,8 @@
     TRACE (TRACE_FUNCTION,
           "tag_check_valid (name=%s, argc=%d, argv=%s, local=%d,\n"
       "                      aflag=%d, repository=%s, valid=%s)",
-          name ? name : "(name)", argc, TRACE_PTR (argv, 0), local, aflag,
-          repository ? repository : "(null)",
-          valid ? "true" : "false");
+          TRACE_NULL (name), argc, TRACE_PTR (argv, 0), local,
+          aflag, TRACE_NULL (repository), valid ? "true" : "false");
 
     /* Numeric tags require only a syntactic check.  */
     if (isdigit ((unsigned char) name[0]))
@@ -1675,7 +1669,7 @@
        the_val_args.found = 0;
        which = W_REPOS | W_ATTIC;
 
-       if (repository == NULL || repository[0] == '\0')
+       if (!repository || !*repository)
            which |= W_LOCAL;
        else
        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]