summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-02-14 10:02:19 +1100
committerAndrew Tridgell <tridge@samba.org>2010-02-14 18:44:21 +1100
commit7cff685c7ecb7dbb126d3bd45217d13fa85ad751 (patch)
treef3dec7dbe4f7e926bcc5cd83c892b2b2e6d2ce76 /source3/registry
parentc804102d0ff71f5c5664953020e46304d78de4bc (diff)
downloadsamba-7cff685c7ecb7dbb126d3bd45217d13fa85ad751.tar.gz
samba-7cff685c7ecb7dbb126d3bd45217d13fa85ad751.tar.bz2
samba-7cff685c7ecb7dbb126d3bd45217d13fa85ad751.zip
s3: convert registry and printing code to TYPESAFE_QSORT()
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_backend_db.c6
-rw-r--r--source3/registry/regfio.c3
2 files changed, 4 insertions, 5 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index fe15b4e461..c824175527 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -1177,9 +1177,9 @@ done:
* recreated on demand.
*/
-static int cmp_keynames(const void *p1, const void *p2)
+static int cmp_keynames(char **p1, char **p2)
{
- return StrCaseCmp(*((char **)p1), *((char **)p2));
+ return StrCaseCmp(*p1, *p2);
}
struct create_sorted_subkeys_context {
@@ -1248,7 +1248,7 @@ static NTSTATUS create_sorted_subkeys_action(struct db_context *db,
len += strlen(sorted_subkeys[i])+1;
}
- qsort(sorted_subkeys, num_subkeys, sizeof(char *), cmp_keynames);
+ TYPESAFE_QSORT(sorted_subkeys, num_subkeys, cmp_keynames);
buf = talloc_array(ctr, char, len);
if (buf == NULL) {
diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c
index c3873a894b..fa7dc7dfe9 100644
--- a/source3/registry/regfio.c
+++ b/source3/registry/regfio.c
@@ -1767,8 +1767,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 )
parent->subkey_index++;
/* sort the list by keyname */
-
- qsort( parent->subkeys.hashes, parent->subkey_index, sizeof(REGF_HASH_REC), QSORT_CAST hashrec_cmp );
+ TYPESAFE_QSORT(parent->subkeys.hashes, parent->subkey_index, hashrec_cmp);
if ( !hbin_prs_lf_records( "lf_rec", parent->subkeys.hbin, 0, parent ) )
return False;