Merge the latest trunk changes into the WinRT branch (fixes various MSVC compiler warnings).

FossilOrigin-Name: 294a5cca5087b510c2483792631bbf98a415e254
This commit is contained in:
mistachkin 2012-04-20 08:23:32 +00:00
commit c2f2d9280b
21 changed files with 84 additions and 79 deletions

View File

@ -88,9 +88,9 @@ static int fts3termConnectMethod(
}
zDb = argv[1];
nDb = strlen(zDb);
nDb = (int)strlen(zDb);
zFts3 = argv[3];
nFts3 = strlen(zFts3);
nFts3 = (int)strlen(zFts3);
rc = sqlite3_declare_vtab(db, FTS3_TERMS_SCHEMA);
if( rc!=SQLITE_OK ) return rc;

View File

@ -390,7 +390,7 @@ static int testTokenizerOpen(
memset(pCsr, 0, sizeof(test_tokenizer_cursor));
pCsr->aInput = pInput;
if( nBytes<0 ){
pCsr->nInput = strlen(pInput);
pCsr->nInput = (int)strlen(pInput);
}else{
pCsr->nInput = nBytes;
}
@ -443,7 +443,7 @@ static int testTokenizerNext(
const char *pToken = p;
int nToken;
while( p<pEnd && testIsTokenChar(*p) ) p++;
nToken = p-pToken;
nToken = (int)(p-pToken);
/* Copy the token into the buffer */
if( nToken>pCsr->nBuffer ){
@ -461,12 +461,12 @@ static int testTokenizerNext(
for(i=0; i<nToken; i++) pCsr->aBuffer[i] = testTolower(pToken[i]);
}
pCsr->iToken++;
pCsr->iInput = p - pCsr->aInput;
pCsr->iInput = (int)(p - pCsr->aInput);
*ppToken = pCsr->aBuffer;
*pnBytes = nToken;
*piStartOffset = pToken - pCsr->aInput;
*piEndOffset = p - pCsr->aInput;
*piStartOffset = (int)(pToken - pCsr->aInput);
*piEndOffset = (int)(p - pCsr->aInput);
*piPosition = pCsr->iToken;
}
}

View File

@ -1,5 +1,5 @@
C Merge\sbuild\stool\supdates\sfrom\strunk.\s\sAlso,\smodify\sMSVC\smakefile\sto\sallow\sfor\sdebugging\sof\sbuild\stool\sissues.
D 2012-04-18T10:29:21.047
C Merge\sthe\slatest\strunk\schanges\sinto\sthe\sWinRT\sbranch\s(fixes\svarious\sMSVC\scompiler\swarnings).
D 2012-04-20T08:23:32.979
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -73,8 +73,8 @@ F ext/fts3/fts3_hash.h 8331fb2206c609f9fc4c4735b9ab5ad6137c88ec
F ext/fts3/fts3_icu.c 62ec177c55f6a5c6e994dd3e5fd3194b4045c347
F ext/fts3/fts3_porter.c a465b49fcb8249a755792f87516eff182efa42b3
F ext/fts3/fts3_snippet.c 51a3a34c217e24678a133782c1dfb6f2f70fe559
F ext/fts3/fts3_term.c 41e82ad335213d1c24356cf310dca1d3c13e7366
F ext/fts3/fts3_test.c f153a121c763993e3d94cc99c012ee68d13231ae
F ext/fts3/fts3_term.c a521f75132f9a495bdca1bdd45949b3191c52763
F ext/fts3/fts3_test.c 348f7d08cae05285794e23dc4fe8b8fdf66e264a
F ext/fts3/fts3_tokenizer.c 3da7254a9881f7e270ab28e2004e0d22b3212bce
F ext/fts3/fts3_tokenizer.h 66dec98e365854b6cd2d54f1a96bb6d428fc5a68
F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004
@ -135,7 +135,7 @@ F src/complete.c dc1d136c0feee03c2f7550bafc0d29075e36deac
F src/ctime.c 500d019da966631ad957c37705642be87524463b
F src/date.c 067a81c9942c497aafd2c260e13add8a7d0c7dd4
F src/delete.c 4c20ea4f6213b3bc1c6a510586864b679946e05e
F src/expr.c 1b2383adc4391ddae38abb71fd4690a3af8efb01
F src/expr.c eefabaa4a3dc67309a754eb0eab1a163ff4c2bf3
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
F src/fkey.c 657212460bf5cfd3ae607d12ea62092844c227b5
F src/func.c c6b3c94320253a35bda43fb69cc292618e3285d6
@ -189,15 +189,15 @@ F src/sqliteInt.h c5e917c4f1453f3972b1fd0c81105dfe4f09cc32
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
F src/status.c 35939e7e03abf1b7577ce311f48f682c40de3208
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
F src/tclsqlite.c 086dfdd72e5892de223968a258e1ccbd9693e717
F src/test1.c 9667a33a4fc849ce668501ae21cf6fb04898c6a9
F src/test2.c 711555927f1f7e8db9aab86b512bc6934a774abe
F src/test3.c f82399ec50d9cd7378bf9d6db6c1409d5e77b042
F src/tclsqlite.c fe5406573e1527957e00dcaf51edd9d8bd31b918
F src/test1.c fc2acf0a2db517c8d19e5e55bda8e1237db77378
F src/test2.c 4178056dd1e7d70f954ad8a1e3edb71a2a784daf
F src/test3.c 3c3c2407fa6ec7a19e24ae23f7cb439d0275a60d
F src/test4.c d1e5a5e904d4b444cf572391fdcb017638e36ff7
F src/test5.c a6d1ac55ac054d0b2b8f37b5e655b6c92645a013
F src/test6.c 3329df2dbc0293031d763947ec08c9eef982ef1d
F src/test6.c 417e1e214734393c24a8ee80b41485a9c4169123
F src/test7.c 2e0781754905c8adc3268d8f0967e7633af58843
F src/test8.c 61b41d79509a479dec1ac32b6d4209b27c4b1ba5
F src/test8.c 5ecbffe6712da81d5d10454e9d77d6c5bac95fe8
F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
F src/test_async.c 0612a752896fad42d55c3999a5122af10dcf22ad
F src/test_autoext.c 30e7bd98ab6d70a62bb9ba572e4c7df347fe645e
@ -206,22 +206,22 @@ F src/test_btree.c 47cd771250f09cdc6e12dda5bc71bc0b3abc96e2
F src/test_config.c 16f4bcb82fa82b39e92c8de49962a63b87e5faad
F src/test_demovfs.c 20a4975127993f4959890016ae9ce5535a880094
F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc
F src/test_func.c 6232d722a4ddb193035aa13a03796bf57d6c12fd
F src/test_fuzzer.c 7e431cb04f4457b676a2764839d2857fdd91ec4e
F src/test_hexio.c c4773049603151704a6ab25ac5e936b5109caf5a
F src/test_func.c 090f2c3339e85c2c964435f99aed6f3da9d59525
F src/test_fuzzer.c 1d26aa965120420bc14807da29d4d4541bfa6148
F src/test_hexio.c abfdecb6fa58c354623978efceb088ca18e379cd
F src/test_init.c 3cbad7ce525aec925f8fda2192d576d47f0d478a
F src/test_intarray.c d879bbf8e4ce085ab966d1f3c896a7c8b4f5fc99
F src/test_intarray.h 489edb9068bb926583445cb02589344961054207
F src/test_journal.c b964473ff1b7a65626763f068fa6a810385d1fbf
F src/test_journal.c f5c0a05b7b3d5930db769b5ee6c3766dc2221a64
F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e
F src/test_malloc.c 3f5903a1528fd32fe4c472a3bd0259128d8faaef
F src/test_multiplex.c 3dffd0fe6c96ac7c5150485b55244e73faab5380
F src/test_multiplex.c 66dcfca001ee22f04ef31ad353772ed05a017e53
F src/test_multiplex.h e99c571bc4968b7a9363b661481f3934bfead61d
F src/test_mutex.c a6bd7b9cf6e19d989e31392b06ac8d189f0d573e
F src/test_onefile.c 5e1382e7844c703c77c4c2aee82f8359555b5a8e
F src/test_osinst.c 7f790ac89c5a585d51b341274d9691c3391e0923
F src/test_onefile.c 0396f220561f3b4eedc450cef26d40c593c69a25
F src/test_osinst.c 90a845c8183013d80eccb1f29e8805608516edba
F src/test_pcache.c a5cd24730cb43c5b18629043314548c9169abb00
F src/test_quota.c 2ab468f5817b84f7105f78b77c300649ea5af8d1
F src/test_quota.c 9d6be9cd3bb132df2b964193b6a4ec850f50a210
F src/test_quota.h ee5da2ae7f84d1c8e0e0e2ab33f01d69f10259b5
F src/test_rtree.c aba603c949766c4193f1068b91c787f57274e0d9
F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0
@ -231,7 +231,7 @@ F src/test_superlock.c 2b97936ca127d13962c3605dbc9a4ef269c424cd
F src/test_syscall.c a992d8c80ea91fbf21fb2dd570db40e77dd7e6ae
F src/test_tclvar.c f4dc67d5f780707210d6bb0eb6016a431c04c7fa
F src/test_thread.c e286f2173563f2a1747c24bcda6b9d030bf4f4e4
F src/test_vfs.c 73f46bd9b5183ebcb77da22773886b81157cdc3d
F src/test_vfs.c 9d934e111021d56c629efc73a796648c9519ad12
F src/test_vfstrace.c 6b28adb2a0e8ecd0f2e3581482e1f658b11b4067
F src/test_wholenumber.c 3d2b9ed1505c40ad5c5ca2ad16ae7a289d6cc251
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
@ -502,7 +502,7 @@ F test/fts4content.test 17b2360f7d1a9a7e5aa8022783f5c5731b6dfd4f
F test/fts4langid.test 24a6e41063b416bbdf371ff6b4476fa41c194aa7
F test/fts4merge.test c424309743fdd203f8e56a1f1cd7872cd66cc0ee
F test/fts4merge2.test 5faa558d1b672f82b847d2a337465fa745e46891
F test/fts4merge3.test 125c3334f49bc171b3310efc99358cd05475c1d6
F test/fts4merge3.test aab02a09f50fe6baaddc2e159c3eabc116d45fc7
F test/func.test 9809b7622d721904a8cc33c1ffb87f46d506ed01
F test/func2.test 772d66227e4e6684b86053302e2d74a2500e1e0f
F test/func3.test 001021e5b88bd02a3b365a5c5fd8f6f49d39744a
@ -1000,7 +1000,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh a8a0a3babda96dfb1ff51adda3cbbf3dfb7266c2
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
P ad5cd15f49b286896f94ab1ff207077beee40e12 6015200beb3be7ec141ce36de694278e3ba11a02
R f7f672d0d1f7d8f661126d329aacae85
P b2a2fdb0ac8d27efe3036fc49941279e24de6211 3281972eaa46cb57fd9f0387063f47430dc0a3b4
R 78edc20e1e975f9e0d821b4521149c85
U mistachkin
Z 5f8778fd5913269d27b5a934d131dc8a
Z 4ead4f8ca648b9c6da92e503c403b730

View File

@ -1 +1 @@
b2a2fdb0ac8d27efe3036fc49941279e24de6211
294a5cca5087b510c2483792631bbf98a415e254

View File

@ -4009,6 +4009,8 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
return WRC_Continue;
}
static int analyzeAggregatesInSelect(Walker *pWalker, Select *pSelect){
UNUSED_PARAMETER(pWalker);
UNUSED_PARAMETER(pSelect);
return WRC_Continue;
}

View File

@ -1163,7 +1163,7 @@ static int dbPrepareAndBind(
memset(pPreStmt, 0, nByte);
pPreStmt->pStmt = pStmt;
pPreStmt->nSql = (*pzOut - zSql);
pPreStmt->nSql = (int)(*pzOut - zSql);
pPreStmt->zSql = sqlite3_sql(pStmt);
pPreStmt->apParm = (Tcl_Obj **)&pPreStmt[1];
#ifdef SQLITE_TEST
@ -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));
}
}
}

View File

@ -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;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 ){

View File

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

View File

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

View File

@ -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;
}

View File

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

View File

@ -44,7 +44,10 @@ do_all_bc_test {
do_test 1.2 { sql1 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" } {1485}
do_test 1.3 { sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" } {1485}
do_test 1.4 { sql2 "PRAGMA page_count" } {1286}
do_test 1.4 {
set x [sql2 "PRAGMA page_count"]
expr {$x>=1284 && $x<=1286}
} {1}
do_test 1.5 { sql2 {
SELECT level, count(*) FROM t2_segdir GROUP BY level ORDER BY 1
} } [list 0 15 1 1 2 14 3 4]