Source-Changes-HG archive

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

[src/trunk]: src/include stdio.h: sync comment for struct __sFILE with reality



details:   https://anonhg.NetBSD.org/src/rev/912e6463c86a
branches:  trunk
changeset: 1023507:912e6463c86a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Sep 11 19:05:06 2021 +0000

description:
stdio.h: sync comment for struct __sFILE with reality

In stdio.h 1.1 from 1993-03-21, the struct had a member named _ub for
the ungetc buffer.  That member was repurposed in stdio.h 1.42 from
2001-12-07 in order to support wide characters.

Remove the reference to the 'WARNING above' since there is no such
warning and even when this comment was added in stdio.h 1.20 from
1998-02-02, there was none.

diffstat:

 include/stdio.h |  15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diffs (29 lines):

diff -r 9de234e0abd0 -r 912e6463c86a include/stdio.h
--- a/include/stdio.h   Sat Sep 11 18:46:22 2021 +0000
+++ b/include/stdio.h   Sat Sep 11 19:05:06 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stdio.h,v 1.102 2021/09/11 18:38:25 rillig Exp $       */
+/*     $NetBSD: stdio.h,v 1.103 2021/09/11 19:05:06 rillig Exp $       */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -103,13 +103,12 @@
  * _lbfsize is used only to make the inline line-buffered output stream
  * code as compact as possible.
  *
- * _ub, _up, and _ur are used when ungetc() pushes back more characters
- * than fit in the current _bf, or when ungetc() pushes back a character
- * that does not match the previous one in _bf.  When this happens,
- * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
- * _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
- *
- * NB: see WARNING above before changing the layout of this structure!
+ * _ub (via _ext and struct __sfileext), _up, and _ur are used when ungetc()
+ * pushes back more characters than fit in the current _bf, or when ungetc()
+ * pushes back a character that does not match the previous one in _bf.
+ * When this happens, _ext._base becomes non-nil (i.e., a stream has ungetc()
+ * data iff _ub._base != NULL) and _up and _ur save the current values of _p
+ * and _r.
  */
 typedef        struct __sFILE {
        unsigned char *_p;      /* current position in (some) buffer */



Home | Main Index | Thread Index | Old Index