On Sun, 26 May 2013, Carlos R. Mafra escribió:

> On Sun, 26 May 2013 at 17:29:20 +0200, Rodolfo García Peñas wrote:
> > Hi,
> > 
> > comments?
> 
> I think you are violating rule #7 from 
> 
> www.umich.edu/~eecs381/handouts/CHeaderFileGuidelines.pdf
> 
> "Every header file A.h should #include every other header file
> that A.h requires to compile correctly, but no more"

Here are the includes in .h files before and after my patches:

kix@osaka:~/src/wmaker/wmaker-crm/src$ diff 1 2
8d7
< dock.h:#include "funcs.h"
12,16d10
< funcs.h:#include <sys/types.h>
< funcs.h:#include <stdio.h>
< funcs.h:#include "window.h"
< funcs.h:#include "defaults.h"
< funcs.h:#include "keybind.h"
20d13
< icon.h:#include "funcs.h"
21a15,16
> misc.h:#include "defaults.h"
> misc.h:#include "keybind.h"
kix@osaka:~/src/wmaker/wmaker-crm/src$ 

The file misc.h needs defaults.h and keybind.h, so before my patches, funcs.h 
included them too.

I removed 4 includes with my patches, so my patches are more "rule 7" compilant.

Finally, we can remove the includes for default.h and keybind.h, but misc.h is 
used here:

kix@osaka:~/src/wmaker/wmaker-crm/src$ grep misc *c | grep include
actions.c:#include "misc.h"
appicon.c:#include "misc.h"
client.c:#include "misc.h"
defaults.c:#include "misc.h"
dialog.c:#include "misc.h"
dock.c:#include "misc.h"
dockedapp.c:#include "misc.h"
event.c:#include "misc.h"
framewin.c:#include "misc.h"
icon.c:#include "misc.h"
misc.c:#include "misc.h"
rootmenu.c:#include "misc.h"
session.c:#include "misc.h"
switchmenu.c:#include "misc.h"
switchpanel.c:#include "misc.h"
texture.c:#include "misc.h"
wdefaults.c:#include "misc.h"
window.c:#include "misc.h"
winmenu.c:#include "misc.h"
winspector.c:#include "misc.h"
workspace.c:#include "misc.h"
kix@osaka:~/src/wmaker/wmaker-crm/src$

so, we should include these files in all these .c files before misc.h.

kix
-- 
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/


-- 
To unsubscribe, send mail to [email protected].

Reply via email to