summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-02-14 10:01:17 +1100
committerAndrew Tridgell <tridge@samba.org>2010-02-14 18:44:20 +1100
commit95e26884a85118713faea943115dd003d2442dd5 (patch)
treeadef4e2270bd228cc97d7ad5c5e63cb6779bdadb
parent8120bc2ba957fa78e04f6f5fc257c91a7f735e82 (diff)
downloadsamba-95e26884a85118713faea943115dd003d2442dd5.tar.gz
samba-95e26884a85118713faea943115dd003d2442dd5.tar.bz2
samba-95e26884a85118713faea943115dd003d2442dd5.zip
s3-vfs: use TYPESAFE_QSORT() in s3 VFS modules
-rw-r--r--source3/modules/vfs_dirsort.c8
-rw-r--r--source3/modules/vfs_shadow_copy2.c6
2 files changed, 6 insertions, 8 deletions
diff --git a/source3/modules/vfs_dirsort.c b/source3/modules/vfs_dirsort.c
index c2053e14e6..d96aca0cb1 100644
--- a/source3/modules/vfs_dirsort.c
+++ b/source3/modules/vfs_dirsort.c
@@ -20,9 +20,8 @@
#include "includes.h"
-static int compare_dirent (const void *a, const void *b) {
- const SMB_STRUCT_DIRENT *da = (const SMB_STRUCT_DIRENT *) a;
- const SMB_STRUCT_DIRENT *db = (const SMB_STRUCT_DIRENT *) b;
+static int compare_dirent (const SMB_STRUCT_DIRENT *da, const SMB_STRUCT_DIRENT *db)
+{
return StrCaseCmp(da->d_name, db->d_name);
}
@@ -81,8 +80,7 @@ static void open_and_sort_dir (vfs_handle_struct *handle)
/* Sort the directory entries by name */
data->pos = current_pos;
- qsort(data->directory_list, data->number_of_entries,
- sizeof(SMB_STRUCT_DIRENT), compare_dirent);
+ TYPESAFE_QSORT(data->directory_list, data->number_of_entries, compare_dirent);
}
static SMB_STRUCT_DIR *dirsort_opendir(vfs_handle_struct *handle,
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index b26bf272fe..a4265474bf 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -838,9 +838,9 @@ static void shadow_copy2_sort_data(vfs_handle_struct *handle,
if (shadow_copy2_data && shadow_copy2_data->num_volumes > 0 &&
shadow_copy2_data->labels)
{
- qsort(shadow_copy2_data->labels,
- shadow_copy2_data->num_volumes,
- sizeof(SHADOW_COPY_LABEL), cmpfunc);
+ TYPESAFE_QSORT(shadow_copy2_data->labels,
+ shadow_copy2_data->num_volumes,
+ cmpfunc);
}
return;