[PATCH 5/5] ddraw: Get rid of IDirectDrawImpl.
hverbeet at codeweavers.com
Fri Mar 9 08:53:13 CST 2012
On 2012-03-09 13:29, Christian Costa wrote:
> Hi Henry,
> Maybe it's a bit late to ask this but what's the reasoning behind
> introducing the struct keyword ?
Typedefs have their uses, but the way it's used here is just
obfuscation. Pretty much all it does is hiding the fact that a type is a
structure. Also, while this doesn't apply to this specific patch,
something like "const LPWSAPROTOCOL_INFOW" doesn't do what you want, and
e.g. "CONST LPD3DXFRAME *frame" in d3dx9anim.h can probably at least in
part be blamed on the silly typedef.
> And why removing use of This ? It's a common practise in all wine code.
Mostly personal preference since I'm touching the code anyway. I must
say that I don't consider it a particularly useful convention though.
Something like "ddraw" or "surface" is a much more descriptive variable
name than "This" or "This". Naming something "This" mostly just tells
you that it's the first argument of the function, presumably for
similarity to C++ "this". In that sense I guess it's somewhat similar to
naming your function arguments "arg0", "arg1", "arg2", etc. Also, as far
as I'm concerned, about the only places I want to see caps in code are
macros and enum elements.
Of course other people will have their own preferences in that regard,
but looking at the git shortlog summary for the past few years, I don't
expect that to be a significant issue. If anything, it makes the code
more consistent with wined3d.
More information about the wine-devel