Subject: Re: bin/1325: tip computes parity wrong for zero parity
To: None <netbsd-bugs@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: netbsd-bugs
Date: 08/10/1995 12:37:19
>> *** /usr/src/usr.bin/tip/tip.c       Wed Aug  9 11:05:19 1995
>> --- /usr/src/usr.bin/tip/tip.c-orig  Wed Aug  9 11:04:56 1995
>> ***************
>> *** 600,604 ****
>>                 (void) fflush(stderr);
>>         }
>>         for (i = 0; i < 0200; i++)
>> !               partab[i] = (evenpartab[i] ^ flip | set) & clr;
>>   }
>> --- 600,604 ----
>>                 (void) fflush(stderr);
>>         }
>>         for (i = 0; i < 0200; i++)
>> !               partab[i] = evenpartab[i] ^ flip | set & clr;
>>   }
>> 

> I don't like this fix. I prefer to see the parentheses, rather than
> depending on the implied precedence.

>               partab[i] = (evenpartab[i] ^ flip) | (set & clr);

If you will look at the file names at the head of the diff, you will
see that this is almost certainly an accidentally reversed diff.
Besides, your parenthesization makes no sense in view of the names of
the variables; 

                partab[i] = ((evenpartab[i] ^ flip) | set) & clr;

is a fully-parenthesized version that would make sense.

					der Mouse

			    mouse@collatz.mcrcim.mcgill.edu