about summary refs log tree commit diff
path: root/manual/examples/search.c
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2012-05-17 11:05:52 +0200
committerAndreas Jaeger <aj@suse.de>2012-05-17 11:05:52 +0200
commite39745ffa030f685fbba13534a3023d52a27ead8 (patch)
tree4de2877d5a92a8d355546bd701a348327d7bc0c2 /manual/examples/search.c
parent48970aba309f08d3c94ddc8796630df87b8e093a (diff)
downloadglibc-e39745ffa030f685fbba13534a3023d52a27ead8.tar.gz
glibc-e39745ffa030f685fbba13534a3023d52a27ead8.tar.xz
glibc-e39745ffa030f685fbba13534a3023d52a27ead8.zip
Avoid compiler warnings in qsort/bsearch examples
Diffstat (limited to 'manual/examples/search.c')
-rw-r--r--manual/examples/search.c5
1 files changed, 4 insertions, 1 deletions
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);
 }