diff options
author | drh <drh@noemail.net> | 2011-12-12 19:47:25 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2011-12-12 19:47:25 +0000 |
commit | 663cebfeaed8b365d69246ed5f4d843d53f9be24 (patch) | |
tree | 3db21f983f16ba9f9e6225f87991ad352de80140 | |
parent | 69b2232d6e2cfe4a5d1cd25d48af015ee1faac7b (diff) | |
download | sqlite-663cebfeaed8b365d69246ed5f4d843d53f9be24.tar.gz sqlite-663cebfeaed8b365d69246ed5f4d843d53f9be24.zip |
Make sure the quota logic is usable as C++.
FossilOrigin-Name: f4534bd3023a599691018f35389a76045e49d831
-rw-r--r-- | manifest | 14 | ||||
-rw-r--r-- | manifest.uuid | 2 | ||||
-rw-r--r-- | src/test_quota.c | 11 | ||||
-rw-r--r-- | src/test_quota.h | 8 |
4 files changed, 22 insertions, 13 deletions
@@ -1,5 +1,5 @@ -C Add\sthe\ssqlite3_quota_fflush()\sinterface.\s\sEnhance\ssqlite3_quota_remove()\nso\sthat\sit\scan\sremove\sentire\sdirectories. -D 2011-12-03T00:13:06.592 +C Make\ssure\sthe\squota\slogic\sis\susable\sas\sC++. +D 2011-12-12T19:47:25.223 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5b4a3e12a850b021547e43daf886b25133b44c07 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -220,8 +220,8 @@ F src/test_mutex.c a6bd7b9cf6e19d989e31392b06ac8d189f0d573e F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec F src/test_osinst.c 62b0b8ef21ce754cc94e17bb42377ed8795dba32 F src/test_pcache.c a5cd24730cb43c5b18629043314548c9169abb00 -F src/test_quota.c 2e6191cbfc6ae978330a0d0ffcc3fb81b7059e68 -F src/test_quota.h 9b3c75a79e8c3c6a9d3846b73435bebcd550ba12 +F src/test_quota.c 5259eaa0c98b1f55cbce1f34ed7043ae9538911e +F src/test_quota.h 98cb0cdc4b4c0fa917f7f43734127f6d182e94fa F src/test_rtree.c 6d06306e29946dc36f528a3a2cdc3add794656f1 F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0 F src/test_server.c 2f99eb2837dfa06a4aacf24af24c6affdf66a84f @@ -979,7 +979,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 -P 8cfd3575c8d9f5361c5276d6b83aba47606975a3 -R 28ca02cd727421756b639f8157eb6391 +P abcb65af4cdd192beaccdbc2109ad45b9e7f9d00 +R 219a0e733f4a37c7491a23e5eb8ab5d1 U drh -Z 84dc1ce8a56d57cb5251e17d63b686ff +Z ccc24742bcaed950386a7bec659a920b diff --git a/manifest.uuid b/manifest.uuid index 83ef24af7..ecb5e3b1f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -abcb65af4cdd192beaccdbc2109ad45b9e7f9d00
\ No newline at end of file +f4534bd3023a599691018f35389a76045e49d831
\ No newline at end of file diff --git a/src/test_quota.c b/src/test_quota.c index c073b47d2..3ea3af064 100644 --- a/src/test_quota.c +++ b/src/test_quota.c @@ -905,7 +905,8 @@ int sqlite3_quota_file(const char *zFilename){ int rc; int outFlags = 0; sqlite3_int64 iSize; - fd = sqlite3_malloc(gQuota.sThisVfs.szOsFile + gQuota.sThisVfs.mxPathname+1); + fd = (sqlite3_file*)sqlite3_malloc(gQuota.sThisVfs.szOsFile + + gQuota.sThisVfs.mxPathname+1); if( fd==0 ) return SQLITE_NOMEM; zFull = gQuota.sThisVfs.szOsFile + (char*)fd; rc = gQuota.pOrigVfs->xFullPathname(gQuota.pOrigVfs, zFilename, @@ -943,12 +944,12 @@ quota_FILE *sqlite3_quota_fopen(const char *zFilename, const char *zMode){ quotaGroup *pGroup; quotaFile *pFile; - zFull = sqlite3_malloc(gQuota.sThisVfs.mxPathname + 1); + zFull = (char*)sqlite3_malloc(gQuota.sThisVfs.mxPathname + 1); if( zFull==0 ) return 0; rc = gQuota.pOrigVfs->xFullPathname(gQuota.pOrigVfs, zFilename, gQuota.sThisVfs.mxPathname+1, zFull); if( rc ) goto quota_fopen_error; - p = sqlite3_malloc(sizeof(*p)); + p = (quota_FILE*)sqlite3_malloc(sizeof(*p)); if( p==0 ) goto quota_fopen_error; memset(p, 0, sizeof(*p)); zFullTranslated = quota_utf8_to_mbcs(zFull); @@ -1097,7 +1098,7 @@ int sqlite3_quota_remove(const char *zFilename){ int diff; /* Difference between filenames */ char c; /* First character past end of pattern */ - zFull = sqlite3_malloc(gQuota.sThisVfs.mxPathname + 1); + zFull = (char*)sqlite3_malloc(gQuota.sThisVfs.mxPathname + 1); if( zFull==0 ) return SQLITE_NOMEM; rc = gQuota.pOrigVfs->xFullPathname(gQuota.pOrigVfs, zFilename, gQuota.sThisVfs.mxPathname+1, zFull); @@ -1438,7 +1439,7 @@ static int test_quota_fread( p = sqlite3TestTextToPtr(Tcl_GetString(objv[1])); if( Tcl_GetIntFromObj(interp, objv[2], &sz) ) return TCL_ERROR; if( Tcl_GetIntFromObj(interp, objv[3], &nElem) ) return TCL_ERROR; - zBuf = sqlite3_malloc( sz*nElem + 1 ); + zBuf = (char*)sqlite3_malloc( sz*nElem + 1 ); if( zBuf==0 ){ Tcl_SetResult(interp, "out of memory", TCL_STATIC); return TCL_ERROR; diff --git a/src/test_quota.h b/src/test_quota.h index dbcb2c185..5dab71417 100644 --- a/src/test_quota.h +++ b/src/test_quota.h @@ -30,6 +30,11 @@ #include "sqlite3.h" #include <stdio.h> +/* Make this callable from C++ */ +#ifdef __cplusplus +extern "C" { +#endif + /* ** Initialize the quota VFS shim. Use the VFS named zOrigVfsName ** as the VFS that does the actual work. Use the default if @@ -193,4 +198,7 @@ long sqlite3_quota_ftell(quota_FILE*); */ int sqlite3_quota_remove(const char *zFilename); +#ifdef __cplusplus +} /* end of the 'extern "C"' block */ +#endif #endif /* _QUOTA_H_ */ |