Real data type sizes

Started by romaxin February 7, 2005


Hi all,

I am extremly confused about data types in CCS. Help tells me the
following:

Type Size Representation
char, unsigned char 16 bits ASCII
short, signed short 16 bits 2s complement
unsigned short 16 bits Binary
int, signed int 16 bits 2s complement
unsigned int 16 bits Binary
long, signed long 32 bits 2s complement
unsigned long 32 bits Binary
long long 40 bits 2s complement

But when checking the actual data size with 'sizeof' function I get
the following:

sizeof(char) = 1
sizeof(long) = 2
sizeof(long long) = 4
sizeof(int) = 1

It does not match at all. Does someone know the actual data type
sizes?

Thanks.




looks like it is returning bytes?

At Monday, 07 February 2005, "romaxin" <> wrote:

>Hi all,
>
>I am extremly confused about data types in CCS. Help tells me the
>following:
>
>Type Size Representation
>char, unsigned char 16 bits ASCII
>short, signed short 16 bits 2s complement
>unsigned short 16 bits Binary
>int, signed int 16 bits 2s complement
>unsigned int 16 bits Binary
>long, signed long 32 bits 2s complement
>unsigned long 32 bits Binary
>long long 40 bits 2s complement
>
>But when checking the actual data size with 'sizeof' function I get
>the following:
>
>sizeof(char) = 1
>sizeof(long) = 2
>sizeof(long long) = 4
>sizeof(int) = 1
>
>It does not match at all. Does someone know the actual data type
>sizes?
>
>T


----------------------------------
Zero Crossings, Inc. -- Embedded and Digital Signal Processing Systems

http://www.zerocrossings.com/



Gee, harland its definetly not matching! Int bits and sizeof(int)= 1?
Romaxin, somethhing is wrong somwhere. Can you tell us which DSP are
you targeting? 54x? 55x?

--Bhooshan

On Tue, 08 Feb 2005 07:29:44 -0500, Harland Christofferson
<> wrote:
>
>
> looks like it is returning bytes?
>
> At Monday, 07 February 2005, "romaxin" <> wrote:
>
> >Hi all,
> >
> >I am extremly confused about data types in CCS. Help tells me the
> >following:
> >
> >Type Size Representation
> >char, unsigned char 16 bits ASCII
> >short, signed short 16 bits 2s complement
> >unsigned short 16 bits Binary
> >int, signed int 16 bits 2s complement
> >unsigned int 16 bits Binary
> >long, signed long 32 bits 2s complement
> >unsigned long 32 bits Binary
> >long long 40 bits 2s complement
> >
> >But when checking the actual data size with 'sizeof' function I get
> >the following:
> >
> >sizeof(char) = 1
> >sizeof(long) = 2
> >sizeof(long long) = 4
> >sizeof(int) = 1
> >
> >It does not match at all. Does someone know the actual data type
> >sizes?
> >
> >T


--
-------------------------------
"I've missed more than 9000 shots in my career.
I've lost almost 300 games. 26 times I've been trusted to take the
game winning shot and missed.
I've failed over and over again in my life.
And that is why I succeed."
-- Michael Jordan
--------------------------------




Gee, harland its definetly not matching! Int bits and sizeof(int)= 1?
Romaxin, somethhing is wrong somwhere. Can you tell us which DSP are
you targeting? 54x? 55x?

--Bhooshan

On Tue, 08 Feb 2005 07:29:44 -0500, Harland Christofferson
<> wrote:
>
>
> looks like it is returning bytes?
>
> At Monday, 07 February 2005, "romaxin" <> wrote:
>
> >Hi all,
> >
> >I am extremly confused about data types in CCS. Help tells me the
> >following:
> >
> >Type Size Representation
> >char, unsigned char 16 bits ASCII
> >short, signed short 16 bits 2s complement
> >unsigned short 16 bits Binary
> >int, signed int 16 bits 2s complement
> >unsigned int 16 bits Binary
> >long, signed long 32 bits 2s complement
> >unsigned long 32 bits Binary
> >long long 40 bits 2s complement
> >
> >But when checking the actual data size with 'sizeof' function I get
> >the following:
> >
> >sizeof(char) = 1
> >sizeof(long) = 2
> >sizeof(long long) = 4
> >sizeof(int) = 1
> >
> >It does not match at all. Does someone know the actual data type
> >sizes?
> >
> >T


--
-------------------------------
"I've missed more than 9000 shots in my career.
I've lost almost 300 games. 26 times I've been trusted to take the
game winning shot and missed.
I've failed over and over again in my life.
And that is why I succeed."
-- Michael Jordan
--------------------------------




looks like it is returning bytes?

At Monday, 07 February 2005, "romaxin" <> wrote:

>Hi all,
>
>I am extremly confused about data types in CCS. Help tells me the
>following:
>
>Type Size Representation
>char, unsigned char 16 bits ASCII
>short, signed short 16 bits 2s complement
>unsigned short 16 bits Binary
>int, signed int 16 bits 2s complement
>unsigned int 16 bits Binary
>long, signed long 32 bits 2s complement
>unsigned long 32 bits Binary
>long long 40 bits 2s complement
>
>But when checking the actual data size with 'sizeof' function I get
>the following:
>
>sizeof(char) = 1
>sizeof(long) = 2
>sizeof(long long) = 4
>sizeof(int) = 1
>
>It does not match at all. Does someone know the actual data type
>sizes?
>
>T


----------------------------------
Zero Crossings, Inc. -- Embedded and Digital Signal Processing Systems

http://www.zerocrossings.com/




Hi all,

I am extremly confused about data types in CCS. Help tells me the
following:

Type Size Representation
char, unsigned char 16 bits ASCII
short, signed short 16 bits 2s complement
unsigned short 16 bits Binary
int, signed int 16 bits 2s complement
unsigned int 16 bits Binary
long, signed long 32 bits 2s complement
unsigned long 32 bits Binary
long long 40 bits 2s complement

But when checking the actual data size with 'sizeof' function I get
the following:

sizeof(char) = 1
sizeof(long) = 2
sizeof(long long) = 4
sizeof(int) = 1

It does not match at all. Does someone know the actual data type
sizes?

Thanks.