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);
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);
相关文章推荐
- winhex使用经验
- mysql常用几个操作记录
- 自定义横向Progressbar
- 6--队列
- 男人>女人
- 又拍云异步上传实例教程详解
- linux 中文乱码
- Java基础之class文件介绍(基础)
- 安卓小经验积累
- Android驱动入门系列(一)
- JVM学习笔记(一)
- 混淆类别(主题)判别技术(更新完善)
- 一个练习打字的网站
- memset memcpy函数
- AppCompatActivity
- SE Springer小组《Spring音乐播放器》软件需求说明3
- java实现一个简单TCPSocket聊天室功能分享
- acm 2 1017 非常可乐
- zzulioj--1874--蛤玮学计网(模拟)
- rescue the princess 省赛四1