This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: A simple data type question
- To: "'HuangQiang'" <jameshq at liverpool dot ac dot uk>,"'eCos'" <ecos-discuss at sources dot redhat dot com>
- Subject: RE: [ECOS] A simple data type question
- From: "Trenton D. Adams" <tadams at extremeeng dot com>
- Date: Tue, 12 Jun 2001 08:16:40 -0600
- Organization: Extreme Engineering
It all depends on the word size of your platform. If you have a 32 bit
word, then unsigned should be a 32-bit unsigned integer. If however
your word is 16-bits, then unsigned would be 16-bit. I suppose it could
depend on the compiler too, but I think it's a standard to go by the
word size of the CPU in use.
Since a #define is just a macro, and replaces any place it occurs with
the defined statement, you would have to use a type cast like the
example you gave. So, if your CPU uses a 16-bit word, then you would
need to go
#define IOPDATA ((unsigned long *)0x0)
Someone tell me if I'm wrong! :)
-----Original Message-----
From: ecos-discuss-owner@sources.redhat.com
[mailto:ecos-discuss-owner@sources.redhat.com] On Behalf Of HuangQiang
Sent: Tuesday, June 12, 2001 2:57 AM
To: eCos
Subject: [ECOS] A simple data type question
Hi all:
Could anyone give me some detail about the following statement:
#define IOPDATA ((volatile unsigned *)(SYSCFG + 0x5008))
if I change the *IOPDATA = 0x0; then how many bit can I change . what
data width is the (volatile unsigned *)? if I want to use a 32-bit width
pointer how can I do it?
Thanks all.