Re: [opensuse] glibc example - qsort muppet warnings - stdlib.h expected ‘__compar_fn_t’
- From: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 16 May 2012 08:44:35 -0500
On 05/16/2012 06:25 AM, Andreas Jaeger wrote:
Here's a diff for the manual, I'm getting this fixed in glibc,
Andreas
diff --git a/manual/string.texi b/manual/string.texi
index 5051f54..7abf46b 100644
--- a/manual/string.texi
+++ b/manual/string.texi
@@ -1370,8 +1370,11 @@ efficiently using @code{strxfrm}.)
/* @r{This is the comparison function used with @code{qsort}.} */
int
-compare_elements (char **p1, char **p2)
+compare_elements (const void *v1, const void *v2)
@{
+ char **p1 = (char **)v1;
+ char **p2 = (char **)v2;
+
return strcoll (*p1, *p2);
@}
@@ -1462,8 +1465,11 @@ struct sorter @{ char *input; char *transformed; @};
@r{to sort an array of @code{struct sorter}.} */
int
-compare_elements (struct sorter *p1, struct sorter *p2)
+compare_elements (const void *v1, const void *v2)
@{
+ struct sorter *p1 = (struct sorter *)v1;
+ struct sorter *p2 = (struct sorter *)v2;
+
return strcmp (p1->transformed, p2->transformed);
@}
Both compiles great. Thanks Andreas. Looks like the 2.16 manual will be a good
update to the manual that probably hasn't had a good going over in quite some
time. Thanks for all you efforts there.
--
David C. Rankin, J.D.,P.E.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx
- Follow-Ups:
- Re: [opensuse] glibc example - qsort muppet warnings - stdlib.h expected ‘__compar_fn_t’
- From: David C. Rankin
- Re: [opensuse] glibc example - qsort muppet warnings - stdlib.h expected ‘__compar_fn_t’
- References:
- [opensuse] glibc example - qsort muppet warnings - stdlib.h expected ‘__compar_fn_t’
- From: David C. Rankin
- Re: [opensuse] glibc example - qsort muppet warnings - stdlib.h expected ‘__compar_fn_t’
- From: Andreas Jaeger
- [opensuse] glibc example - qsort muppet warnings - stdlib.h expected ‘__compar_fn_t’
- Prev by Date: [opensuse] Re: [opensuse] glibc example - qsort muppet warnings - stdlib.h expected ‘__compar_fn_t’
- Next by Date: Re: [opensuse] glibc example - qsort muppet warnings - stdlib.h expected ‘__compar_fn_t’
- Previous by thread: Re: [opensuse] glibc example - qsort muppet warnings - stdlib.h expected ‘__compar_fn_t’
- Next by thread: Re: [opensuse] glibc example - qsort muppet warnings - stdlib.h expected ‘__compar_fn_t’
- Index(es):
Relevant Pages
|