From 3f0898a9f50a35ae94fda9b89809edae0cd9bbb3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 14 Feb 2010 10:03:12 +1100 Subject: s3-smbd: convert lanman and notify code to TYPESAFE_QSORT() --- source3/smbd/notify_internal.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source3/smbd/notify_internal.c') diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c index db165f71cc..0467e672c1 100644 --- a/source3/smbd/notify_internal.c +++ b/source3/smbd/notify_internal.c @@ -200,10 +200,8 @@ static NTSTATUS notify_load(struct notify_context *notify, struct db_record *rec /* compare notify entries for sorting */ -static int notify_compare(const void *p1, const void *p2) +static int notify_compare(const struct notify_entry *e1, const struct notify_entry *e2) { - const struct notify_entry *e1 = (const struct notify_entry *)p1; - const struct notify_entry *e2 = (const struct notify_entry *)p2; return strcmp(e1->path, e2->path); } @@ -339,9 +337,7 @@ static NTSTATUS notify_add_array(struct notify_context *notify, struct db_record d->max_mask |= e->filter; d->max_mask_subdir |= e->subdir_filter; - if (d->num_entries > 1) { - qsort(d->entries, d->num_entries, sizeof(d->entries[0]), notify_compare); - } + TYPESAFE_QSORT(d->entries, d->num_entries, notify_compare); /* recalculate the maximum masks */ d->max_mask = 0; -- cgit