Skip to content

Commit 06dce3f

Browse files
committed
Merge branch 'prerelease' of ssh://git.zetetic.net/sqlcipher into prerelease
2 parents c9c5e9c + ee855a2 commit 06dce3f

File tree

262 files changed

+13729
-4607
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+13729
-4607
lines changed

Makefile.in

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
186186
###############################################################################
187187

188188
USE_AMALGAMATION = @USE_AMALGAMATION@
189+
AMALGAMATION_LINE_MACROS = @AMALGAMATION_LINE_MACROS@
189190

190191
# Object files for the SQLite library (non-amalgamation).
191192
#
@@ -489,7 +490,8 @@ TESTSRC += \
489490
$(TOP)/ext/misc/unionvtab.c \
490491
$(TOP)/ext/misc/wholenumber.c \
491492
$(TOP)/ext/misc/zipfile.c \
492-
$(TOP)/ext/userauth/userauth.c
493+
$(TOP)/ext/userauth/userauth.c \
494+
$(TOP)/ext/rtree/test_rtreedoc.c
493495

494496
# Source code to the library files needed by the test fixture
495497
#
@@ -644,7 +646,7 @@ FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
644646
FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
645647
FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4
646648
FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS3_PARENTHESIS
647-
#FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS5
649+
FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS5
648650
FUZZCHECK_OPT += -DSQLITE_ENABLE_RTREE
649651
FUZZCHECK_OPT += -DSQLITE_ENABLE_GEOPOLY
650652
FUZZCHECK_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
@@ -778,7 +780,7 @@ mptest: mptester$(TEXE)
778780
touch .target_source
779781

