[ros-kernel] Re: Proposed ReactOS headers and code sharing policy
Martin Fuchs
martin-fuchs at gmx.net
Sun Oct 19 12:21:40 CEST 2003
Hello,
> I think we have the Final Answer on what we're going to do about headers
> and code sharing. I want to get feedback from the ReactOS team and from
> the MinGW and Wine projects before we do this, because I only want to do
> it once. I will implement this policy (with any modifications made by
> this message thread) as soon as we are in general agreement.
Sounds very good to have only one set of headers.
But I personally don't like W32API headers very much.
If you look into the W32API header files, there are all those declarations without any particular order and withespace to make it readable. Also there are missing comments, which say a bit about what the function/macro/type does.
For example look at this:
[W32api]
..
typedef struct _ICONINFO {
BOOL fIcon;
DWORD xHotspot;
DWORD yHotspot;
HBITMAP hbmMask;
HBITMAP hbmColor;
} ICONINFO,*PICONINFO;
typedef struct tagNMHDR {
HWND hwndFrom;
UINT idFrom;
UINT code;
} NMHDR,*LPNMHDR;
typedef struct _WNDCLASSA {
UINT style;
WNDPROC lpfnWndProc;
int cbClsExtra;
int cbWndExtra;
..
[Wine]
typedef struct tagANIMATIONINFO
{
UINT cbSize;
INT iMinAnimate;
} ANIMATIONINFO, *LPANIMATIONINFO;
typedef struct tagNMHDR
{
HWND hwndFrom;
UINT_PTR idFrom;
UINT code;
} NMHDR, *LPNMHDR;
typedef struct
{
UINT cbSize;
INT iTabLength;
INT iLeftMargin;
INT iRightMargin;
UINT uiLengthDrawn;
} DRAWTEXTPARAMS,*LPDRAWTEXTPARAMS;
[MSVC]
typedef struct tagNMHDR
{
HWND hwndFrom;
UINT idFrom;
UINT code; // NM_ code
} NMHDR;
typedef NMHDR FAR * LPNMHDR;
I think Wine's and MSVC's headers are much better readable.
Well, to use one line for each parameter like in the following MSVC example is also not so good:
WINUSERAPI
BOOL
WINAPI
SetWindowPos(
HWND hWnd,
HWND hWndInsertAfter ,
int X,
int Y,
int cx,
int cy,
UINT uFlags);
But I would prefer to see the parameter names in function declarations - not only the parameter types.
Just my fews thoughs...
--
Martin Fuchs
martin-fuchs at gmx.net
More information about the Ros-kernel
mailing list