您的位置:首页 > 其它

passing argument 3 of ‘wtk_hlv_rec_init’ discards ‘const’ qualifier from pointer target type

2016-04-19 16:06 525 查看
-Werror,编译出现如下错误:

src/wtk/exam/wtk_ndx.c:154:6: error: passing argument 3 of ‘wtk_hlv_rec_init’ discards ‘const’ qualifier from pointer target type [-Werror]
ret = wtk_hlv_rec_init(&(nd->rec_hd), &(cfg->rec_hd), nd->hmmset, 0.02f);
^
In file included from src/wtk/exam/wtk_ndx.h:13:0,
from src/wtk/exam/wtk_ndx.c:13:

函数申明: int wtk_hlv_rec_init(wtk_hlv_rec_t* r, const wtk_hlv_rec_cfg_t* cfg, wtk_hmmset_t *hs, double frame_dur);

nd->hmmset为常量

解决办法:1)修改函数申明 int wtk_hlv_rec_init(wtk_hlv_rec_t* r, const wtk_hlv_rec_cfg_t* cfg, const wtk_hmmset_t *hs, double frame_dur);

2)使用时强制转换 wtk_hlv_rec_init(&(nd->rec_hd), &(cfg->rec_hd), (wtk_hmm_t *)nd->hmmset, 0.02f);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: