请教一个数据类型不兼容的问题,源程序相关的如下: struct FAT32_FAT_Item { unsigned char Item[4]; };
struct FAT32_FAT { struct FAT32_FAT_Item Items[128]; };
unsigned long lb2bb(unsigned char *dat,unsigned char len) { unsigned long temp=0; unsigned long fact=1; unsigned char i=0; for(i=0;i<len;i++) { temp+=dat*fact; fact*=256; } return temp; }
unsigned long temp; struct FAT32_FAT *pFAT; struct FAT32_FAT_Item *pFAT_Item; temp=((LastCluster/128)+Init_Arg.FirstFATSector); FAT32_ReadSector(temp,FAT32data_buff); pFAT=(struct FAT32_FAT *)FAT32data_buff; pFAT_Item=&((pFAT->Items)[LastCluster%128]); //在算出的扇区中提取簇项 lb2bb(pFAT_Item,4); //返回下一簇号 ***************************这里出现问题
编译后出现的错误为:error: "fat32.c", line 225: error: argument of type "struct FAT32_FAT_Item *" is incompatible with parameter of type "unsigned char * "
不知道该如何解决这个冲突,敬请大虾指教,谢谢。
|