780782
sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl
781-
$(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl
783+
$(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS)
782784
cp tsrc/sqlite3ext.h .
783785
cp $(TOP)/ext/session/sqlite3session.h .
784786

@@ -1286,7 +1288,10 @@ coretestprogs: $(TESTPROGS)
12861288
testprogs: coretestprogs srcck1$(BEXE) fuzzcheck$(TEXE) sessionfuzz$(TEXE)
12871289

12881290
# A very detailed test running most or all test cases
1289-
fulltest: $(TESTPROGS) fuzztest
1291+
fulltest: alltest fuzztest
1292+
1293+
# Run most or all tcl test cases
1294+
alltest: $(TESTPROGS)
12901295
./testfixture$(TEXE) $(TOP)/test/all.test $(TESTOPTS)
12911296

12921297
# Really really long testing

Makefile.msc

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,9 @@ DEBUG = 0
235235
!ENDIF
236236

237237
# <<mark>>
238-
# Disable use of the --linemacros argument to the mksqlite3c.tcl tool, which
239-
# is used to build the amalgamation.
238+
# By default, use --linemacros=1 argument to the mksqlite3c.tcl tool, which
239+
# is used to build the amalgamation. This can be turned off to ease debug
240+
# of the amalgamation away from the source tree.
240241
#
241242
!IFNDEF NO_LINEMACROS
242243
NO_LINEMACROS = 0
@@ -788,9 +789,9 @@ MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c.tcl
788789

789790
!IFNDEF MKSQLITE3C_ARGS
790791
!IF $(DEBUG)>1 && $(NO_LINEMACROS)==0
791-
MKSQLITE3C_ARGS = --linemacros
792+
MKSQLITE3C_ARGS = --linemacros=1
792793
!ELSE
793-
MKSQLITE3C_ARGS =
794+
MKSQLITE3C_ARGS = --linemacros=0
794795
!ENDIF
795796
!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
796797
MKSQLITE3C_ARGS = $(MKSQLITE3C_ARGS) --useapicall
@@ -1593,6 +1594,7 @@ TESTEXT = \
15931594
$(TOP)\ext\misc\totype.c \
15941595
$(TOP)\ext\misc\unionvtab.c \
15951596
$(TOP)\ext\misc\wholenumber.c \
1597+
$(TOP)\ext\rtree\test_rtreedoc.c \
15961598
fts5.c
15971599

15981600
# If use of zlib is enabled, add the "zipfile.c" source file.
@@ -1705,6 +1707,7 @@ MPTESTER_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5
17051707
FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
17061708
FUZZCHECK_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ -DSQLITE_MAX_MEMORY=50000000 -DSQLITE_PRINTF_PRECISION_LIMIT=1000
17071709
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS4
1710+
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS5
17081711
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_RTREE
17091712
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_GEOPOLY
17101713
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_DBSTAT_VTAB
@@ -2216,11 +2219,11 @@ SHELL_SRC = \
22162219
$(TOP)\src\shell.c.in \
22172220
$(TOP)\ext\misc\appendvfs.c \
22182221
$(TOP)\ext\misc\completion.c \
2219-
$(TOP)\ext\misc\decimal.c \
2222+
$(TOP)\ext\misc\decimal.c \
22202223
$(TOP)\ext\misc\fileio.c \
2221-
$(TOP)\ext\misc\ieee754.c \
2222-
$(TOP)\ext\misc\regexp.c \
2223-
$(TOP)\ext\misc\series.c \
2224+
$(TOP)\ext\misc\ieee754.c \
2225+
$(TOP)\ext\misc\regexp.c \
2226+
$(TOP)\ext\misc\series.c \
22242227
$(TOP)\ext\misc\shathree.c \
22252228
$(TOP)\ext\misc\uint.c \
22262229
$(TOP)\ext\expert\sqlite3expert.c \
@@ -2443,7 +2446,9 @@ coretestprogs: $(TESTPROGS)
24432446

24442447
testprogs: coretestprogs srcck1.exe fuzzcheck.exe sessionfuzz.exe
24452448

2446-
fulltest: $(TESTPROGS) fuzztest
2449+
fulltest: alltest fuzztest
2450+
2451+
alltest: $(TESTPROGS)
24472452
@set PATH=$(LIBTCLPATH);$(PATH)
24482453
.\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
24492454

@@ -2471,7 +2476,11 @@ quicktest: testfixture.exe sourcetest
24712476
# This is the common case. Run many tests that do not take too long,
24722477
# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
24732478
#
2474-
test: $(TESTPROGS) sourcetest fuzztest
2479+
test: $(TESTPROGS) sourcetest fuzztest tcltest
2480+
2481+
# The veryquick.test TCL tests.
2482+
#
2483+
tcltest: testfixture.exe
24752484
@set PATH=$(LIBTCLPATH);$(PATH)
24762485
.\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
24772486

@@ -2593,6 +2602,17 @@ rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H
25932602
$(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU \
25942603
$(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
25952604

2605+
THREADTEST3_SRC = \
2606+
$(TOP)\test\threadtest3.c \
2607+
$(TOP)\test\tt3_checkpoint.c \
2608+
$(TOP)\test\tt3_index.c \
2609+
$(TOP)\test\tt3_vacuum.c \
2610+
$(TOP)\test\tt3_stress.c \
2611+
$(TOP)\test\tt3_lookaside1.c
2612+
2613+
threadtest3.exe: $(THREADTEST3_SRC) $(TOP)\src\test_multiplex.c $(SQLITE3C) $(SQLITE3H)
2614+
$(LTLINK) $(NO_WARN) $(TOP)\test\threadtest3.c $(TOP)\src\test_multiplex.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2615+
25962616
LSMDIR=$(TOP)\ext\lsm1
25972617
!INCLUDE $(LSMDIR)\Makefile.msc
25982618

@@ -2630,7 +2650,7 @@ clean:
26302650
del /Q sqlite-*-output.vsix 2>NUL
26312651
del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe dbhash.exe 2>NUL
26322652
del /Q sqltclsh.* 2>NUL
2633-
del /Q dbfuzz.exe sessionfuzz.exe 2>NUL
2653+
del /Q dbfuzz.exe sessionfuzz.exe threadtest3.exe 2>NUL
26342654
del /Q kvtest.exe ossshell.exe scrub.exe 2>NUL
26352655
del /Q showshm.exe sqlite3_checker.* sqlite3_expert.exe 2>NUL
26362656
del /Q fts5.* fts5parse.* 2>NUL

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.36.0
1+
3.37.2

autoconf/tea/win/nmakehlp.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
#define _CRT_SECURE_NO_DEPRECATE
1616
#include <windows.h>
17+
#ifdef _MSC_VER
1718
#pragma comment (lib, "user32.lib")
1819
#pragma comment (lib, "kernel32.lib")
20+
#endif
1921
#include <stdio.h>
2022
#include <math.h>
2123

@@ -37,7 +39,7 @@
3739
/* protos */
3840

3941
static int CheckForCompilerFeature(const char *option);
40-
static int CheckForLinkerFeature(const char **options, int count);
42+
static int CheckForLinkerFeature(char **options, int count);
4143
static int IsIn(const char *string, const char *substring);
4244
static int SubstituteFile(const char *substs, const char *filename);
4345
static int QualifyPath(const char *path);
@@ -54,8 +56,8 @@ typedef struct {
5456
char buffer[STATICBUFFERSIZE];
5557
} pipeinfo;
5658

57-
pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'};
58-
pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'};
59+
pipeinfo Out = {INVALID_HANDLE_VALUE, ""};
60+
pipeinfo Err = {INVALID_HANDLE_VALUE, ""};
5961

6062
/*
6163
* exitcodes: 0 == no, 1 == yes, 2 == error
@@ -273,7 +275,7 @@ CheckForCompilerFeature(
273275
"Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
274276

275277
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|
276-
FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars],
278+
FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars],
277279
(300-chars), 0);
278280
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL);
279281
return 2;
@@ -326,7 +328,7 @@ CheckForCompilerFeature(
326328

327329
static int
328330
CheckForLinkerFeature(
329-
const char **options,
331+
char **options,
330332
int count)
331333
{
332334
STARTUPINFO si;
@@ -407,7 +409,7 @@ CheckForLinkerFeature(
407409
"Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
408410

409411
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|
410-
FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars],
412+
FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars],
411413
(300-chars), 0);
412414
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL);
413415
return 2;
@@ -503,7 +505,6 @@ GetVersionFromFile(
503505
const char *match,
504506
int numdots)
505507
{
506-
size_t cbBuffer = 100;
507508
static char szBuffer[100];
508509
char *szResult = NULL;
509510
FILE *fp = fopen(filename, "rt");
@@ -513,7 +514,7 @@ GetVersionFromFile(
513514
* Read data until we see our match string.
514515
*/
515516

516-
while (fgets(szBuffer, cbBuffer, fp) != NULL) {
517+
while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) {
517518
LPSTR p, q;
518519

519520
p = strstr(szBuffer, match);
@@ -523,7 +524,7 @@ GetVersionFromFile(
523524
*/
524525

525526
p += strlen(match);
526-
while (*p && !isdigit(*p)) {
527+
while (*p && !isdigit((unsigned char)*p)) {
527528
++p;
528529
}
529530

@@ -532,14 +533,13 @@ GetVersionFromFile(
532533
*/
533534

534535
q = p;
535-
while (*q && (strchr("0123456789.ab", *q)) && ((!strchr(".ab", *q)
536-
&& (!strchr("ab", q[-1])) || --numdots))) {
536+
while (*q && (strchr("0123456789.ab", *q)) && (((!strchr(".ab", *q)
537+
&& !strchr("ab", q[-1])) || --numdots))) {
537538
++q;
538539
}
539540

540-
memcpy(szBuffer, p, q - p);
541-
szBuffer[q-p] = 0;
542-
szResult = szBuffer;
541+
*q = 0;
542+
szResult = p;
543543
break;
544544
}
545545
}
@@ -562,7 +562,7 @@ typedef struct list_item_t {
562562
static list_item_t *
563563
list_insert(list_item_t **listPtrPtr, const char *key, const char *value)
564564
{
565-
list_item_t *itemPtr = malloc(sizeof(list_item_t));
565+
list_item_t *itemPtr = (list_item_t *)malloc(sizeof(list_item_t));
566566
if (itemPtr) {
567567
itemPtr->key = strdup(key);
568568
itemPtr->value = strdup(value);
@@ -611,9 +611,7 @@ SubstituteFile(
611611
const char *substitutions,
612612
const char *filename)
613613
{
614-
size_t cbBuffer = 1024;
615614
static char szBuffer[1024], szCopy[1024];
616-
char *szResult = NULL;
617615
list_item_t *substPtr = NULL;
618616
FILE *fp, *sp;
619617

@@ -626,7 +624,7 @@ SubstituteFile(
626624

627625
sp = fopen(substitutions, "rt");
628626
if (sp != NULL) {
629-
while (fgets(szBuffer, cbBuffer, sp) != NULL) {
627+
while (fgets(szBuffer, sizeof(szBuffer), sp) != NULL) {
630628
unsigned char *ks, *ke, *vs, *ve;
631629
ks = (unsigned char*)szBuffer;
632630
while (ks && *ks && isspace(*ks)) ++ks;
@@ -657,7 +655,7 @@ SubstituteFile(
657655
* Run the substitutions over each line of the input
658656
*/
659657

660-
while (fgets(szBuffer, cbBuffer, fp) != NULL) {
658+
while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) {
661659
list_item_t *p = NULL;
662660
for (p = substPtr; p != NULL; p = p->nextPtr) {
663661
char *m = strstr(szBuffer, p->key);
@@ -674,7 +672,7 @@ SubstituteFile(
674672
memcpy(szBuffer, szCopy, sizeof(szCopy));
675673
}
676674
}
677-
printf(szBuffer);
675+
printf("%s", szBuffer);
678676
}
679677

680678
list_free(&substPtr);
@@ -725,7 +723,8 @@ static int LocateDependencyHelper(const char *dir, const char *keypath)
725723
{
726724
HANDLE hSearch;
727725
char path[MAX_PATH+1];
728-
int dirlen, keylen, ret;
726+
size_t dirlen;
727+
int keylen, ret;
729728
WIN32_FIND_DATA finfo;
730729

731730
if (dir == NULL || keypath == NULL)
@@ -792,7 +791,8 @@ static int LocateDependencyHelper(const char *dir, const char *keypath)
792791
*/
793792
static int LocateDependency(const char *keypath)
794793
{
795-
int i, ret;
794+
size_t i;
795+
int ret;
796796
static const char *paths[] = {"..", "..\\..", "..\\..\\.."};
797797

798798
for (i = 0; i < (sizeof(paths)/sizeof(paths[0])); ++i) {

0 commit comments

Comments
 (0)