C语言程序出现下面的错误“syntax error”,原因不明,请指教?
源程序如下:#include <iostream.h>
/*****************************************************************************************************
宏定义
*****************************************************************************************************/
#define SDDETECT_MASK_SHIFT_BIT_BODY (0x01<<9)
#define SCANEKY_MASK_GPIO_BODY (0x7F)
#define HPHONE_MASK_SHIFT_BIT_BODY (0x01<<7)
#define HOLDKEY_MASK_SHIFT_BIT_BODY (0x01<<8)
#define SCANEKY_MASK_GPIO2_BODY (0x01)
#define NUMBER_PICTURE_DEVISE_GPIO (2)
#define LONGKEY_MINOR_ADJUST_TICKS (10)
#define EOK (0)
#define DEFAULT_HOLDKEY_VALID_GPIO (16)
/*****************************************************************************************************
结构体定义
*****************************************************************************************************/
typedef int (*KeyPostProc)(unsigned int aScanCode, unsigned int stamp);
typedef struct Button_s
{
unsigned int uiNumHigh;/* store number of bit is 1 of gpio button */
unsigned int uiCurrPressed; /* remember pressed bits of gpio */
unsigned int pauiHoldTicks[DEFAULT_HOLDKEY_VALID_GPIO];/* store hold down ticks for each button, +1, is for unused redundant only */
}Button_t;
typedef struct SensorOps_s
{
int (*pfInitDev)(unsigned int);
int (*pfPwr)(int iSwitch);
int (*pfReset)(int iSwitch);
unsigned int uiSetValue;
}SensorOps_st;
typedef struct ProductModel_s
{
int (*initRoot)(void);
int (*initSdDetect)(void);
int (*isSdCardPresent)(void);
int (*setSpeaker)(int);
void (*getPictdev)(SensorOps_st **pstData);
void (*getButton)(int group, Button_t **pstData);
void (*gpio0Irq)(unsigned int pendIrq, KeyPostProc pfPostMsg);
void (*gpio1Irq)(unsigned int pendIrq, KeyPostProc pfPostMsg);
void (*longkeyNotify)(Button_t *pstBt0, Button_t *pstBt1);
int (*initHpDetect)(void);
char *pcName;
}ProductModel_st;
/*****************************************************************************************************
变量定义
*****************************************************************************************************/
static int g_iIgnoreHpIrq=1;
static volatile unsigned int g_uiGpioLongkeyTicks;
static unsigned int g_uiSdDetInited=0;
static unsigned int g_uiIsCustomed=0;
static unsigned int g_uiButtonInited_Jxd=0;
Button_t g_stGpioButtons ;
Button_t g_stGpioButtons2;
static SensorOps_st g_pastPictDev638[NUMBER_PICTURE_DEVISE_GPIO];
static ProductModel_st g_stJxd638;
/*****************************************************************************************************
函数声明
*****************************************************************************************************/
static void gpio0Irq_dsr_Jxd638(unsigned int pendIrq, KeyPostProc pfPostMsg);
static void gpio1Irq_dsr_Jxd638(unsigned int pendIrq, KeyPostProc pfPostMsg);
static void sdDetect_dsr_Jxd638(void);
static void holdkey_dsr_Jxd638(void);
static void HpDetect_dsr_Jxd638(void);
static void longkeyNotify_Jxd638(Button_t *pstBt0, Button_t *pstBt1);
static void keyscanGp0_dsr_Jxd638( KeyPostProc pfPostMsg);
static void keyscanGp1_dsr_Jxd638( KeyPostProc pfPostMsg);
static void initHeadPhone_GPIO_Jxd638(void);
static void getButton_Jxd638(int group, Button_t **pstData);
static void getPictdev_Jxd638(SensorOps_st **pstData);
static int isSDPlugIn_Jxd638(void );
static int initPictureDevOps_638(SensorOps_st *pstPictDev);
static int initBDISP_638(void);
static int initGpioButton_638(void);
static int initSDDetect_Jxd638(void);
static void initHeadPhone_GPIO_Jxd638(void);
static int initHoldKey_GPIO_Jxd638(void);
static int initCustom_GPIO_Jxd638(void);
int setSpkmute_SAR_JxdComm(int val);
int init_Jxd638(void);
/*****************************************************************************************************
函数定义
*****************************************************************************************************/
static void gpio0Irq_dsr_Jxd638(unsigned int pendIrq, KeyPostProc pfPostMsg)
{
if (pendIrq & SDDETECT_MASK_SHIFT_BIT_BODY)
{
sdDetect_dsr_Jxd638();
}
if (pendIrq & SCANEKY_MASK_GPIO_BODY)
{
keyscanGp0_dsr_Jxd638(pfPostMsg);
}
if (pendIrq & HPHONE_MASK_SHIFT_BIT_BODY)
{
HpDetect_dsr_Jxd638();
}
if (pendIrq & HOLDKEY_MASK_SHIFT_BIT_BODY)
{
holdkey_dsr_Jxd638();
}
}
//============================================================================================
static void gpio1Irq_dsr_Jxd638(unsigned int pendIrq, KeyPostProc pfPostMsg)
{
if (pendIrq & SCANEKY_MASK_GPIO2_BODY)
{
keyscanGp1_dsr_Jxd638(pfPostMsg);
}
}
//============================================================================================
static void sdDetect_dsr_Jxd638(void){;}
static void holdkey_dsr_Jxd638(void){;}
static void HpDetect_dsr_Jxd638(void){;}
static void longkeyNotify_Jxd638(Button_t *pstBt0, Button_t *pstBt1){;}
static void keyscanGp0_dsr_Jxd638( KeyPostProc pfPostMsg){;}
static void keyscanGp1_dsr_Jxd638( KeyPostProc pfPostMsg){;}
static void initHeadPhone_GPIO_Jxd638(void){;}
static void getButton_Jxd638(int group, Button_t **pstData){;}
static void getPictdev_Jxd638(SensorOps_st **pstData){;}
static int isSDPlugIn_Jxd638(void ){return 0;}
static int initPictureDevOps_638(SensorOps_st *pstPictDev){return 0;}
static int initBDISP_638(void){return 0;}
static int initGpioButton_638(void){return 0;}
static int initSDDetect_Jxd638(void){return 0;}
static int initHoldKey_GPIO_Jxd638(void){return 0;}
int setSpkmute_SAR_JxdComm(int val){return 0;}
static int initCustom_GPIO_Jxd638(void){return 0;}
//=============================================================================================
int init_Jxd638(void)
{
if(g_uiIsCustomed)
{
cout<<"init_Jxd638() already init \n";
return 0;
}
initGpioButton_638();
initBDISP_638();
initSDDetect_Jxd638();
initHeadPhone_GPIO_Jxd638();
initHoldKey_GPIO_Jxd638();
initPictureDevOps_638(g_pastPictDev638);
g_uiGpioLongkeyTicks =LONGKEY_MINOR_ADJUST_TICKS;
cout<<"initCustom_Jxd638() OK \n";
g_uiIsCustomed++;
return EOK;
}
/*****************************************************************************************************
主函数定义
*****************************************************************************************************/
int main(void)
{
int ret;
g_stJxd638={
.initRoot = initCustom_GPIO_Jxd638,
.initSdDetect = initSDDetect_Jxd638,
.getPictdev = getPictdev_Jxd638,
.getButton = getButton_Jxd638,
.setSpeaker= setSpkmute_SAR_JxdComm,
.isSdCardPresent= isSDPlugIn_Jxd638,
.longkeyNotify= longkeyNotify_Jxd638,
.gpio0Irq = gpio0Irq_dsr_Jxd638,
.gpio1Irq = gpio1Irq_dsr_Jxd638,
.initHpDetect= initHeadPhone_GPIO_Jxd638,
.pcName="Jxd 638"
};
ret=init_Jxd638();
return ret;
}
编译后出现如下错误:
--------------------Configuration: Cpp1 - Win32 Debug--------------------
Compiling...
Cpp1.cpp
F:\VC6\Cpp1.cpp(200) : error C2059: syntax error : '{'
F:\VC6\Cpp1.cpp(200) : error C2143: syntax error : missing ';' before '{'
F:\VC6\Cpp1.cpp(201) : error C2143: syntax error : missing ';' before '.'
执行 cl.exe 时出错.
Cpp1.obj - 1 error(s), 0 warning(s)
菜鸟请教明白人指点下,错在什么地方?