This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
新手学习C28系列DSP,对数据类型有些疑问,因为头文件的定义的数据类型和C语言不一致,比如int在C中是4 bytes=32 bits。
头文件:
typedef int int16;
typedef long int32;
typedef long long int64;
typedef unsigned int Uint16;
typedef unsigned long Uint32;
typedef unsigned long long Uint64;
typedef float float32;
typedef long double float64;
查了一TMS320C28x的编译器后发现数据类型和C有很大的不同。不知道大家移植C程序时有什么诀窍没有?
以下是TMS320C28x的编译器的资料。大意就是C28x一个byte的定义是16位不是8位。Int的定义是16位不是32位,具体见表。
By ANSI/ISO C definition, the sizeof operator yields the number of bytes required to store an object. ANSI/ISO further stipulates that when sizeof is applied to char, the result is 1. Since
the TMS320C28x char is 16 bits (to make it separately addressable), a byte is also 16 bits. This yields results you may not expect; for example, size of (int) = = 1 (not 2).