Reduced header file inclusions
Jens Seidel
jensseidel at users.sf.net
Sun Apr 8 17:29:46 MDT 2007
Hi Robby,
I noticed that you normally try to minimize header inclusions. I checked
all header files in src/ for not needed #include statements and was able
to remove a few.
Now you can drink an additional cup of coffee in the time which this
patch saves you during compilation :-)
Once the compiler complained about an undefined "uint" which is probably
defined in a KDE or Qt header file. Please avoid using it for
compatibility reasons.
The alias uint for unsigned int is defined in sys/types.h on POSIX
systems only. It is also available in pre C99 systems. ISO C99 provides
int8_t, ... in stdint.h but no uint.
I think it is also a good idea to declare classes *after* header file
inclusion only. The reason is simple: If you include a header file file.h
which depends on a class X you will not get an error if you forgot to
declare X inside file.h (at least if X is defined before inclusion of
file.h).
OK:
#include "file.h"
class X;
Not suggested:
class X;
#include "file.h"
(It could also be possible, that file.h gets parsed differently
dependant on whether X is declared or not. At least this is possible
with #define statements!).
Jens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: includes.diff.bz2
Type: application/octet-stream
Size: 2546 bytes
Desc: not available
Url : http://forge.novell.com/pipermail/tellico-users/attachments/20070409/0d224d89/includes.diff.obj
More information about the tellico-users
mailing list