Make pointer decrementing code ANSI C compliant.
authorBruno Haible <bruno@clisp.org>
Sun, 11 Mar 2007 22:34:33 +0000 (22:34 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 11 Mar 2007 22:34:33 +0000 (22:34 +0000)
ChangeLog
lib/gl_array_oset.c

index 6352e0ed4abc3f9849e94b2bd75dd0787eebf8c0..85d4d68570195504c7f8f53c6d83acee44c6c416 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-03-11  Bruno Haible  <bruno@clisp.org>
+
+       * lib/gl_array_oset.c (gl_array_iterator_next): Make pointer
+       decrementing code ANSI C compliant.
+
 2007-03-11  Bruno Haible  <bruno@clisp.org>
 
        * lib/dummy.c [__sun]: Define a dummy variable, not just a typedef.
index b7e2be021e47eb41fb017087040fe17c789ee2c7..f7950b7a6291cbd743b316eb524bd148e4c601e6 100644 (file)
@@ -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 <bruno@clisp.org>, 2006.
 
    This program is free software; you can redistribute it and/or modify
@@ -297,8 +297,8 @@ gl_array_iterator_next (gl_oset_iterator_t *iterator, const void **eltp)
        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)
     {