bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

array-oset: fix compilation error


From: Bruno Haible
Subject: array-oset: fix compilation error
Date: Sun, 11 Mar 2007 23:35:01 +0100
User-agent: KMail/1.5.4

This fixes a compilation error with non-gcc compilers. Seen with SunPRO C
on Solaris 2.5.1.

2007-03-11  Bruno Haible  <address@hidden>

        * lib/gl_array_oset.c (gl_array_iterator_next): Make pointer
        decrementing code ANSI C compliant.

--- lib/gl_array_oset.c 6 Nov 2006 13:03:10 -0000       1.7
+++ lib/gl_array_oset.c 11 Mar 2007 22:29:06 -0000
@@ -1,5 +1,5 @@
 /* Ordered set data type implemented by an array.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2006.
 
    This program is free software; you can redistribute it and/or modify
@@ -297,8 +297,8 @@
        abort ();
       /* The last returned element was removed.  */
       iterator->count--;
-      iterator->p--;
-      iterator->q--;
+      iterator->p = (const void **) iterator->p - 1;
+      iterator->q = (const void **) iterator->q - 1;
     }
   if (iterator->p < iterator->q)
     {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]