summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;