]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Make sure the quota logic is usable as C++.
authordrh <drh@noemail.net>
Mon, 12 Dec 2011 19:47:25 +0000 (19:47 +0000)
committerdrh <drh@noemail.net>
Mon, 12 Dec 2011 19:47:25 +0000 (19:47 +0000)
FossilOrigin-Name: f4534bd3023a599691018f35389a76045e49d831

manifest
manifest.uuid
src/test_quota.c
src/test_quota.h

index e49d82bcc03753139da4bd2f43618ca0c32cfd98..af26387f87a172fbe60d173d8089f513836c22ca 100644 (file)
--- a/manifest
+++ b/manifest
@@ -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
index 83ef24af724567444e3f5fdae5a67d0582b69d9c..ecb5e3b1f6bc307636dd20c02f8cf436bd861b35 100644 (file)
@@ -1 +1 @@
-abcb65af4cdd192beaccdbc2109ad45b9e7f9d00
\ No newline at end of file
+f4534bd3023a599691018f35389a76045e49d831
\ No newline at end of file
index c073b47d28548291651e6a5c1a3bbf1fc25b0994..3ea3af0643108de2803383cfc1f7b462e3ac7ae2 100644 (file)
@@ -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;
index dbcb2c185c5737c8e4fabe586f7a94546c9aad08..5dab714176ceaa769ce3d68354ffe3f6aacea6f7 100644 (file)
 #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_ */