2013-06-27 64 views
0

這是示例代碼:參數太少當爭吵到計數功能,即使是正確的

typedef struct 
{ 
    char symname[DLL_MAX_SYMNAME_LEN]; // Symbol name char 
    filename[DLL_MAX_FILENAME_LEN]; // File name from which the 
            // symbol comes 
    unsigned int vaddr; // Exact address of nearest symbol 
} dll_sym_info_t; 

extern void sbblink_write_one_frame(u8 In,u8 F,u8 Ph,u8 Sub,u8 Ch,u8 S,u8 T, u8 P); 

const char * str_sbblink_write_OP_frame_channels = "sbblink_write_one_frame"; 
void (*fun_sbblink_write_OP_frame_channels) (u8 In,u8 Fpga,u8 InSlot,u8 SubCh,u8 Chan,u8 Size,u8 Type,u8 Print); 
. 
. 
fun_sbblink_write_OP_frame_channels = (void (*) (u8,u8,u8,u8,u8,u8,u8,u8))sym.vaddr; 
. 
. 
fun_sbblink_write_OP_frame_channels (0,SBBL_FLINK,PhSlotRRH,i,0,0,0,0); 

但即使是錯誤:

error: too few arguments to function 'fun_sbblink_write_OP_frame_channels' 

請幫助我。

THanks,

+1

你能否給我們提供'sym',看起來像'struct'! – 2013-06-27 13:33:04

+1

也提供'vaddr'指向的函數聲明。 – VoidPointer

+0

typedef struct { char symname [DLL_MAX_SYMNAME_LEN]; //符號名稱 char filename [DLL_MAX_FILENAME_LEN]; // //符號來自的文件名 unsigned int vaddr; //最近的符號的確切地址 } dll_sym_info_t; – user2185454

回答

0

試着保持簡單。如果 「複雜」 的問題失敗,嘗試一個更簡單的方法,即

/* Since this doesn't work, let's try something that really should work 
    fun_sbblink_write_OP_frame_channels (0,SBBL_FLINK,PhSlotRRH,i,0,0,0,0); */ 

sbblink_write_one_frame(1,2,3,4,5,6,7,8); 

然後,如果這樣可以試試:

/* Since this doesn't work, let's try something that really should work 
    fun_sbblink_write_OP_frame_channels (0,SBBL_FLINK,PhSlotRRH,i,0,0,0,0); */ 

/* OK, this worked, let's go one step forward 
sbblink_write_one_frame(1,2,3,4,5,6,7,8); */ 
fun_sbblink_write_OP_frame_channels (1,2,3,4,5,6,7,8); 

然後嘗試:

/* OK, this silly stuff worked, let's go all the way 
sbblink_write_one_frame(1,2,3,4,5,6,7,8); 
fun_sbblink_write_OP_frame_channels (1,2,3,4,5,6,7,8); */ 
fun_sbblink_write_OP_frame_channels (0,SBBL_FLINK,PhSlotRRH,i,0,0,0,0); 

的錯誤/成功你在每一次嘗試中都應該幫助你找到問題所在。