aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/func.c4
-rw-r--r--src/pager.c2
-rw-r--r--src/printf.c4
-rw-r--r--src/vdbe.c5
-rw-r--r--src/vdbeInt.h2
-rw-r--r--src/vdbeaux.c2
-rw-r--r--src/vdbemem.c2
-rw-r--r--src/vdbetrace.c4
8 files changed, 13 insertions, 12 deletions
diff --git a/src/func.c b/src/func.c
index 46c606ac0..951af97b3 100644
--- a/src/func.c
+++ b/src/func.c
@@ -1511,11 +1511,11 @@ static void groupConcatStep(
zSep = ",";
nSep = 1;
}
- sqlite3StrAccumAppend(pAccum, zSep, nSep);
+ if( nSep ) sqlite3StrAccumAppend(pAccum, zSep, nSep);
}
zVal = (char*)sqlite3_value_text(argv[0]);
nVal = sqlite3_value_bytes(argv[0]);
- sqlite3StrAccumAppend(pAccum, zVal, nVal);
+ if( nVal ) sqlite3StrAccumAppend(pAccum, zVal, nVal);
}
}
static void groupConcatFinalize(sqlite3_context *context){
diff --git a/src/pager.c b/src/pager.c
index 8cbb50ce3..443a52326 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -5779,7 +5779,7 @@ int sqlite3PagerWrite(DbPage *pDbPage){
assert( pPager->eState!=PAGER_ERROR );
assert( assert_pager_state(pPager) );
- if( pPager->sectorSize > pPager->pageSize ){
+ if( pPager->sectorSize > (u32)pPager->pageSize ){
Pgno nPageCount; /* Total number of pages in database file */
Pgno pg1; /* First page of the sector pPg is located on. */
int nPage = 0; /* Number of pages starting at pg1 to journal */
diff --git a/src/printf.c b/src/printf.c
index a3c7462d5..9be0fc940 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -637,7 +637,7 @@ void sqlite3VXPrintf(
}
case etTOKEN: {
Token *pToken = va_arg(ap, Token*);
- if( pToken ){
+ if( pToken && pToken->n ){
sqlite3StrAccumAppend(pAccum, (const char*)pToken->z, pToken->n);
}
length = width = 0;
@@ -691,7 +691,7 @@ void sqlite3VXPrintf(
** Append N bytes of text from z to the StrAccum object.
*/
void sqlite3StrAccumAppend(StrAccum *p, const char *z, int N){
- assert( z!=0 || N==0 );
+ assert( z!=0 );
assert( p->zText!=0 || p->nChar==0 || p->accError );
assert( N>=0 );
assert( p->accError==0 || p->nAlloc==0 );
diff --git a/src/vdbe.c b/src/vdbe.c
index 92c3c40fa..336112093 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -2662,7 +2662,7 @@ case OP_MakeRecord: {
do{
serial_type = sqlite3VdbeSerialType(pRec, file_format);
i += putVarint32(&zNewRecord[i], serial_type); /* serial type */
- j += sqlite3VdbeSerialPut(&zNewRecord[j], pRec, serial_type, file_format);
+ j += sqlite3VdbeSerialPut(&zNewRecord[j], pRec, serial_type); /* content */
}while( (++pRec)<=pLast );
assert( i==nHdr );
assert( j==nByte );
@@ -3715,7 +3715,6 @@ case OP_Found: { /* jump, in3 */
if( pOp->opcode!=OP_NoConflict ) sqlite3_found_count++;
#endif
- alreadyExists = 0;
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
assert( pOp->p4type==P4_INT32 );
pC = p->apCsr[pOp->p1];
@@ -3723,6 +3722,7 @@ case OP_Found: { /* jump, in3 */
pIn3 = &aMem[pOp->p3];
assert( pC->pCursor!=0 );
assert( pC->isTable==0 );
+ pFree = 0; /* Not needed. Only used to suppress a compiler warning. */
if( pOp->p4.i>0 ){
r.pKeyInfo = pC->pKeyInfo;
r.nField = (u16)pOp->p4.i;
@@ -5353,7 +5353,6 @@ case OP_FkIfZero: { /* jump */
** an integer.
*/
case OP_MemMax: { /* in2 */
- Mem *pIn1;
VdbeFrame *pFrame;
if( p->pFrame ){
for(pFrame=p->pFrame; pFrame->pParent; pFrame=pFrame->pParent);
diff --git a/src/vdbeInt.h b/src/vdbeInt.h
index e493e5b85..d6d71a395 100644
--- a/src/vdbeInt.h
+++ b/src/vdbeInt.h
@@ -389,7 +389,7 @@ void sqlite3VdbePrintOp(FILE*, int, Op*);
#endif
u32 sqlite3VdbeSerialTypeLen(u32);
u32 sqlite3VdbeSerialType(Mem*, int);
-u32 sqlite3VdbeSerialPut(unsigned char*, Mem*, u32, int);
+u32 sqlite3VdbeSerialPut(unsigned char*, Mem*, u32);
u32 sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
void sqlite3VdbeDeleteAuxData(Vdbe*, int, int);
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index a41b22295..9e1eb581f 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -2835,7 +2835,7 @@ static u64 floatSwap(u64 in){
** of bytes in the zero-filled tail is included in the return value only
** if those bytes were zeroed in buf[].
*/
-u32 sqlite3VdbeSerialPut(u8 *buf, Mem *pMem, u32 serial_type, int file_format){
+u32 sqlite3VdbeSerialPut(u8 *buf, Mem *pMem, u32 serial_type){
u32 len;
/* Integer and Real */
diff --git a/src/vdbemem.c b/src/vdbemem.c
index 1d0feb621..d5901b439 100644
--- a/src/vdbemem.c
+++ b/src/vdbemem.c
@@ -1219,7 +1219,7 @@ static void recordFunc(
}else{
aRet[0] = nSerial+1;
sqlite3PutVarint(&aRet[1], iSerial);
- sqlite3VdbeSerialPut(&aRet[1+nSerial], argv[0], iSerial, file_format);
+ sqlite3VdbeSerialPut(&aRet[1+nSerial], argv[0], iSerial);
sqlite3_result_blob(context, aRet, nRet, SQLITE_TRANSIENT);
sqlite3DbFree(db, aRet);
}
diff --git a/src/vdbetrace.c b/src/vdbetrace.c
index 0a767261f..d79763e9e 100644
--- a/src/vdbetrace.c
+++ b/src/vdbetrace.c
@@ -90,9 +90,11 @@ char *sqlite3VdbeExpandSql(
if( db->nVdbeExec>1 ){
while( *zRawSql ){
const char *zStart = zRawSql;
+ int n;
while( *(zRawSql++)!='\n' && *zRawSql );
sqlite3StrAccumAppend(&out, "-- ", 3);
- sqlite3StrAccumAppend(&out, zStart, (int)(zRawSql-zStart));
+ n = (int)(zRawSql - zStart);
+ if( n ) sqlite3StrAccumAppend(&out, zStart, n);
}
}else{
while( zRawSql[0] ){