SQLite 3.7.13的加密解密(五)—— 修正编译错误和警告
来源:互联网 发布:黄瓜网络电视柠檬tv 编辑:程序博客网 时间:2024/06/04 19:10
上面的代码是从网上下载下来的,它使用的SQLite版本比较旧,因此在SQLite 3.7.13下编译不通过,下面需要对编译错误和警告逐一修正。
编译信息
原因与修改方法
'Pager' has no member named 'pCodecArg'
在3.7.13版本中,Pager的成员变量pCodecArg名称修改为pCodec,因此用到pCodecArg变量的地方修改为使用pCodec。
too few arguments to function 'sqlite3PagerPagecount'
原来sqlite3PagerPagecount()函数用返回值得到页数量,3.7.13改为用指针参数得到页数量。
修改前代码:
Pgno nPage = sqlite3PagerPagecount(p);
修改如下:
int nPage;
sqlite3PagerPagecount(p, &nPage);
too few arguments to function 'sqlite3BtreeRollback'
3.7.13版中sqlite3BtreeRollback()函数增加了个参数,是表示之前SQL语句执行结果的,在网上查了一下,这里直接传常量SQLITE_OK。
implicit declaration of function 'sqliteFree'
sqliteFree()函数在3.7.13版本中已经没有了,修改为使用sqlite3_free()函数。
implicit declaration of function 'sqliteMalloc'
原因同上,修改为使用sqlite3_malloc()函数。
implicit declaration of function 'DATA_TO_PGHDR'
在3.7.13版本中,宏DATA_TO_PGHDR已经被去掉,这里暂时把该if语句下的代码全部注释。
warning: passing argument 2 of 'sqlite3pager_set_codec' from incompatible pointer type
sqlite3pager_set_coedc()函数的第二个参数类型为:void *(*xCodec)(void*, void*,Pgno, int)
而调用的地方传递的参数类型为:void *sqlite3Codec(void *pArg, unsigned char*data, Pgno nPageNum, int nMode)
很明显,第二个参数类型不匹配,修改sqlite3Codec()函数的第二个参数类型为void *,注意相应的函数声明的地方也要修改。
warning: passing argument 3 of 'sqlite3PagerAcquire' from incompatible pointer type
这里第三个参数类型为void *,实际要求的数据类型为DbPage *,将对应变量类型定义为DbPage *即可。
warning: variable 'bRc' set but not used
这个警告不影响使用,不用改。
warning: 'sqlite3PagerSetCodec' defined but not used
同上
本文出自 “rainman” 博客,请务必保留此出处http://lancelot.blog.51cto.com/393579/940814
- SQLite 3.7.13的加密解密(五)—— 修正编译错误和警告
- SQLite 3.7.13的加密解密(五)—— 修正编译错误和警告
- SQLite 3.7.13的加密解密(三)—— 创建加密解密函数
- SQLite 3.7.13的加密解密(四)—— 挂接加密解密函数
- SQLite 3.7.13的加密解密(三)—— 创建加密解密函数
- SQLite 3.7.13的加密解密(四)—— 挂接加密解密函数
- SQLite 3.7.13的加密解密(一)—— 前言
- SQLite 3.7.13的加密解密(二)—— 开放宏定义
- SQLite 3.7.13的加密解密(六)—— 使用方法
- SQLite 3.7.13的加密解密(七)—— 遗留问题
- SQLite 3.7.13的加密解密(一)—— 前言
- SQLite 3.7.13的加密解密(二)—— 开放宏定义
- SQLite 3.7.13的加密解密(六)—— 使用方法
- SQLite 3.7.13的加密解密(七)—— 遗留问题
- SQLite 3.7.13的加密解密
- make &make install 时出现错误和警告的修正
- java加密与解密的艺术(五)——数字签名
- SQLite 的加密解密(开放宏定义)
- SQLite 3.7.13的加密解密(四)—— 挂接加密解密函数
- Oracle的学习网址:
- 根据 User Agent String 判断客户端平台及浏览器的 Java 程序
- strut1和struts2的区别
- 从谷歌搜获更多 —— 一些提示和技巧
- SQLite 3.7.13的加密解密(五)—— 修正编译错误和警告
- IT人不要一直做技术
- 解决Sqlplus在Linux下光标乱码的方法
- N!的尾部连续0的个数
- 搭建你的Spring.Net+Nhibernate+Asp.Net Mvc 框架 (二)创建你的项目
- 使用微软学术搜索Microsoft Academic Search快速了解领域动态
- 很多人看都哭了,不信你不哭
- txt、excel等导入数据的网址,未总结:
- 在Servlet中处理request和response赋予characterEncoding时的顺序