subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1459370 - in /subversion/trunk/subversion: include/private/svn_dep_compat.h libsvn_subr/hash.c
Date Thu, 21 Mar 2013 15:49:13 GMT
Author: julianfoad
Date: Thu Mar 21 15:49:12 2013
New Revision: 1459370

URL: http://svn.apache.org/r1459370
Log:
Don't define svn_hash__clear() at all if we don't need it as a replacement for
apr_hash_clear().  A follow-up to r1459058 and 1459353.

* subversion/include/private/svn_dep_compat.h
  (svn_hash__clear): Only declare it if we need it. Add a doc string.

* subversion/libsvn_subr/hash.c
  (svn_hash__clear): When we don't need a replacement for apr_hash_clear(),
    don't define this function at all, instead of defining it as a wrapper.

Modified:
    subversion/trunk/subversion/include/private/svn_dep_compat.h
    subversion/trunk/subversion/libsvn_subr/hash.c

Modified: subversion/trunk/subversion/include/private/svn_dep_compat.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_dep_compat.h?rev=1459370&r1=1459369&r2=1459370&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_dep_compat.h (original)
+++ subversion/trunk/subversion/include/private/svn_dep_compat.h Thu Mar 21 15:49:12 2013
@@ -62,12 +62,16 @@ extern "C" {
 #define apr_array_clear(arr)         (arr)->nelts = 0
 #endif
 
+#if !APR_VERSION_AT_LEAST(1,3,0)
+/* Equivalent to the apr_hash_clear() function in APR >= 1.3.0.  Used to
+ * implement the 'apr_hash_clear' macro if the version of APR that
+ * we build against does not provide the apr_hash_clear() function. */
+void svn_hash__clear(struct apr_hash_t *ht);
+
 /**
  * If we don't have a recent enough APR, emulate the behavior of the
  * apr_hash_clear() API.
  */
-void svn_hash__clear(struct apr_hash_t *ht);
-#if !APR_VERSION_AT_LEAST(1,3,0)
 #define apr_hash_clear(ht)           svn_hash__clear(ht)
 #endif
 

Modified: subversion/trunk/subversion/libsvn_subr/hash.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/hash.c?rev=1459370&r1=1459369&r2=1459370&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/hash.c (original)
+++ subversion/trunk/subversion/libsvn_subr/hash.c Thu Mar 21 15:49:12 2013
@@ -508,12 +508,10 @@ svn_hash_from_cstring_keys(apr_hash_t **
 }
 
 
+#if !APR_VERSION_AT_LEAST(1, 3, 0)
 void
 svn_hash__clear(apr_hash_t *hash)
 {
-#if APR_VERSION_AT_LEAST(1, 3, 0)
-  apr_hash_clear(hash);
-#else
   apr_hash_index_t *hi;
   const void *key;
   apr_ssize_t klen;
@@ -523,8 +521,8 @@ svn_hash__clear(apr_hash_t *hash)
       apr_hash_this(hi, &key, &klen, NULL);
       apr_hash_set(hash, key, klen, NULL);
     }
-#endif
 }
+#endif
 
 
 



Mime
View raw message