From e39745ffa030f685fbba13534a3023d52a27ead8 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Thu, 17 May 2012 11:05:52 +0200 Subject: Avoid compiler warnings in qsort/bsearch examples --- manual/examples/search.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'manual/examples') diff --git a/manual/examples/search.c b/manual/examples/search.c index e37656721b..7fe05ea2d9 100644 --- a/manual/examples/search.c +++ b/manual/examples/search.c @@ -53,8 +53,11 @@ int count = sizeof (muppets) / sizeof (struct critter); /* This is the comparison function used for sorting and searching. */ int -critter_cmp (const struct critter *c1, const struct critter *c2) +critter_cmp (const void *v1, const void *v2) { + const struct critter *c1 = v1; + const struct critter *c2 = v2; + return strcmp (c1->name, c2->name); } -- cgit 1.4.1