Remove unused routines from vdbeaux.c. Improve test coverage. (CVS 1746)
FossilOrigin-Name: 792b3c75e7764bab1473c0d6efc76f1164c943bf
This commit is contained in:
+1
-5
@@ -15,7 +15,7 @@
|
||||
** or VDBE. The VDBE implements an abstract machine that runs a
|
||||
** simple program to access and modify the underlying database.
|
||||
**
|
||||
** $Id: vdbe.h,v 1.88 2004/06/21 08:18:59 danielk1977 Exp $
|
||||
** $Id: vdbe.h,v 1.89 2004/06/27 21:31:40 drh Exp $
|
||||
*/
|
||||
#ifndef _SQLITE_VDBE_H_
|
||||
#define _SQLITE_VDBE_H_
|
||||
@@ -39,9 +39,6 @@ struct VdbeOp {
|
||||
int p2; /* Second parameter (often the jump destination) */
|
||||
char *p3; /* Third parameter */
|
||||
int p3type; /* P3_STATIC, P3_DYNAMIC or P3_POINTER */
|
||||
#ifndef NDEBUG
|
||||
char *zComment; /* Comments explaining what this opcode does */
|
||||
#endif
|
||||
#ifdef VDBE_PROFILE
|
||||
int cnt; /* Number of times this instruction was executed */
|
||||
long long cycles; /* Total time spend executing this instruction */
|
||||
@@ -118,7 +115,6 @@ int sqlite3VdbeFinalize(Vdbe*);
|
||||
void sqlite3VdbeResolveLabel(Vdbe*, int);
|
||||
int sqlite3VdbeCurrentAddr(Vdbe*);
|
||||
void sqlite3VdbeTrace(Vdbe*,FILE*);
|
||||
void sqlite3VdbeCompressSpace(Vdbe*,int);
|
||||
int sqlite3VdbeReset(Vdbe*);
|
||||
int sqliteVdbeSetVariables(Vdbe*,int,const char**);
|
||||
void sqlite3VdbeSetNumCols(Vdbe*,int);
|
||||
|
||||
@@ -100,7 +100,6 @@ int sqlite3VdbeAddOp(Vdbe *p, int op, int p1, int p2){
|
||||
pOp->p3 = 0;
|
||||
pOp->p3type = P3_NOTUSED;
|
||||
#ifndef NDEBUG
|
||||
pOp->zComment = 0;
|
||||
if( sqlite3_vdbe_addop_trace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]);
|
||||
#endif
|
||||
return i;
|
||||
@@ -209,7 +208,6 @@ int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){
|
||||
pOut->p3 = pIn->p3;
|
||||
pOut->p3type = pIn->p3 ? P3_STATIC : P3_NOTUSED;
|
||||
#ifndef NDEBUG
|
||||
pOut->zComment = 0;
|
||||
if( sqlite3_vdbe_addop_trace ){
|
||||
sqlite3VdbePrintOp(0, i+addr, &p->aOp[i+addr]);
|
||||
}
|
||||
@@ -333,56 +331,6 @@ void sqlite3VdbeDequoteP3(Vdbe *p, int addr){
|
||||
sqlite3Dequote(pOp->p3);
|
||||
}
|
||||
|
||||
/*
|
||||
** On the P3 argument of the given instruction, change all
|
||||
** strings of whitespace characters into a single space and
|
||||
** delete leading and trailing whitespace.
|
||||
*/
|
||||
void sqlite3VdbeCompressSpace(Vdbe *p, int addr){
|
||||
unsigned char *z;
|
||||
int i, j;
|
||||
Op *pOp;
|
||||
assert( p->magic==VDBE_MAGIC_INIT );
|
||||
if( p->aOp==0 || addr<0 || addr>=p->nOp ) return;
|
||||
pOp = &p->aOp[addr];
|
||||
if( pOp->p3type==P3_STATIC ){
|
||||
pOp->p3 = sqliteStrDup(pOp->p3);
|
||||
pOp->p3type = P3_DYNAMIC;
|
||||
}
|
||||
assert( pOp->p3type==P3_DYNAMIC );
|
||||
z = (unsigned char*)pOp->p3;
|
||||
if( z==0 ) return;
|
||||
i = j = 0;
|
||||
while( isspace(z[i]) ){ i++; }
|
||||
while( z[i] ){
|
||||
if( isspace(z[i]) ){
|
||||
z[j++] = ' ';
|
||||
while( isspace(z[++i]) ){}
|
||||
}else{
|
||||
z[j++] = z[i++];
|
||||
}
|
||||
}
|
||||
while( j>0 && isspace(z[j-1]) ){ j--; }
|
||||
z[j] = 0;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
/*
|
||||
** Add comment text to the most recently inserted opcode
|
||||
*/
|
||||
void sqlite3VdbeAddComment(Vdbe *p, const char *zFormat, ...){
|
||||
va_list ap;
|
||||
VdbeOp *pOp;
|
||||
char *zText;
|
||||
va_start(ap, zFormat);
|
||||
zText = sqlite3_vmprintf(zFormat, ap);
|
||||
va_end(ap);
|
||||
pOp = &p->aOp[p->nOp-1];
|
||||
sqliteFree(pOp->zComment);
|
||||
pOp->zComment = zText;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Search the current program starting at instruction addr for the given
|
||||
** opcode and P2 value. Return the address plus 1 if found and 0 if not
|
||||
@@ -488,13 +436,8 @@ void sqlite3VdbePrintOp(FILE *pOut, int pc, Op *pOp){
|
||||
static const char *zFormat2 = "%4d %-13s %4d %4d %-20s -- %s\n";
|
||||
if( pOut==0 ) pOut = stdout;
|
||||
zP3 = displayP3(pOp, zPtr, sizeof(zPtr));
|
||||
#ifdef NDEBUG
|
||||
fprintf(pOut, zFormat1,
|
||||
pc, sqlite3OpcodeNames[pOp->opcode], pOp->p1, pOp->p2, zP3);
|
||||
#else
|
||||
fprintf(pOut, pOp->zComment ? zFormat2 : zFormat1,
|
||||
pc, sqlite3OpcodeNames[pOp->opcode], pOp->p1, pOp->p2, zP3,pOp->zComment);
|
||||
#endif
|
||||
fflush(pOut);
|
||||
}
|
||||
#endif
|
||||
@@ -1377,9 +1320,6 @@ void sqlite3VdbeDelete(Vdbe *p){
|
||||
sqlite3VdbeDeleteAuxData(pVdbeFunc, 0);
|
||||
sqliteFree(pVdbeFunc);
|
||||
}
|
||||
#ifndef NDEBUG
|
||||
sqliteFree(pOp->zComment);
|
||||
#endif
|
||||
}
|
||||
for(i=0; i<p->nVar; i++){
|
||||
sqlite3VdbeMemRelease(&p->apVar[i]);
|
||||
|
||||
Reference in New Issue
Block a user