Re: MSI: indentation and style cleanup

2005-01-24 Thread Alexandre Julliard
Michael Stefaniuc <[EMAIL PROTECTED]> writes: > Well, it should be pretty easy to write a short smatch script to find > that occurences. Afair the smatch guys wrote one for the Linux kernel > which would need only small adaptations. And coincidently i have this > weekend a long flight trip on my

Re: MSI: indentation and style cleanup

2005-01-24 Thread Andreas Mohr
Hi, On Mon, Jan 24, 2005 at 09:02:56AM +0100, Rolf Kalbermatter wrote: > On Sat, Jan 22, 2005 at 05:16:45PM +, Mike Hearn wrote: > > > Given that it can be quite complex and introduce new bugs, and given that > > it's really quite a useless feature IMHO as modern Linux boxes will hang > > the

Re: MSI: indentation and style cleanup

2005-01-24 Thread Rolf Kalbermatter
On Sat, Jan 22, 2005 at 05:16:45PM +, Mike Hearn wrote: > Given that it can be quite complex and introduce new bugs, and given that > it's really quite a useless feature IMHO as modern Linux boxes will hang > themselves in swap hell before returning NULL from malloc I don't think > this should

Re: MSI: indentation and style cleanup

2005-01-23 Thread Rob Shearman
Mike Hearn wrote: OOM safety is a bit complicated, you have to properly unwind the stack and restore state as you go - for instance the last patch I submitted fixed a bug where OOM would not cause the loop to terminate, but I forgot to free some data as we returned up the stack. Given that it can

Re: MSI: indentation and style cleanup

2005-01-23 Thread Dimitrie O. Paun
On Sat, Jan 22, 2005 at 05:16:45PM +, Mike Hearn wrote: > Given that it can be quite complex and introduce new bugs, and given that > it's really quite a useless feature IMHO as modern Linux boxes will hang > themselves in swap hell before returning NULL from malloc I don't think > this should

Re: MSI: indentation and style cleanup

2005-01-23 Thread Mike Hearn
On Sun, 23 Jan 2005 10:33:38 +0100, Michael Stefaniuc wrote: > I thought more of checking the return value of HeapAlloc/HeapRealloc to > make sure it's not NULL. This would be easy to do. What you proposed is > too complicated. Well, what happens if it is NULL? You can print an error and then re

Re: MSI: indentation and style cleanup

2005-01-23 Thread Michael Stefaniuc
Mike Hearn wrote: On Fri, 21 Jan 2005 22:02:00 +0100, Michael Stefaniuc wrote: Well, it should be pretty easy to write a short smatch script to find that occurences. Afair the smatch guys wrote one for the Linux kernel which would need only small adaptations. OOM safety is a bit complicated, you

Re: MSI: indentation and style cleanup

2005-01-22 Thread Mike Hearn
On Fri, 21 Jan 2005 22:02:00 +0100, Michael Stefaniuc wrote: > Well, it should be pretty easy to write a short smatch script to find > that occurences. Afair the smatch guys wrote one for the Linux kernel > which would need only small adaptations. OOM safety is a bit complicated, you have to pro

Re: MSI: indentation and style cleanup

2005-01-21 Thread Michael Stefaniuc
Alexandre Julliard wrote: Mike McCormack <[EMAIL PROTECTED]> writes: I thought that crashing on out of memory conditions was a valid method of error handling in the Julliard handbook of coding, so I removed a pointless check :) If we're going to mandate proper checking of memory allocation, then w

Re: MSI: indentation and style cleanup

2005-01-21 Thread Alexandre Julliard
Mike McCormack <[EMAIL PROTECTED]> writes: > I thought that crashing on out of memory conditions was a valid method > of error handling in the Julliard handbook of coding, so I removed a > pointless check :) > > If we're going to mandate proper checking of memory allocation, then > we need to mak

Re: MSI: indentation and style cleanup

2005-01-21 Thread Alexandre Julliard
Mike McCormack <[EMAIL PROTECTED]> writes: > -if(szFilePath) { > +if( szFilePath ) > +{ > len = MultiByteToWideChar( CP_ACP, 0, szFilePath, -1, NULL, 0 ); > szwFilePath = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); > -if( !szwFilePath) > -

Re: MSI: indentation and style cleanup

2005-01-21 Thread Mike McCormack
Alexandre Julliard wrote: Does your coding style also forbid proper error checking, or is there another reason for removing that check? I thought that crashing on out of memory conditions was a valid method of error handling in the Julliard handbook of coding, so I removed a pointless check :)