Author: julianfoad
Date: Fri Jul  8 13:36:44 2011
New Revision: 1144311

URL: http://svn.apache.org/viewvc?rev=1144311&view=rev
Log:
Make an output parameter of a private function optional because three out
of four callers don't want it.

* subversion/libsvn_ra_neon/ra_neon.h
  (svn_ra_neon__has_capability): Make the 'youngest_rev' output parameter
    optional.

* subversion/libsvn_ra_neon/options.c
  (parse_capabilities, svn_ra_neon__exchange_capabilities): Make the
    'youngest_rev' output parameter optional.
  (svn_ra_neon__get_activity_collection, svn_ra_neon__has_capability):
    Update calls to svn_ra_neon__exchange_capabilities, eliminating an
    'ignored_rev' variable.

* subversion/libsvn_ra_neon/session.c
  (svn_ra_neon__open): Update a call to svn_ra_neon__exchange_capabilities,
    eliminating an 'ignored_rev' variable.

Modified:
    subversion/trunk/subversion/libsvn_ra_neon/options.c
    subversion/trunk/subversion/libsvn_ra_neon/ra_neon.h
    subversion/trunk/subversion/libsvn_ra_neon/session.c

Modified: subversion/trunk/subversion/libsvn_ra_neon/options.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/options.c?rev=1144311&r1=1144310&r2=1144311&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/options.c (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/options.c Fri Jul  8 13:36:44 
2011
@@ -134,9 +134,9 @@ static const char *capability_server_yes
    information discovered from REQ's headers.  Use POOL for temporary
    allocation only.
 
-   Also, set *YOUNGEST_REV to the current youngest revision if we can
-   detect that from the OPTIONS exchange; set it to SVN_INVALID_REVNUM
-   otherwise.  */
+   Also, if YOUNGEST_REV is not NULL, set *YOUNGEST_REV to the current
+   youngest revision if we can detect that from the OPTIONS exchange, or
+   to SVN_INVALID_REVNUM otherwise.  */
 static void
 parse_capabilities(ne_request *req,
                    svn_ra_neon__session_t *ras,
@@ -145,7 +145,8 @@ parse_capabilities(ne_request *req,
 {
   const char *val;
 
-  *youngest_rev = SVN_INVALID_REVNUM;
+  if (youngest_rev)
+    *youngest_rev = SVN_INVALID_REVNUM;
 
   /* Start out assuming all capabilities are unsupported. */
   apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_PARTIAL_REPLAY,
@@ -222,7 +223,8 @@ parse_capabilities(ne_request *req,
   /* Not strictly capabilities, but while we're here, we might as well... */
   if ((val = ne_get_response_header(req, SVN_DAV_YOUNGEST_REV_HEADER)))
     {
-      *youngest_rev = SVN_STR_TO_REV(val);
+      if (youngest_rev)
+        *youngest_rev = SVN_STR_TO_REV(val);
     }
   if ((val = ne_get_response_header(req, SVN_DAV_REPOS_UUID_HEADER)))
     {
@@ -295,7 +297,8 @@ svn_ra_neon__exchange_capabilities(svn_r
   oc.pool = pool;
   oc.cdata = svn_stringbuf_create("", pool);
 
-  *youngest_rev = SVN_INVALID_REVNUM;
+  if (youngest_rev)
+    *youngest_rev = SVN_INVALID_REVNUM;
   if (relocation_location)
     *relocation_location = NULL;
 
@@ -359,10 +362,8 @@ svn_ra_neon__get_activity_collection(con
                                      svn_ra_neon__session_t *ras,
                                      apr_pool_t *pool)
 {
-  svn_revnum_t ignored_revnum;
   if (! ras->act_coll)
-    SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL,
-                                               &ignored_revnum, pool));
+    SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL, NULL, pool));
   *activity_coll = svn_string_create(ras->act_coll, pool);
   return SVN_NO_ERROR;
 }
@@ -391,9 +392,7 @@ svn_ra_neon__has_capability(svn_ra_sessi
   /* If any capability is unknown, they're all unknown, so ask. */
   if (cap_result == NULL)
     {
-      svn_revnum_t ignored_revnum;
-      SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL,
-                                                 &ignored_revnum, pool));
+      SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL, NULL, pool));
     }
 
 

Modified: subversion/trunk/subversion/libsvn_ra_neon/ra_neon.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/ra_neon.h?rev=1144311&r1=1144310&r2=1144311&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/ra_neon.h (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/ra_neon.h Fri Jul  8 13:36:44 
2011
@@ -1125,7 +1125,8 @@ svn_ra_neon__has_capability(svn_ra_sessi
 
    If the server is kind enough to tell us the current youngest
    revision of the target repository, set *YOUNGEST_REV to that value;
-   set it to SVN_INVALID_REVNUM otherwise.
+   set it to SVN_INVALID_REVNUM otherwise.  YOUNGEST_REV may be NULL if
+   the caller is not interested in receiving this information.
 
    NOTE:  This function also expects the server to announce the
    activity collection.  */

Modified: subversion/trunk/subversion/libsvn_ra_neon/session.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/session.c?rev=1144311&r1=1144310&r2=1144311&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/session.c (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/session.c Fri Jul  8 13:36:44 
2011
@@ -794,7 +794,6 @@ svn_ra_neon__open(svn_ra_session_t *sess
   const char *pkcs11_provider;
   const char *useragent = NULL;
   const char *client_string = NULL;
-  svn_revnum_t ignored_revnum;
 
   SVN_ERR_ASSERT(svn_uri_is_canonical(repos_URL, pool));
 
@@ -1079,8 +1078,7 @@ svn_ra_neon__open(svn_ra_session_t *sess
 
   session->priv = ras;
 
-  return svn_ra_neon__exchange_capabilities(ras, corrected_url,
-                                            &ignored_revnum, pool);
+  return svn_ra_neon__exchange_capabilities(ras, corrected_url, NULL, pool);
 }
 
 


Reply via email to