This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.15-944-ge39745f


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  e39745ffa030f685fbba13534a3023d52a27ead8 (commit)
      from  48970aba309f08d3c94ddc8796630df87b8e093a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e39745ffa030f685fbba13534a3023d52a27ead8

commit e39745ffa030f685fbba13534a3023d52a27ead8
Author: Andreas Jaeger <aj@suse.de>
Date:   Thu May 17 11:05:52 2012 +0200

    Avoid compiler warnings in qsort/bsearch examples

diff --git a/ChangeLog b/ChangeLog
index a52484e..f6dbf40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-17  Andreas Jaeger  <aj@suse.de>
+
+	* manual/examples/search.c (critter_cmp): Change signature to
+	avoid warnings.
+	* manual/string.texi (Collation Functions): Likewise.
+
 2012-05-16  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* bits/types.h: Fold copyright years.
diff --git a/manual/examples/search.c b/manual/examples/search.c
index e376567..7fe05ea 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);
 }
 
diff --git a/manual/string.texi b/manual/string.texi
index 5051f54..831873b 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 * const *p1 = v1;
+  char * const *p1 = 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)
 @{
+  const struct sorter *p1 = v1;
+  const struct sorter *p2 = v2;
+
   return strcmp (p1->transformed, p2->transformed);
 @}
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                |    6 ++++++
 manual/examples/search.c |    5 ++++-
 manual/string.texi       |   10 ++++++++--
 3 files changed, 18 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]