生成的字模IAR arm中编译错误,是什么原因
typedef struct{
u8 Index;
char Msk;
} typFNT_GB24;
//字体取模:宋体常规小四
const typFNT_GB24 tfont24[] =
{
"立",0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x30,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,
0x08,0x10,0x3F,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x80,0x02,0x00,0xC0,0x01,0x00,
0x80,0x01,0x01,0x80,0x00,0x81,0x00,0x00,0x81,0x00,0x00,0xC1,0x00,0x00,0xC2,0x00,
0x00,0x42,0x00,0x00,0x42,0x00,0x00,0x04,0x00,0x00,0x04,0x04,0x7F,0xFF,0xFE,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*0*/}
如上文,提示如下:
Error: a value of type "char " cannot be used to initialize an entity of type "u8 " (aka "unsigned char ")
说是宽度不对,上面的u8 Index改为u8 Index就可以
三字节:GB2312 编码 + ‘\0’
四字节:UTF8 编码 + ‘\0’
这编译器应该是按字符串解析了,扩大Index数组用吧。
谢谢回复,全部改为GB2312的编码可以了。
页:
[1]