Import from trunk the fix the "test" target on the autoconf and MSVC makefiles

and some minor compiler warning fixes.

FossilOrigin-Name: c9f20eb2fbba0868df85ebb98877f9bb969be8a4
This commit is contained in:
drh 2014-12-05 00:41:17 +00:00
commit c0d33d20f7
6 changed files with 24 additions and 19 deletions

View File

@ -366,6 +366,7 @@ TESTSRC = \
$(TOP)/src/test_autoext.c \
$(TOP)/src/test_async.c \
$(TOP)/src/test_backup.c \
$(TOP)/src/test_blob.c \
$(TOP)/src/test_btree.c \
$(TOP)/src/test_config.c \
$(TOP)/src/test_demovfs.c \

View File

@ -842,6 +842,7 @@ TESTSRC = \
$(TOP)\src\test_autoext.c \
$(TOP)\src\test_async.c \
$(TOP)\src\test_backup.c \
$(TOP)\src\test_blob.c \
$(TOP)\src\test_btree.c \
$(TOP)\src\test_config.c \
$(TOP)\src\test_demovfs.c \

View File

@ -21,11 +21,11 @@ SQLITE_EXTENSION_INIT1
** Structure used to accumulate the output
*/
struct EvalResult {
char *z; /* Accumulated output */
const char *zSep; /* Separator */
int szSep; /* Size of the separator string */
int nAlloc; /* Number of bytes allocated for z[] */
int nUsed; /* Number of bytes of z[] actually used */
char *z; /* Accumulated output */
const char *zSep; /* Separator */
int szSep; /* Size of the separator string */
sqlite3_int64 nAlloc; /* Number of bytes allocated for z[] */
sqlite3_int64 nUsed; /* Number of bytes of z[] actually used */
};
/*
@ -37,10 +37,13 @@ static int callback(void *pCtx, int argc, char **argv, char **colnames){
for(i=0; i<argc; i++){
const char *z = argv[i] ? argv[i] : "";
size_t sz = strlen(z);
if( sz+p->nUsed+p->szSep+1 > p->nAlloc ){
if( (sqlite3_int64)sz+p->nUsed+p->szSep+1 > p->nAlloc ){
char *zNew;
p->nAlloc = p->nAlloc*2 + sz + p->szSep + 1;
zNew = sqlite3_realloc(p->z, p->nAlloc);
/* Using sqlite3_realloc64() would be better, but it is a recent
** addition and will cause a segfault if loaded by an older version
** of SQLite. */
zNew = p->nAlloc<=0x7fffffff ? sqlite3_realloc(p->z, (int)p->nAlloc) : 0;
if( zNew==0 ){
sqlite3_free(p->z);
memset(p, 0, sizeof(*p));
@ -93,7 +96,7 @@ static void sqlEvalFunc(
sqlite3_result_error_nomem(context);
sqlite3_free(x.z);
}else{
sqlite3_result_text(context, x.z, x.nUsed, sqlite3_free);
sqlite3_result_text(context, x.z, (int)x.nUsed, sqlite3_free);
}
}

View File

@ -1,9 +1,9 @@
C Incorporate\sthe\sSQLITE_CHECKPOINT_TRUNCATE\senhancement\sand\sa\scouple\sof\nobscure\sbug\sfixes\sfrom\strunk.
D 2014-12-04T23:35:08.510
C Import\sfrom\strunk\sthe\sfix\sthe\s"test"\starget\son\sthe\sautoconf\sand\sMSVC\smakefiles\nand\ssome\sminor\scompiler\swarning\sfixes.
D 2014-12-05T00:41:17.266
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in e2007fafb7b679a39800a1d636dcc6662a840530
F Makefile.in 0869fe2a3b7853f048a945fd9cdf671a329b7351
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F Makefile.msc 64f7ba446298db653fc195ad7699e4b06863d9c4
F Makefile.msc 212dc90adfad8988134bf3d901a78270d7a9c267
F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0
F README.md 64f270c43c38c46de749e419c22f0ae2f4499fe8
F VERSION d846487aff892625eb8e75960234e7285f0462fe
@ -109,7 +109,7 @@ F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37
F ext/misc/amatch.c 678056a4bfcd83c4e82dea81d37543cd1d6dbee1
F ext/misc/closure.c 636024302cde41b2bf0c542f81c40c624cfb7012
F ext/misc/compress.c 76e45655f4046e756064ab10c62e18f2eb846b9f
F ext/misc/eval.c 04e630bde869aa1fec6b993d40591f963be2f868
F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
F ext/misc/fuzzer.c 136533c53cfce0957f0b48fa11dba27e21c5c01d
F ext/misc/ieee754.c b0362167289170627659e84173f5d2e8fee8566e
@ -255,7 +255,7 @@ F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
F src/status.c 81712116e826b0089bb221b018929536b2b5406f
F src/table.c f142bba7903e93ca8d113a5b8877a108ad1a27dc
F src/tclsqlite.c 05be57620509060e85064b9495256c05d56e76b0
F src/test1.c f5d7ecd3dd663b11f35269fd91f7090db0570903
F src/test1.c c24d7f67252348d756773a6dbe23a61b4552f709
F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712
F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c
F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df
@ -1241,7 +1241,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 2617d93713d9f4cf907ab2e7baef6a0f74f7198e 0d3aef97ebddf422b8bdcbc5878970c6129e3f54
R 6c3870353869dc63de6b6e7262754990
P 34ffa3b3c002b0e87d8382ad76e87dbaec0b2bc6 e9955c0e14d13ba1411f013acb4979958dae2516
R 4ae9fe307118343dad082c4eb733ef9c
U drh
Z 0421768e128ea5c34e2d7a186ce23ac0
Z 9623b2dce920052ac42bbb47ec4723c7

View File

@ -1 +1 @@
34ffa3b3c002b0e87d8382ad76e87dbaec0b2bc6
c9f20eb2fbba0868df85ebb98877f9bb969be8a4

View File

@ -3661,7 +3661,7 @@ static int test_prepare_v2(
zCopy = malloc(bytes);
memcpy(zCopy, zSql, bytes);
}else{
int n = strlen(zSql) + 1;
int n = (int)strlen(zSql) + 1;
zCopy = malloc(n);
memcpy(zCopy, zSql, n);
}