You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/08/22 13:32:10 UTC

svn commit: r987868 - /subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c

Author: stefan2
Date: Sun Aug 22 11:32:10 2010
New Revision: 987868

URL: http://svn.apache.org/viewvc?rev=987868&view=rev
Log:
Fix usage of qsort() to make it more portable. The comparison function
type name is not "standardized", so we can't use it for casting.

* subversion/libsvn_fs_fs/temp_serializer.c
  (compare_dirent_id_names):
   change signature such that qsort does not require casting it
  (serialize_dir): remove the cast operator

Modified:
    subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c

Modified: subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c?rev=987868&r1=987867&r2=987868&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c Sun Aug 22 11:32:10 2010
@@ -253,9 +253,10 @@ typedef struct hash_data_t
 } hash_data_t;
 
 int
-compare_dirent_id_names(svn_fs_dirent_t **lhs, svn_fs_dirent_t **rhs)
+compare_dirent_id_names(const void *lhs, const void *rhs)
 {
-  return strcmp((*lhs)->name, (*rhs)->name);
+  return strcmp((*(svn_fs_dirent_t **)lhs)->name, 
+                (*(svn_fs_dirent_t **)rhs)->name);
 }
 
 /* Utility function to serialize the ENTRIES into a new serialization
@@ -284,7 +285,7 @@ serialize_dir(apr_hash_t *entries, apr_p
   qsort(hash_data.entries,
         count,
         sizeof(*hash_data.entries),
-        (comparison_fn_t)compare_dirent_id_names);
+        compare_dirent_id_names);
 
   /* serialize that aux. structure into a new  */
   context = svn_temp_serializer__init(&hash_data,