changeset 37209:f23811891fc5

fpending, obstack, strerror-override: use pure+const function attrs * lib/fpending.h (__fpending): Declare with the "pure" attribute. * lib/obstack.c (_obstack_allocated_p): Likewise. * lib/obstack.h (_obstack_memory_used): Likewise. (_obstack_memory_used): Likewise. * lib/strerror-override.h (strerror_override): Declare with the "const" attribute.
author Jim Meyering <meyering@fb.com>
date Mon, 30 Sep 2013 10:19:38 -0700
parents 1eb5f45967c9
children 6f482e14788b
files ChangeLog lib/fpending.h lib/obstack.c lib/obstack.h lib/strerror-override.h
diffstat 5 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Oct 18 10:30:42 2013 -0600
+++ b/ChangeLog	Mon Sep 30 10:19:38 2013 -0700
@@ -1,3 +1,13 @@
+2013-09-30  Jim Meyering  <meyering@fb.com>
+
+	fpending, obstack, strerror-override: use pure+const function attrs
+	* lib/fpending.h (__fpending): Declare with the "pure" attribute.
+	* lib/obstack.c (_obstack_allocated_p): Likewise.
+	* lib/obstack.h (_obstack_memory_used): Likewise.
+	(_obstack_memory_used): Likewise.
+	* lib/strerror-override.h (strerror_override): Declare with
+	the "const" attribute.
+
 2013-10-18  Eric Blake  <eblake@redhat.com>
 
 	extern-inline: make safe for -Wundef usage
--- a/lib/fpending.h	Fri Oct 18 10:30:42 2013 -0600
+++ b/lib/fpending.h	Mon Sep 30 10:19:38 2013 -0700
@@ -25,5 +25,5 @@
 #endif
 
 #ifndef __fpending
-size_t __fpending (FILE *);
+size_t __fpending (FILE *) _GL_ATTRIBUTE_PURE;
 #endif
--- a/lib/obstack.c	Fri Oct 18 10:30:42 2013 -0600
+++ b/lib/obstack.c	Mon Sep 30 10:19:38 2013 -0700
@@ -313,7 +313,7 @@
 
 /* Suppress -Wmissing-prototypes warning.  We don't want to declare this in
    obstack.h because it is just for debugging.  */
-int _obstack_allocated_p (struct obstack *h, void *obj);
+int _obstack_allocated_p (struct obstack *h, void *obj) _GL_ATTRIBUTE_PURE;
 
 int
 _obstack_allocated_p (struct obstack *h, void *obj)
--- a/lib/obstack.h	Fri Oct 18 10:30:42 2013 -0600
+++ b/lib/obstack.h	Mon Sep 30 10:19:38 2013 -0700
@@ -183,7 +183,7 @@
 extern int _obstack_begin_1 (struct obstack *, int, int,
                              void *(*) (void *, long),
                              void (*) (void *, void *), void *);
-extern int _obstack_memory_used (struct obstack *);
+extern int _obstack_memory_used (struct obstack *) _GL_ATTRIBUTE_PURE;
 
 /* The default name of the function for freeing a chunk is 'obstack_free',
    but gnulib users can override this by defining '__obstack_free'.  */
--- a/lib/strerror-override.h	Fri Oct 18 10:30:42 2013 -0600
+++ b/lib/strerror-override.h	Mon Sep 30 10:19:38 2013 -0700
@@ -48,7 +48,7 @@
      || GNULIB_defined_EOWNERDEAD \
      || GNULIB_defined_ENOTRECOVERABLE \
      || GNULIB_defined_EILSEQ
-extern const char *strerror_override (int errnum);
+extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST;
 # else
 #  define strerror_override(ignored) NULL
 # endif