On Sun, 22 Jan 2012 at  0:23:25 +0100, Rodolfo kix Garcia wrote:
> On 21/01/12 14:20, Carlos R. Mafra wrote:
> 
> > On Sat, 21 Jan 2012 at 13:59:41 +0100, Rodolfo kix Garcia wrote:
> >> See the http://www.kix.es/src/wmaker/WPrefs.png file to see why I did the
> >> patches.
> > 
> > Nice image.
> >  
> >> The file <WINGs/WINGs.h> is included twice, one in this file and the
> >> other through WPrefs.h. For this reason I removed the direct include.
> > 
> > But the rule I think is: If a file needs the definitions from a 
> > particular .h file, it must include it directly. 
> 
> Ok. But in the other images are different situations.
> 
> Examples:
> 
> 1. rootmenu.h is not included in files
> 2. usermenu.h is not included in files

And is this related to your previous patches? I'm sorry that I might
be misunderstanding something.

It surprises me that those files are not included, because rootmenu.h
should at least be included in rootmenu.c and usermenu.h should
be included in usermenu.c. If they are not, things are fragile and
compilation might break due to unrelated changes.

Maybe other people can comment here, but I'd suggest that a cleanup
of includes should be made by looking which files are including
others needlessly and removing those.

> 3. wconfig.h has included config.h, but config.h don't exists

Ok.

> 4. There are many many includes, I think this is not correct. Probably
> other schema is possible.

I don't necessarily agree with the conclusion that it's not correct.
I think that as many .h files as .c files is at least expected.

> I made these images to find these problems and help in the process to
> remove the externs.

Great! Thanks for looking at this.

What do you think about having one .h for each .c and putting in
the .h files the definitions of stuff from the .c files.

Then in other files were you have externs you remove them from 
the body of the .c file and simply include the .h file where
those things are defined.

I think that's the idea.


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

Reply via email to