aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tclsqlite.c4
-rw-r--r--src/test1.c12
-rw-r--r--src/test2.c2
-rw-r--r--src/test3.c2
-rw-r--r--src/test6.c4
-rw-r--r--src/test8.c4
-rw-r--r--src/test_func.c2
-rw-r--r--src/test_fuzzer.c16
-rw-r--r--src/test_hexio.c4
-rw-r--r--src/test_journal.c6
-rw-r--r--src/test_multiplex.c2
-rw-r--r--src/test_onefile.c6
-rw-r--r--src/test_osinst.c4
-rw-r--r--src/test_quota.c14
-rw-r--r--src/test_vfs.c8
15 files changed, 45 insertions, 45 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index e1ae8eb8e..51f8c517d 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -3470,7 +3470,7 @@ static int md5file_cmd(void*cd, Tcl_Interp*interp, int argc, const char **argv){
MD5Init(&ctx);
for(;;){
int n;
- n = fread(zBuf, 1, sizeof(zBuf), in);
+ n = (int)fread(zBuf, 1, sizeof(zBuf), in);
if( n<=0 ) break;
MD5Update(&ctx, (unsigned char*)zBuf, (unsigned)n);
}
@@ -3516,7 +3516,7 @@ static void md5step(sqlite3_context *context, int argc, sqlite3_value **argv){
for(i=0; i<argc; i++){
const char *zData = (char*)sqlite3_value_text(argv[i]);
if( zData ){
- MD5Update(p, (unsigned char*)zData, strlen(zData));
+ MD5Update(p, (unsigned char*)zData, (int)strlen(zData));
}
}
}
diff --git a/src/test1.c b/src/test1.c
index eed6474b9..6849b5c71 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -800,7 +800,7 @@ struct dstr {
** Append text to a dstr
*/
static void dstrAppend(struct dstr *p, const char *z, int divider){
- int n = strlen(z);
+ int n = (int)strlen(z);
if( p->nUsed + n + 2 > p->nAlloc ){
char *zNew;
p->nAlloc = p->nAlloc*2 + n + 200;
@@ -3609,10 +3609,10 @@ static int test_prepare(
if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
if( zTail && objc>=5 ){
if( bytes>=0 ){
- bytes = bytes - (zTail-zSql);
+ bytes = bytes - (int)(zTail-zSql);
}
if( (int)strlen(zTail)<bytes ){
- bytes = strlen(zTail);
+ bytes = (int)strlen(zTail);
}
Tcl_ObjSetVar2(interp, objv[4], 0, Tcl_NewStringObj(zTail, bytes), 0);
}
@@ -3667,7 +3667,7 @@ static int test_prepare_v2(
if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
if( zTail && objc>=5 ){
if( bytes>=0 ){
- bytes = bytes - (zTail-zSql);
+ bytes = bytes - (int)(zTail-zSql);
}
Tcl_ObjSetVar2(interp, objv[4], 0, Tcl_NewStringObj(zTail, bytes), 0);
}
@@ -3768,7 +3768,7 @@ static int test_prepare16(
if( objc>=5 ){
if( zTail ){
- objlen = objlen - ((u8 *)zTail-(u8 *)zSql);
+ objlen = objlen - (int)((u8 *)zTail-(u8 *)zSql);
}else{
objlen = 0;
}
@@ -3828,7 +3828,7 @@ static int test_prepare16_v2(
if( objc>=5 ){
if( zTail ){
- objlen = objlen - ((u8 *)zTail-(u8 *)zSql);
+ objlen = objlen - (int)((u8 *)zTail-(u8 *)zSql);
}else{
objlen = 0;
}
diff --git a/src/test2.c b/src/test2.c
index 8343692f6..8acdf6f4e 100644
--- a/src/test2.c
+++ b/src/test2.c
@@ -547,7 +547,7 @@ static int fake_big_file(
if( Tcl_GetInt(interp, argv[1], &n) ) return TCL_ERROR;
pVfs = sqlite3_vfs_find(0);
- nFile = strlen(argv[2]);
+ nFile = (int)strlen(argv[2]);
zFile = sqlite3_malloc( nFile+2 );
if( zFile==0 ) return TCL_ERROR;
memcpy(zFile, argv[2], nFile+1);
diff --git a/src/test3.c b/src/test3.c
index 947ded7d9..e460c42e4 100644
--- a/src/test3.c
+++ b/src/test3.c
@@ -80,7 +80,7 @@ static int btree_open(
sDb.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_RECURSIVE);
sqlite3_mutex_enter(sDb.mutex);
}
- n = strlen(argv[1]);
+ n = (int)strlen(argv[1]);
zFilename = sqlite3_malloc( n+2 );
if( zFilename==0 ) return TCL_ERROR;
memcpy(zFilename, argv[1], n+1);
diff --git a/src/test6.c b/src/test6.c
index e2cee0919..bae6b65dc 100644
--- a/src/test6.c
+++ b/src/test6.c
@@ -468,8 +468,8 @@ static int cfSync(sqlite3_file *pFile, int flags){
const char *zName = pCrash->zName;
const char *zCrashFile = g.zCrashFile;
- int nName = strlen(zName);
- int nCrashFile = strlen(zCrashFile);
+ int nName = (int)strlen(zName);
+ int nCrashFile = (int)strlen(zCrashFile);
if( nCrashFile>0 && zCrashFile[nCrashFile-1]=='*' ){
nCrashFile--;
diff --git a/src/test8.c b/src/test8.c
index 80e7adaf2..ba7e37372 100644
--- a/src/test8.c
+++ b/src/test8.c
@@ -192,7 +192,7 @@ static int getColumnNames(
rc = SQLITE_NOMEM;
goto out;
}
- nBytes += strlen(zName)+1;
+ nBytes += (int)strlen(zName)+1;
}
aCol = (char **)sqlite3MallocZero(nBytes);
if( !aCol ){
@@ -1217,7 +1217,7 @@ static int echoRename(sqlite3_vtab *vtab, const char *zNewName){
}
if( p->isPattern ){
- int nThis = strlen(p->zThis);
+ int nThis = (int)strlen(p->zThis);
char *zSql = sqlite3_mprintf("ALTER TABLE %s RENAME TO %s%s",
p->zTableName, zNewName, &p->zTableName[nThis]
);
diff --git a/src/test_func.c b/src/test_func.c
index fff070e7e..c4fe351cb 100644
--- a/src/test_func.c
+++ b/src/test_func.c
@@ -202,7 +202,7 @@ static void test_auxdata(
}else {
zRet[i*2] = '0';
}
- n = strlen(z) + 1;
+ n = (int)strlen(z) + 1;
zAux = testContextMalloc(pCtx, n);
if( zAux ){
memcpy(zAux, z, n);
diff --git a/src/test_fuzzer.c b/src/test_fuzzer.c
index d32a39c15..10496f2ea 100644
--- a/src/test_fuzzer.c
+++ b/src/test_fuzzer.c
@@ -308,8 +308,8 @@ static int fuzzerLoadOneRule(
if( zFrom==0 ) zFrom = "";
if( zTo==0 ) zTo = "";
- nFrom = strlen(zFrom);
- nTo = strlen(zTo);
+ nFrom = (int)strlen(zFrom);
+ nTo = (int)strlen(zTo);
/* Silently ignore null transformations */
if( strcmp(zFrom, zTo)==0 ){
@@ -448,7 +448,7 @@ static char *fuzzerDequote(const char *zIn){
int nIn; /* Size of input string, in bytes */
char *zOut; /* Output (dequoted) string */
- nIn = strlen(zIn);
+ nIn = (int)strlen(zIn);
zOut = sqlite3_malloc(nIn+1);
if( zOut ){
char q = zIn[0]; /* Quote character (if any ) */
@@ -465,7 +465,7 @@ static char *fuzzerDequote(const char *zIn){
zOut[iOut++] = zIn[iIn];
}
}
- assert( strlen(zOut)<=nIn );
+ assert( (int)strlen(zOut)<=nIn );
}
return zOut;
}
@@ -513,7 +513,7 @@ static int fuzzerConnect(
}else{
int nModule; /* Length of zModule, in bytes */
- nModule = strlen(zModule);
+ nModule = (int)strlen(zModule);
pNew = sqlite3_malloc( sizeof(*pNew) + nModule + 1);
if( pNew==0 ){
rc = SQLITE_NOMEM;
@@ -870,11 +870,11 @@ static fuzzer_stem *fuzzerNewStem(
fuzzer_rule *pRule;
unsigned int h;
- pNew = sqlite3_malloc( sizeof(*pNew) + strlen(zWord) + 1 );
+ pNew = sqlite3_malloc( sizeof(*pNew) + (int)strlen(zWord) + 1 );
if( pNew==0 ) return 0;
memset(pNew, 0, sizeof(*pNew));
pNew->zBasis = (char*)&pNew[1];
- pNew->nBasis = strlen(zWord);
+ pNew->nBasis = (int)strlen(zWord);
memcpy(pNew->zBasis, zWord, pNew->nBasis+1);
pRule = pCur->pVtab->pRule;
while( fuzzerSkipRule(pRule, pNew, pCur->iRuleset) ){
@@ -997,7 +997,7 @@ static int fuzzerFilter(
/* If the query term is longer than FUZZER_MX_OUTPUT_LENGTH bytes, this
** query will return zero rows. */
- if( strlen(zWord)<FUZZER_MX_OUTPUT_LENGTH ){
+ if( (int)strlen(zWord)<FUZZER_MX_OUTPUT_LENGTH ){
pCur->pStem = pStem = fuzzerNewStem(pCur, zWord, (fuzzer_cost)0);
if( pStem==0 ) return SQLITE_NOMEM;
pStem->pRule = &pCur->nullRule;
diff --git a/src/test_hexio.c b/src/test_hexio.c
index e3258e869..b20b5ce73 100644
--- a/src/test_hexio.c
+++ b/src/test_hexio.c
@@ -126,7 +126,7 @@ static int hexio_read(
return TCL_ERROR;
}
fseek(in, offset, SEEK_SET);
- got = fread(zBuf, 1, amt, in);
+ got = (int)fread(zBuf, 1, amt, in);
fclose(in);
if( got<0 ){
got = 0;
@@ -178,7 +178,7 @@ static int hexio_write(
return TCL_ERROR;
}
fseek(out, offset, SEEK_SET);
- written = fwrite(aOut, 1, nOut, out);
+ written = (int)fwrite(aOut, 1, nOut, out);
sqlite3_free(aOut);
fclose(out);
Tcl_SetObjResult(interp, Tcl_NewIntObj(written));
diff --git a/src/test_journal.c b/src/test_journal.c
index 4cb51fbcf..e8701a4ee 100644
--- a/src/test_journal.c
+++ b/src/test_journal.c
@@ -290,9 +290,9 @@ static jt_file *locateDatabaseHandle(const char *zJournal){
jt_file *pMain = 0;
enterJtMutex();
for(pMain=g.pList; pMain; pMain=pMain->pNext){
- int nName = strlen(zJournal) - strlen("-journal");
+ int nName = (int)(strlen(zJournal) - strlen("-journal"));
if( (pMain->flags&SQLITE_OPEN_MAIN_DB)
- && (strlen(pMain->zName)==nName)
+ && ((int)strlen(pMain->zName)==nName)
&& 0==memcmp(pMain->zName, zJournal, nName)
&& (pMain->eLock>=SQLITE_LOCK_RESERVED)
){
@@ -723,7 +723,7 @@ static int jtOpen(
** returning.
*/
static int jtDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
- int nPath = strlen(zPath);
+ int nPath = (int)strlen(zPath);
if( nPath>8 && 0==strcmp("-journal", &zPath[nPath-8]) ){
/* Deleting a journal file. The end of a transaction. */
jt_file *pMain = locateDatabaseHandle(zPath);
diff --git a/src/test_multiplex.c b/src/test_multiplex.c
index 62b4902a8..a3b3e2f27 100644
--- a/src/test_multiplex.c
+++ b/src/test_multiplex.c
@@ -650,7 +650,7 @@ static int multiplexDelete(
/* If the main chunk was deleted successfully, also delete any subsequent
** chunks - starting with the last (highest numbered).
*/
- int nName = strlen(zName);
+ int nName = (int)strlen(zName);
char *z;
z = sqlite3_malloc(nName + 5);
if( z==0 ){
diff --git a/src/test_onefile.c b/src/test_onefile.c
index adc0d13d9..69867441b 100644
--- a/src/test_onefile.c
+++ b/src/test_onefile.c
@@ -606,7 +606,7 @@ static int fsOpen(
p->eType = eType;
assert(strlen("-journal")==8);
- nName = strlen(zName)-((eType==JOURNAL_FILE)?8:0);
+ nName = (int)strlen(zName)-((eType==JOURNAL_FILE)?8:0);
pReal=pFsVfs->pFileList;
for(; pReal && strncmp(pReal->zName, zName, nName); pReal=pReal->pNext);
@@ -687,7 +687,7 @@ static int fsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
fs_vfs_t *pFsVfs = (fs_vfs_t *)pVfs;
fs_real_file *pReal;
sqlite3_file *pF;
- int nName = strlen(zPath) - 8;
+ int nName = (int)strlen(zPath) - 8;
assert(strlen("-journal")==8);
assert(strcmp("-journal", &zPath[nName])==0);
@@ -717,7 +717,7 @@ static int fsAccess(
fs_vfs_t *pFsVfs = (fs_vfs_t *)pVfs;
fs_real_file *pReal;
int isJournal = 0;
- int nName = strlen(zPath);
+ int nName = (int)strlen(zPath);
if( flags!=SQLITE_ACCESS_EXISTS ){
sqlite3_vfs *pParent = ((fs_vfs_t *)pVfs)->pParent;
diff --git a/src/test_osinst.c b/src/test_osinst.c
index 35e168c41..531433313 100644
--- a/src/test_osinst.c
+++ b/src/test_osinst.c
@@ -671,7 +671,7 @@ static void vfslog_call(
static void vfslog_string(sqlite3_vfs *pVfs, const char *zStr){
VfslogVfs *p = (VfslogVfs *)pVfs;
unsigned char *zRec;
- int nStr = zStr ? strlen(zStr) : 0;
+ int nStr = zStr ? (int)strlen(zStr) : 0;
if( (4+nStr+p->nBuf)>sizeof(p->aBuf) ){
vfslog_flush(p);
}
@@ -720,7 +720,7 @@ int sqlite3_vfslog_new(
return SQLITE_ERROR;
}
- nVfs = strlen(zVfs);
+ nVfs = (int)strlen(zVfs);
nByte = sizeof(VfslogVfs) + pParent->szOsFile + nVfs+1+pParent->mxPathname+1;
p = (VfslogVfs *)sqlite3_malloc(nByte);
memset(p, 0, nByte);
diff --git a/src/test_quota.c b/src/test_quota.c
index 6514a28a1..87bd1e918 100644
--- a/src/test_quota.c
+++ b/src/test_quota.c
@@ -344,7 +344,7 @@ static quotaFile *quotaFindFile(
pFile = pFile->pNext;
}
if( pFile==0 && createFlag ){
- int nName = strlen(zName);
+ int nName = (int)(strlen(zName) & 0x3fffffff);
pFile = (quotaFile *)sqlite3_malloc( sizeof(*pFile) + nName + 1 );
if( pFile ){
memset(pFile, 0, sizeof(*pFile));
@@ -422,7 +422,7 @@ static quotaFile *quotaFindFile(
*/
static char *quota_utf8_to_mbcs(const char *zUtf8){
#if SQLITE_OS_WIN
- int n; /* Bytes in zUtf8 */
+ size_t n; /* Bytes in zUtf8 */
int nWide; /* number of UTF-16 characters */
int nMbcs; /* Bytes of MBCS */
LPWSTR zTmpWide; /* The UTF16 text */
@@ -900,7 +900,7 @@ int sqlite3_quota_set(
pGroup = pGroup->pNext;
}
if( pGroup==0 ){
- int nPattern = strlen(zPattern);
+ int nPattern = (int)(strlen(zPattern) & 0x3fffffff);
if( iLimit<=0 ){
quotaLeave();
return SQLITE_OK;
@@ -1242,7 +1242,7 @@ sqlite3_int64 sqlite3_quota_file_size(quota_FILE *p){
*/
int sqlite3_quota_remove(const char *zFilename){
char *zFull; /* Full pathname for zFilename */
- int nFull; /* Number of bytes in zFilename */
+ size_t nFull; /* Number of bytes in zFilename */
int rc; /* Result code */
quotaGroup *pGroup; /* Group containing zFilename */
quotaFile *pFile; /* A file in the group */
@@ -1582,7 +1582,7 @@ static int test_quota_fread(
char *zBuf;
int sz;
int nElem;
- int got;
+ size_t got;
if( objc!=4 ){
Tcl_WrongNumArgs(interp, 1, objv, "HANDLE SIZE NELEM");
@@ -1617,7 +1617,7 @@ static int test_quota_fwrite(
char *zBuf;
int sz;
int nElem;
- int got;
+ size_t got;
if( objc!=5 ){
Tcl_WrongNumArgs(interp, 1, objv, "HANDLE SIZE NELEM CONTENT");
@@ -1628,7 +1628,7 @@ static int test_quota_fwrite(
if( Tcl_GetIntFromObj(interp, objv[3], &nElem) ) return TCL_ERROR;
zBuf = Tcl_GetString(objv[4]);
got = sqlite3_quota_fwrite(zBuf, sz, nElem, p);
- Tcl_SetObjResult(interp, Tcl_NewIntObj(got));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(got));
return TCL_OK;
}
diff --git a/src/test_vfs.c b/src/test_vfs.c
index bab67798c..d1c34a38e 100644
--- a/src/test_vfs.c
+++ b/src/test_vfs.c
@@ -784,7 +784,7 @@ static int tvfsShmOpen(sqlite3_file *pFile){
if( 0==strcmp(pFd->zFilename, pBuffer->zFile) ) break;
}
if( !pBuffer ){
- int nByte = sizeof(TestvfsBuffer) + strlen(pFd->zFilename) + 1;
+ int nByte = sizeof(TestvfsBuffer) + (int)strlen(pFd->zFilename) + 1;
pBuffer = (TestvfsBuffer *)ckalloc(nByte);
memset(pBuffer, 0, nByte);
pBuffer->zFile = (char *)&pBuffer[1];
@@ -866,13 +866,13 @@ static int tvfsShmLock(
if( p->pScript && p->mask&TESTVFS_SHMLOCK_MASK ){
sqlite3_snprintf(sizeof(zLock), zLock, "%d %d", ofst, n);
- nLock = strlen(zLock);
+ nLock = (int)strlen(zLock);
if( flags & SQLITE_SHM_LOCK ){
strcpy(&zLock[nLock], " lock");
}else{
strcpy(&zLock[nLock], " unlock");
}
- nLock += strlen(&zLock[nLock]);
+ nLock += (int)strlen(&zLock[nLock]);
if( flags & SQLITE_SHM_SHARED ){
strcpy(&zLock[nLock], " shared");
}else{
@@ -1396,7 +1396,7 @@ static int testvfs_cmd(
}
zVfs = Tcl_GetString(objv[1]);
- nByte = sizeof(Testvfs) + strlen(zVfs)+1;
+ nByte = sizeof(Testvfs) + (int)strlen(zVfs)+1;
p = (Testvfs *)ckalloc(nByte);
memset(p, 0, nByte);
p->iDevchar = -1;