On Fri, 27 Jan 2012 at 19:52:31 +0100, Rodolfo kix Garcia wrote:
> Subject: [PATCH 3/3] WindowMaker: ProcessPendingEvents moved to event.h
> 
> The function ProcessPendingEvents is moved to the new file event.h. Now the 
> func
> tion don't need to be extern.

This can be done, but I don't think it's worth it.

Having event.h with only one function is not nice. I think it would
be better if you write the prototypes of all global functions defined
in event.c in event.h and make the files which use those functions 
include it.

But I realized that those prototypes are now in funcs.h together
with a bunch of unrelated functions from other files. Why is that?

In principle if you want to include something of event.c you don't
necessarily need the prototypes from rootmenu.c at the same time,
but whenever you include funcs.h that's what happens.

So I think a nicer cleanup would be to sort that out and get rid
of funcs.h and move those unrelated prototypes closer to their
definition (ie in a .h file named after the .c file which defines
them).

That's a much bigger task though. 

Another thing which can be done is to check whether some function
really needs to be global and make it static if not.

Because when I was reviewing your patch I noticed for example:

[mafra@Pilar:wmaker.git]$ git grep wDeleteDeathHandler
src/event.c:void wDeleteDeathHandler(WMagicNumber id)
src/event.c:                              wDeleteDeathHandler(tmp);

so that function better be static (which can save a few bytes).

There are many possible cleanups like that, it's just a matter
of reading the code and questioning things at the same time.


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to