Re: The use of a zero flag

2005-01-13 Thread Dimitrie O. Paun
On Thu, Jan 13, 2005 at 04:14:36PM +0100, Francois Gouget wrote: > The previous script doesn't. Handling this is a bit more tricky, mostly > because of sed's restrictions on regular expressions. Heh, nice script. Maybe we should have such an item on the page after all, maybe together with the scr

Re: The use of a zero flag

2005-01-13 Thread Francois Gouget
On Thu, 13 Jan 2005, Paul Vriens wrote: [...] how do you cater for the following in your one-liner: include/accctrl.h:#define ACTRL_RESERVED 0x include/accctrl.h:#define ACTRL_DS_OPEN ACTRL_RESERVED good luck :-) The previous script doesn't. Handling this is a bit

Re: The use of a zero flag

2005-01-13 Thread Paul Vriens
> > regexp=`sed -e 's/^ *# *define *\([a-zA-Z_][a-zA-Z0-9_]*\) *0 *$/\1/' -e > 't' -e 's/^ *# *define *\([a-zA-Z_][a-zA-Z0-9_]*\) *0x00*L* *$/\1/' -e 't' > -e 'd' include/*.h`;regexp=`echo $regexp | sed -e 's/ NULL / /' -e 's/ > /|/g'`;egrep -r -n "& *($regexp)[^a-zA-Z0-9_]" . > > Francois Gouget

Re: The use of a zero flag

2005-01-13 Thread Francois Gouget
On Wed, 12 Jan 2005, Dimitrie O. Paun wrote: On Wed, Jan 12, 2005 at 09:04:20PM +0100, Paul Vriens wrote: Is it worthwhile to set up a Janitorial task for this or are these plain bugs? On the one hand it will be hard to find these and you have to know the code of course. Yeah, I think it's worthwhi

Re: The use of a zero flag

2005-01-13 Thread Rolf Kalbermatter
Paul Vriens wrote: >a few days ago I found a bug in ole32/compobj.c where we did something >like: > >if ( foo & FLAG) where FLAG=0 > >This 'inspired' me to check for more of these kind of checks. > >One that I already found is in dlls/dplayx/dplay.c > >We are checking for DPSET_REMOTE (which

Re: The use of a zero flag

2005-01-12 Thread Dimitrie O. Paun
On Wed, Jan 12, 2005 at 09:04:20PM +0100, Paul Vriens wrote: > Is it worthwhile to set up a Janitorial task for this or are these plain > bugs? On the one hand it will be hard to find these and you have to know > the code of course. Yeah, I think it's worthwhile to look at such cases, but I don't

The use of a zero flag

2005-01-12 Thread Paul Vriens
Hi, a few days ago I found a bug in ole32/compobj.c where we did something like: if ( foo & FLAG) where FLAG=0 This 'inspired' me to check for more of these kind of checks. One that I already found is in dlls/dplayx/dplay.c We are checking for DPSET_REMOTE (which is zero) where we should