aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test1.c12
-rw-r--r--src/test_intarray.c3
-rw-r--r--src/test_malloc.c6
3 files changed, 14 insertions, 7 deletions
diff --git a/src/test1.c b/src/test1.c
index 4212c7323..c204335dc 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -5681,9 +5681,11 @@ static int SQLITE_TCLAPI test_stmt_utf8(
sqlite3_stmt *pStmt;
int col;
const char *(*xFunc)(sqlite3_stmt*, int);
+ const unsigned char *(*xFuncU)(sqlite3_stmt*, int);
const char *zRet;
xFunc = (const char *(*)(sqlite3_stmt*, int))clientData;
+ xFuncU = (const unsigned char*(*)(sqlite3_stmt*,int))xFunc;
if( objc!=3 ){
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tcl_GetString(objv[0]), " STMT column", 0);
@@ -5692,7 +5694,11 @@ static int SQLITE_TCLAPI test_stmt_utf8(
if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR;
- zRet = xFunc(pStmt, col);
+ if( xFunc==sqlite3_column_name || xFunc==sqlite3_column_decltype ){
+ zRet = xFunc(pStmt, col);
+ }else{
+ zRet = (const char*)xFuncU(pStmt, col);
+ }
if( zRet ){
Tcl_SetResult(interp, (char *)zRet, 0);
}
@@ -7562,7 +7568,7 @@ static struct LogCallback {
Tcl_Interp *pInterp;
Tcl_Obj *pObj;
} logcallback = {0, 0};
-static void xLogcallback(void *unused, int err, char *zMsg){
+static void xLogcallback(void *unused, int err, const char *zMsg){
Tcl_Obj *pNew = Tcl_DuplicateObj(logcallback.pObj);
Tcl_IncrRefCount(pNew);
Tcl_ListObjAppendElement(
@@ -8601,7 +8607,6 @@ static int SQLITE_TCLAPI test_decode_hexdb(
const char *zIn = 0;
unsigned char *a = 0;
int n = 0;
- int lineno = 0;
int i, iNext;
int iOffset = 0;
int j, k;
@@ -8613,7 +8618,6 @@ static int SQLITE_TCLAPI test_decode_hexdb(
}
zIn = Tcl_GetString(objv[1]);
for(i=0; zIn[i]; i=iNext){
- lineno++;
for(iNext=i; zIn[iNext] && zIn[iNext]!='\n'; iNext++){}
if( zIn[iNext]=='\n' ) iNext++;
while( zIn[i]==' ' || zIn[i]=='\t' ){ i++; }
diff --git a/src/test_intarray.c b/src/test_intarray.c
index 16c1df2e9..9e4629467 100644
--- a/src/test_intarray.c
+++ b/src/test_intarray.c
@@ -61,7 +61,8 @@ struct intarray_cursor {
/*
** Free an sqlite3_intarray object.
*/
-static void intarrayFree(sqlite3_intarray *p){
+static void intarrayFree(void *pX){
+ sqlite3_intarray *p = (sqlite3_intarray*)pX;
if( p->xFree ){
p->xFree(p->a);
}
diff --git a/src/test_malloc.c b/src/test_malloc.c
index 21faa0d29..8d6c4fa50 100644
--- a/src/test_malloc.c
+++ b/src/test_malloc.c
@@ -41,8 +41,9 @@ static struct MemFault {
** fire on any simulated malloc() failure.
*/
static void sqlite3Fault(void){
- static int cnt = 0;
+ static u64 cnt = 0;
cnt++;
+ if( cnt>((u64)1<<63) ) abort();
}
/*
@@ -52,8 +53,9 @@ static void sqlite3Fault(void){
** This routine only runs on the first such failure.
*/
static void sqlite3FirstFault(void){
- static int cnt2 = 0;
+ static u64 cnt2 = 0;
cnt2++;
+ if( cnt2>((u64)1<<63) ) abort();
}
/*