[PATCH] FCI work for cabinet.dll [cabinet-fci-patch-02b.diff]

Gerold J. Wucherpfennig gjwucherpfennig at gmx.net
Sat Jun 11 09:37:57 CDT 2005

On Wednesday 08 June 2005 19:16, you wrote:
> From: "Gerold J. Wucherpfennig" <gjwucherpfennig at gmx.net>
> Cool stuff Gerold. A few nits:
> > +  if(PFCI_INT(hfci)->fNextCab==TRUE) {
> It's better to avoid explicit comparison with TRUE.
> What if fNextCab is 10, not 1? It's still true, but
> it will fail the above test. Just do:
> +  if(PFCI_INT(hfci)->fNextCab) {

Hi Dimi,

actually I don't who you are and how involved you are in the wine
development process. I have to admit that I'm just a
beginner wine-dev-wise, but I have a strong opinion about the
use of BOOL.

In my opinion BOOL is a crap and a real shortcoming
of the C programming language.

To be on the "super-safe" side one has to check before
a BOOL value is checked if the value is different from TRUE and FALSE.
When that's the case bail out the running program with an INTERNAL ERROR.
That would make the source code hartly readable so I won't do that. 

(Remember: It's better to break a programm than to corrupt it.)

A BOOL value should never be assigned a value other than TRUE or FALSE.
Use the ? : operator if necessary. (If anybody disagrees the one should 
undefine TRUE and use !=FALSE instead for the sake of integrity)

And last: if(fNextCab==TRUE) makes it more obvious for the quick
source code reader when a BOOL value is compared than if(fNextCab).

> Also, I know you're modifying existing code, but if it's not
> too much to ask, 2-space indent is hard to read, and the vast
> majority of developers do prefer 4-space indent. So if you
> don't mind, and we can find a solution, would be great if we
> can stick to 4-spaces instead.

Sorry Dimi, my opinion differs here too...

1. I don't want to type the spacebar 4 times an ident is made
    (though I could configure the text editor to do "this" for me).
2. I want to stick to the maximum column width of 80 chars. With
    5 idents in a line that would only left 60 chars of code compared
    to 70.
3. In my opinion with an ident of 2 chars you can clearly distinguish
    two diffent idents though my eyes are really not the best, so an ident
    of 4 chars is unnecessary.
4. I don't want to use 4-space idents if there are other wine developers
    who also use differing idents, because I not convinced of 4-space idents.

By the way I've fixed some of the remaining bugs, but I will 
post a new patch when I've fixed all known bugs, so
please do not commit old patches.


More information about the wine-devel mailing list