[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: source code related questions
From: |
roddi |
Subject: |
Re: source code related questions |
Date: |
Tue, 30 Jul 2002 10:32:14 +0200 |
Am Montag den, 29. Juli 2002, um 23:49, schrieb Pawel Kot:
On Mon, 29 Jul 2002 address@hidden wrote:
GSM_Info defined several times (should be extern in gsm_api.h ?)
Fixed.
Hm, sorry, no it's not. GSM_Info is defined extern in cfgreader.c and
not extern in cfgreader.h.
cfgreader.h is included by cfgreader.c, by tcp.c, by unixserial.c and
some more. This means I get multiple definitions again.
I propose putting global variable definitions (without extern) like
GSM_Info into a file called global.c and defining them in their header
file as extern. Every module that needs a global variable includes the
header file (extern definition) and links against global.o (non-extern
definition)
This should make the code better to read, too, because all globals are
defined in one place.
This should also work for the glink problem.
glink defined several times (as far as I can see it's a bad idea to
define this as a global pointer in several places, gives you some quite
tricky linking issues. Better define it once and pass the pointer to
every function that needs it as a function argument)
Fixed. Or rahter workarounded.
pkot
--
mailto:address@hidden :: mailto:address@hidden
http://kt.linuxnews.pl/ :: Kernel Traffic po polsku
_______________________________________________
gnokii-users mailing list
address@hidden
http://mail.freesoftware.fsf.org/mailman/listinfo/gnokii-users