Sign in

username or email:

password:



Not a member?
Forgot your password?

Search code-comp



Search tips

Subscribe to code-comp



Ads

Discussion Groups

See Also

Embedded SystemsFPGA

Discussion Groups | Code-Composer | Real data type sizes

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...

  

Post a new Thread



Is this thread worth a thumbs up?

0

Real data type sizes - romaxin - Feb 7 5:48:00 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.



______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of code-comp -- send a blank email to code-comp-subscribe@yahoogroups.com )

Re: Real data type sizes - Harland Christofferson - Feb 8 8:29:00 2005


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/


______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of code-comp -- send a blank email to code-comp-subscribe@yahoogroups.com )

re: Real data type sizes - Bhooshan Iyer - Feb 9 0:53:00 2005


Gee, harland its definetly not matching! Int=16 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
--------------------------------------------------------------------



______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of code-comp -- send a blank email to code-comp-subscribe@yahoogroups.com )