This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: libc/stdio/ftell.c (ftell_r): Add parenthesis
- From: jjohnstn <jjohnstn at redhat dot com>
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Cc: newlib at sources dot redhat dot com
- Date: Thu, 6 Jan 2005 15:51:17 -0500 (EST)
- Subject: Re: libc/stdio/ftell.c (ftell_r): Add parenthesis
Patch applied.
-- Jeff J.
On Wed, 5 Jan 2005, Hans-Peter Nilsson wrote:
> Glaring at operator precedence, it seems it doesn't actually
> matter, the parentheses just IMHO makes it a bit more readable.
> That is, then you *don't* have to find that operator precedence
> table and check. (I'm purging my local changes; this one's from
> 2000.)
>
> 2005-01-05 Hans-Peter Nilsson <hp@axis.com>
>
> * libc/stdio/ftell.c (ftell_r): Add parenthesis for __SWR
> bit-test in combination with NULL test.
>
> Index: libc/stdio/ftell.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/stdio/ftell.c,v
> retrieving revision 1.7
> diff -c -p -r1.7 ftell.c
> *** libc/stdio/ftell.c 23 Apr 2004 20:01:55 -0000 1.7
> --- libc/stdio/ftell.c 5 Jan 2005 13:59:54 -0000
> *************** _DEFUN(_ftell_r, (ptr, fp),
> *** 143,149 ****
> if (HASUB (fp))
> pos -= fp->_ur;
> }
> ! else if (fp->_flags & __SWR && fp->_p != NULL)
> {
> /*
> * Writing. Any buffered characters cause the
> --- 143,149 ----
> if (HASUB (fp))
> pos -= fp->_ur;
> }
> ! else if ((fp->_flags & __SWR) && fp->_p != NULL)
> {
> /*
> * Writing. Any buffered characters cause the
>
> brgds, H-P
>