码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-04-19 17:04:08      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:

-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);

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

标签:

原文地址:http://www.cnblogs.com/tibetanmastiff/p/5408597.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!