Commit 376edd78 authored by Andreas Schlick's avatar Andreas Schlick Committed by Rusty Russell

asort: Remove constness from ctx pointer.

parent abac6053
......@@ -3,8 +3,8 @@
#if HAVE_NESTED_FUNCTIONS
void _asort(void *base, size_t nmemb, size_t size,
int(*compar)(const void *, const void *, const void *ctx),
const void *ctx)
int(*compar)(const void *, const void *, void *ctx),
void *ctx)
{
/* This gives bogus "warning: no previous prototype for ‘cmp’"
* with gcc 4 with -Wmissing-prototypes. Hence the auto crap. */
......@@ -107,8 +107,8 @@ typedef struct
void
_asort (void *const pbase, size_t total_elems, size_t size,
int(*cmp)(const void *, const void *, const void *arg),
const void *arg)
int(*cmp)(const void *, const void *, void *arg),
void *arg)
{
register char *base_ptr = (char *) pbase;
......
......@@ -18,14 +18,14 @@
*/
#define asort(base, num, cmp, ctx) \
_asort((base), (num), sizeof(*(base)), \
cast_if_type(int (*)(const void *, const void *, const void *), \
cast_if_type(int (*)(const void *, const void *, void *), \
(cmp), &*(cmp), \
int (*)(const __typeof__(*(base)) *, \
const __typeof__(*(base)) *, \
__typeof__(ctx))), (ctx))
void _asort(void *base, size_t nmemb, size_t size,
int(*compar)(const void *, const void *, const void *),
const void *ctx);
int(*compar)(const void *, const void *, void *),
void *ctx);
#endif /* CCAN_ASORT_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment