This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libc/stdio/ftell.c (ftell_r): Add parenthesis


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]