Variable name and comment changes to test_quota.c for clearer presentation.

FossilOrigin-Name: 38ed1992c800cb1d1ca67977d704df73d97c78d7
This commit is contained in:
drh
2010-09-01 14:58:10 +00:00
parent 61cc423aa3
commit 75c1917423
3 changed files with 30 additions and 30 deletions
+9 -9
View File
@@ -1,8 +1,8 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
C Make\sall\sprivate\sroutines\sin\stest_quota.c\sbegin\swith\s"quota".\nFix\sa\stest_quota.c\ssegfault\swhen\ssetting\sa\szero-quota.
D 2010-09-01T14:45:16
C Variable\sname\sand\scomment\schanges\sto\stest_quota.c\sfor\sclearer\spresentation.
D 2010-09-01T14:58:11
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in c599a15d268b1db2aeadea19df2adc3bf2eb6bee
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -211,7 +211,7 @@ F src/test_mutex.c ce06b59aca168cd8c520b77159a24352a7469bd3
F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec
F src/test_osinst.c f408c6a181f2fb04c56273afd5c3e1e82f60392c
F src/test_pcache.c 7bf828972ac0d2403f5cfa4cd14da41f8ebe73d8
F src/test_quota.c 8c28bb3f66a8bc90a458f16876ebaa89e4bbad3e
F src/test_quota.c 303e68971829ed6c7058f982e7361b967344abda
F src/test_rtree.c e957a603a98871dcf005c1e96ae791cfe74eb7f6
F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0
F src/test_server.c bbba05c144b5fc4b52ff650a4328027b3fa5fcc6
@@ -856,14 +856,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 7a624b5ae2abff21bcbbb34af88d1c7656f3b729
R 4041710572588b49cf8e3c314659cdde
P c0d0fc3a1cca7ee28db8add745c71baf0545776c
R 5150c60917fb33e6d6c75a2627b04e72
U drh
Z c4eac6ed50191a086b6db4a1d87dd5c9
Z 293ea454d360072e187630189bf4cbd5
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFMfmb+oxKgR168RlERAualAJ4oGP4giCs27HA69gTkp0EaPArqVwCdEPwb
lAxAbOSJt/sYZvU7C3FlLw0=
=nKqo
iD8DBQFMfmoGoxKgR168RlERAo+aAJ9FtwNxBNFRgcjszaS9G+1zDHJu5ACeLSkW
b7HAKmHRdtJZIZFAnlXrRmk=
=zaPS
-----END PGP SIGNATURE-----
+1 -1
View File
@@ -1 +1 @@
c0d0fc3a1cca7ee28db8add745c71baf0545776c
38ed1992c800cb1d1ca67977d704df73d97c78d7
+20 -20
View File
@@ -65,7 +65,7 @@ struct quotaGroup {
void *pArg; /* Third argument to the xCallback() */
void (*xDestroy)(void*); /* Optional destructor for pArg */
quotaGroup *pNext, **ppPrev; /* Doubly linked list of all quota objects */
quotaFile *pFile; /* Files within this group */
quotaFile *pFiles; /* Files within this group */
};
/*
@@ -78,7 +78,7 @@ struct quotaGroup {
*/
struct quotaFile {
char *zFilename; /* Name of this file */
quotaGroup *pGroup; /* Upper bound on file size */
quotaGroup *pGroup; /* Quota group to which this file belongs */
sqlite3_int64 iSize; /* Current size of this file */
int nRef; /* Number of times this file is open */
quotaFile *pNext, **ppPrev; /* Linked list of files in the same group */
@@ -154,12 +154,12 @@ static void quotaLeave(void){ sqlite3_mutex_leave(gQuota.pMutex); }
/* If the reference count and threshold for a quotaGroup are both
** zero, then destroy the quotaGroup.
*/
static void quotaGroupDeref(quotaGroup *p){
if( p->pFile==0 && p->iLimit==0 ){
if( p->pNext ) p->pNext->ppPrev = p->ppPrev;
if( p->ppPrev ) *p->ppPrev = p->pNext;
if( p->xDestroy ) p->xDestroy(p->pArg);
sqlite3_free(p);
static void quotaGroupDeref(quotaGroup *pGroup){
if( pGroup->pFiles==0 && pGroup->iLimit==0 ){
if( pGroup->pNext ) pGroup->pNext->ppPrev = pGroup->ppPrev;
if( pGroup->ppPrev ) *pGroup->ppPrev = pGroup->pNext;
if( pGroup->xDestroy ) pGroup->xDestroy(pGroup->pArg);
sqlite3_free(pGroup);
}
}
@@ -305,7 +305,7 @@ static int quotaOpen(
pSubOpen = quotaSubOpen(pConn);
rc = pOrigVfs->xOpen(pOrigVfs, zName, pSubOpen, flags, pOutFlags);
if( rc==SQLITE_OK ){
for(pFile=pGroup->pFile; pFile && strcmp(pFile->zFilename, zName);
for(pFile=pGroup->pFiles; pFile && strcmp(pFile->zFilename, zName);
pFile=pFile->pNext){}
if( pFile==0 ){
int nName = strlen(zName);
@@ -318,10 +318,10 @@ static int quotaOpen(
memset(pFile, 0, sizeof(*pFile));
pFile->zFilename = (char*)&pFile[1];
memcpy(pFile->zFilename, zName, nName+1);
pFile->pNext = pGroup->pFile;
if( pGroup->pFile ) pGroup->pFile->ppPrev = &pFile->pNext;
pFile->ppPrev = &pGroup->pFile;
pGroup->pFile = pFile;
pFile->pNext = pGroup->pFiles;
if( pGroup->pFiles ) pGroup->pFiles->ppPrev = &pFile->pNext;
pFile->ppPrev = &pGroup->pFiles;
pGroup->pFiles = pFile;
pFile->pGroup = pGroup;
}
pFile->nRef++;
@@ -607,15 +607,15 @@ int sqlite3_quota_initialize(const char *zOrigVfsName, int makeDefault){
** shutting down in order to free all remaining quota groups.
*/
int sqlite3_quota_shutdown(void){
quotaGroup *p;
quotaGroup *pGroup;
if( gQuota.isInitialized==0 ) return SQLITE_MISUSE;
for(p=gQuota.pGroup; p; p=p->pNext){
if( p->pFile ) return SQLITE_MISUSE;
for(pGroup=gQuota.pGroup; pGroup; pGroup=pGroup->pNext){
if( pGroup->pFiles ) return SQLITE_MISUSE;
}
while( gQuota.pGroup ){
quotaGroup *p = gQuota.pGroup;
gQuota.pGroup = p->pNext;
sqlite3_free(p);
pGroup = gQuota.pGroup;
gQuota.pGroup = pGroup->pNext;
sqlite3_free(pGroup);
}
gQuota.isInitialized = 0;
sqlite3_mutex_free(gQuota.pMutex);
@@ -883,7 +883,7 @@ static int test_quota_dump(
Tcl_NewWideIntObj(pGroup->iLimit));
Tcl_ListObjAppendElement(interp, pGroupTerm,
Tcl_NewWideIntObj(pGroup->iSize));
for(pFile=pGroup->pFile; pFile; pFile=pFile->pNext){
for(pFile=pGroup->pFiles; pFile; pFile=pFile->pNext){
pFileTerm = Tcl_NewObj();
Tcl_ListObjAppendElement(interp, pFileTerm,
Tcl_NewStringObj(pFile->zFilename, -1));