Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Nov 2023 17:38:33 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 1f90b4edffe8 - main - fflush: Split a temporary variable in two.
Message-ID:  <202311031738.3A3HcXIV030461@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=1f90b4edffe815aebb35e74b79e10593b31f6b75

commit 1f90b4edffe815aebb35e74b79e10593b31f6b75
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-08-03 15:08:03 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-11-03 17:38:12 +0000

    fflush: Split a temporary variable in two.
    
    It is clearer to avoid reusing temporary variables for different
    purposes.
    
    Sponsored by:   Klara, Inc.
---
 lib/libc/stdio/fflush.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/libc/stdio/fflush.c b/lib/libc/stdio/fflush.c
index 30bbd1371ff9..c658fbec697d 100644
--- a/lib/libc/stdio/fflush.c
+++ b/lib/libc/stdio/fflush.c
@@ -103,10 +103,10 @@ int
 __sflush(FILE *fp)
 {
 	unsigned char *p, *old_p;
-	int n, t, old_w;
+	int n, f, t, old_w;
 
-	t = fp->_flags;
-	if ((t & __SWR) == 0)
+	f = fp->_flags;
+	if ((f & __SWR) == 0)
 		return (0);
 
 	if ((p = fp->_bf._base) == NULL)
@@ -121,7 +121,7 @@ __sflush(FILE *fp)
 	old_p = fp->_p;
 	fp->_p = p;
 	old_w = fp->_w;
-	fp->_w = t & (__SLBF|__SNBF) ? 0 : fp->_bf._size;
+	fp->_w = f & (__SLBF|__SNBF) ? 0 : fp->_bf._size;
 
 	for (; n > 0; n -= t, p += t) {
 		t = _swrite(fp, (char *)p, n);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202311031738.3A3HcXIV030461>