You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/02/04 19:21:30 UTC

svn commit: r906596 - in /subversion/trunk/subversion/libsvn_ra: compat.c ra_loader.c

Author: julianfoad
Date: Thu Feb  4 18:21:29 2010
New Revision: 906596

URL: http://svn.apache.org/viewvc?rev=906596&view=rev
Log:
Simplify a tiny bit of code, removing some type casts.

* subversion/libsvn_ra/compat.c
  (log_path_del_receiver): Assign the 'baton' argument to a variable of the
    appropriate type to avoid type casts at its points of use.

* subversion/libsvn_ra/ra_loader.c
  (svn_ra_lock, svn_ra_unlock): Simpify by using svn_apr_hash_index_key()
    instead of apr_hash_this() and type casts.

Modified:
    subversion/trunk/subversion/libsvn_ra/compat.c
    subversion/trunk/subversion/libsvn_ra/ra_loader.c

Modified: subversion/trunk/subversion/libsvn_ra/compat.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/compat.c?rev=906596&r1=906595&r2=906596&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/compat.c (original)
+++ subversion/trunk/subversion/libsvn_ra/compat.c Thu Feb  4 18:21:29 2010
@@ -800,6 +800,7 @@
                       svn_log_entry_t *log_entry,
                       apr_pool_t *pool)
 {
+  log_path_del_rev_t *b = baton;
   apr_hash_index_t *hi;
 
   /* No paths were changed in this revision.  Nothing to do. */
@@ -816,14 +817,11 @@
 
       apr_hash_this(hi, (void *) &path, NULL, &val);
       log_item = val;
-      if (svn_path_compare_paths(((log_path_del_rev_t *) baton)->path,
-                                 path) == 0
-                                 && (log_item->action == 'D'
-                                     || log_item->action == 'R'))
+      if (svn_path_compare_paths(b->path, path) == 0
+          && (log_item->action == 'D' || log_item->action == 'R'))
         {
           /* Found the first deletion or replacement, we are done. */
-          ((log_path_del_rev_t *) baton)->revision_deleted =
-            log_entry->revision;
+          b->revision_deleted = log_entry->revision;
           break;
         }
     }

Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.c?rev=906596&r1=906595&r2=906596&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.c Thu Feb  4 18:21:29 2010
@@ -971,9 +971,9 @@
 
   for (hi = apr_hash_first(pool, path_revs); hi; hi = apr_hash_next(hi))
     {
-      const void *path;
-      apr_hash_this(hi, &path, NULL, NULL);
-      SVN_ERR_ASSERT(*((const char *)path) != '/');
+      const char *path = svn_apr_hash_index_key(hi);
+
+      SVN_ERR_ASSERT(*path != '/');
     }
 
   if (comment && ! svn_xml_is_xml_safe(comment, strlen(comment)))
@@ -996,9 +996,9 @@
 
   for (hi = apr_hash_first(pool, path_tokens); hi; hi = apr_hash_next(hi))
     {
-      const void *path;
-      apr_hash_this(hi, &path, NULL, NULL);
-      SVN_ERR_ASSERT(*((const char *)path) != '/');
+      const char *path = svn_apr_hash_index_key(hi);
+
+      SVN_ERR_ASSERT(*path != '/');
     }
 
   return session->vtable->unlock(session, path_tokens, break_lock,