ayttm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ayttm-devel] Function prototypes in .c files


From: Philip S Tellis
Subject: Re: [Ayttm-devel] Function prototypes in .c files
Date: Tue, 21 Jan 2003 10:39:32 +0530 (IST)

On Tue, 21 Jan 2003, Andy wrote:

> I don't think this is a very good idea.  The prototype is in the
> header for a reason and we should be including the header file.  
> There should be one declaration and one definition of a function.  
> Not doing this means that there are N declarations floating around
> which can be a headache to maintain.

Yeah, I agree in the general case, but the problem here is that just 
including those two headers in sound.c doubles the size of sound.o.  
(This doesn't affect the size of the ayttm binary by too much)

The reason I've been trying to remove gtk dependencies from wherever 
possible is so that we can finally split the gui out of the core and 
into a module.

Basically, we'd have to replace all gui stuff with abstract 
replacements.  This really has to be done all at one sitting, but that 
would take me a few days at a stretch to complete.

A few things that I'm looking at to start with are:

- All header files should be self sufficient.
If a header contains references to glib stuff, it should include glib 
and not depend on it being included by all C files that include it or by 
other headers that it includes.  The same goes for types defined in 
ayttm.  Forward declarations are fine in this regard if the size of the 
type isn't required.

- Source files should include all headers that it depends on, but 
allowing for headers that include other headers. We might have to 
change this later, but the compiler will help us out there.

- functions static wherever possible
To avoid namespace pollution.

- types defined only in files that require them
If a type is required by more than one source file, then the type should 
go into a header file, else, it should be in the source file.

- Try and strip gtk out of as many headers as possible.
The reason for this is that many modules that don't require gtk at all 
(eg: autotrans, notes, etc.) include these headers and become huge.  
This takes up extra RAM at run time and does slow down loading of 
modules.

I think Andy's working towards some of the same things.  It seems that 
some of our changes do conflict, so maybe we should discus this through 
before doing any more.

Another thing we need to discus is the naming of types.  Some types are 
typedef'd, some are not, some names are too long and some don't mean 
what they should.

Comments?

Philip

-- 
Life does not begin at the moment of conception or the moment of birth.
It begins when the kids leave home and the dog dies.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]