[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gnulib] __fpending prototype: `const' parameter
From: |
Jim Meyering |
Subject: |
[bug-gnulib] __fpending prototype: `const' parameter |
Date: |
Thu, 25 Nov 2004 18:22:23 +0100 |
I reported this to bug-glibc, but haven't heard back yet.
stdio_ext.h says:
extern size_t __fpending (FILE *__fp) __THROW;
Yet, shouldn't the parameter be a const pointer?
extern size_t __fpending (FILE const *__fp) __THROW;
The same goes for __fbufsize, __freading, __fwriting,
__freadable, __fwritable, and __flbf.
It's hardly a big deal, but seems wrong to use a non-const
pointer here, so I'm fixing it -- unless someone can present
a good counterargument :)
Index: lib/__fpending.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/__fpending.c,v
retrieving revision 1.6
diff -u -p -r1.6 __fpending.c
--- lib/__fpending.c 23 Nov 2004 20:59:12 -0000 1.6
+++ lib/__fpending.c 25 Nov 2004 17:21:49 -0000
@@ -26,7 +26,7 @@
/* Return the number of pending (aka buffered, unflushed)
bytes on the stream, FP, that is open for writing. */
size_t
-__fpending (FILE *fp)
+__fpending (FILE const *fp)
{
return PENDING_OUTPUT_N_BYTES;
}
Index: lib/__fpending.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/__fpending.h,v
retrieving revision 1.4
diff -u -p -r1.4 __fpending.h
--- lib/__fpending.h 4 Jun 2003 19:22:29 -0000 1.4
+++ lib/__fpending.h 25 Nov 2004 17:21:49 -0000
@@ -13,5 +13,5 @@
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL___FPENDING
-size_t __fpending (FILE *);
+size_t __fpending (FILE const *);
#endif
- [bug-gnulib] __fpending prototype: `const' parameter,
Jim Meyering <=