分享

ADS1.2 中implicit cast of pointer to non

 笔录收藏 2012-05-15

ADS的C编译器真是有点傻啊。。

unsinged char *str="ifqif.qifqq";

这样的声明都不能自己转换一下啊。今天在声明一个字符串数组的时候总是报错。

unsigned char vga640480[] =
 {
  0x61,0x02,0x0b,0x00,0x20,0x37,0x10,0x8c,
  0x01,0x69,0x30,0x20,0x05,0x03,0x1b,0x15,
  0x00,0xcb,0xff,0x40,0x3f,0x7e,0x0d,0x40,
  0x62,0x00,0x68,0x00,0xf0,0x00,0x00,0x00,
  0x0a,0x01,0x00,0x00,0x01,0x32,0x00,0x00,
  0x00,0x00,0x54,0x01,0xae,0xae,0xd7,0x81,
  0x08,0xfa,0xfa,0x1f,0x0f,0xfa,0xfa,0x03,
  0xfc,0x00,0x00,0x0f,0x0f,0x00,0x00,0x3f
 };

unsigned char *(display_mode[2][2]) =
{
  {0, 0},
  {vga640480, "VGA 640X480"},

}

Error   : C3028E: '=': implicit cast of pointer to non-equal pointer
vga.c line 58  

最后改为

unsigned char *(display_mode[2][2]) =
{
  {0, 0},
  {vga640480, (unsigned char *)"VGA 640X480"},

}

编译通过。

真是死板的要命哈。

 

调芯唐w90p950时:
struct tran_pdesc {
 struct nuc900_txbd desclist[TX_DESC_SIZE];
 char tran_buf[TX_DESC_SIZE][MAX_TBUFF_SZ];
};
struct tran_pdesc *tdesc;
struct tran_pdesc *rdesc;
 
 struct nuc900_txbd *txbd;
 unsigned char *buffe;

 *txbd = tdesc->desclist[cur_tx];
 buffer = tdesc->tran_buf[cur_tx];
出现:Error   : C3028E: '=': implicit cast of pointer to non-equal pointer   xxx   line 58 
 
后改为:
 struct nuc900_txbd *txbd;
 unsigned char *buffer;

 *txbd = tdesc->desclist[cur_tx];
 buffer = (unsigned char *)tdesc->tran_buf[cur_tx];
通过.

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多