Avoid gcc warnings due to misplaced 'const'.
authorBruno Haible <bruno@clisp.org>
Sun, 10 Feb 2008 18:22:48 +0000 (19:22 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 10 Feb 2008 18:22:48 +0000 (19:22 +0100)
ChangeLog
lib/diffseq.h

index cd8df71..fca5c9f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-10  Bruno Haible  <bruno@clisp.org>
+
+       * lib/diffseq.h: Write "ELEMENT const" instead of "const ELEMENT".
+       Needed when ELEMENT is #defined to 'some_type *'.
+
 2008-02-10  Jim Meyering  <meyering@redhat.com>
 
        New script and module: useless-if-before-free
index ad8b8b3..7a62196 100644 (file)
@@ -76,8 +76,8 @@
 struct context
 {
   /* Vectors being compared.  */
-  const ELEMENT *xvec;
-  const ELEMENT *yvec;
+  ELEMENT const *xvec;
+  ELEMENT const *yvec;
 
   /* Extra fields.  */
   EXTRA_CONTEXT_FIELDS
@@ -153,8 +153,8 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal,
 {
   OFFSET *const fd = ctxt->fdiag;      /* Give the compiler a chance. */
   OFFSET *const bd = ctxt->bdiag;      /* Additional help for the compiler. */
-  const ELEMENT *const xv = ctxt->xvec;        /* Still more help for the compiler. */
-  const ELEMENT *const yv = ctxt->yvec;        /* And more and more . . . */
+  ELEMENT const *const xv = ctxt->xvec;        /* Still more help for the compiler. */
+  ELEMENT const *const yv = ctxt->yvec;        /* And more and more . . . */
   const OFFSET dmin = xoff - ylim;     /* Minimum valid diagonal. */
   const OFFSET dmax = xlim - yoff;     /* Maximum valid diagonal. */
   const OFFSET fmid = xoff - yoff;     /* Center diagonal of top-down search. */