changeset 32903:99d34e75c682

close-stream: declare local scalars to be "const" * lib/close-stream.c (close_stream): Make boolean variables const to document the fact that we set but do not change them.
author James Youngman <jay@gnu.org>
date Sun, 11 Apr 2010 16:48:21 +0200
parents dc4fce279c7a
children 83fd7365c927
files ChangeLog lib/close-stream.c
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Apr 11 15:01:37 2010 +0200
+++ b/ChangeLog	Sun Apr 11 16:48:21 2010 +0200
@@ -1,3 +1,9 @@
+2010-04-11  James Youngman  <jay@gnu.org>
+
+	close-stream: declare local scalars to be "const"
+	* lib/close-stream.c (close_stream): Make boolean variables const
+	to document the fact that we set but do not change them.
+
 2010-04-11  Bruno Haible  <bruno@clisp.org>
 
 	* m4/libunistring.m4 (gl_LIBUNISTRING): Fix typo in comment.
--- a/lib/close-stream.c	Sun Apr 11 15:01:37 2010 +0200
+++ b/lib/close-stream.c	Sun Apr 11 16:48:21 2010 +0200
@@ -55,9 +55,9 @@
 int
 close_stream (FILE *stream)
 {
-  bool some_pending = (__fpending (stream) != 0);
-  bool prev_fail = (ferror (stream) != 0);
-  bool fclose_fail = (fclose (stream) != 0);
+  const bool some_pending = (__fpending (stream) != 0);
+  const bool prev_fail = (ferror (stream) != 0);
+  const bool fclose_fail = (fclose (stream) != 0);
 
   /* Return an error indication if there was a previous failure or if
      fclose failed, with one exception: ignore an fclose failure if