mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Fix VC++ compiler warnings.
FossilOrigin-Name: 7b7c8d366c51e89aefc6efc9dcffe3f62c7e1d25
This commit is contained in:
@ -564,7 +564,7 @@ static int sessionTableInfo(
|
|||||||
|
|
||||||
assert( pazCol && pabPK );
|
assert( pazCol && pabPK );
|
||||||
|
|
||||||
nThis = strlen(zThis);
|
nThis = sqlite3Strlen30(zThis);
|
||||||
zPragma = sqlite3_mprintf("PRAGMA '%q'.table_info('%q')", zDb, zThis);
|
zPragma = sqlite3_mprintf("PRAGMA '%q'.table_info('%q')", zDb, zThis);
|
||||||
if( !zPragma ) return SQLITE_NOMEM;
|
if( !zPragma ) return SQLITE_NOMEM;
|
||||||
|
|
||||||
@ -778,8 +778,8 @@ static void xPreUpdate(
|
|||||||
sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
|
sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
|
||||||
){
|
){
|
||||||
sqlite3_session *pSession;
|
sqlite3_session *pSession;
|
||||||
int nDb = strlen(zDb);
|
int nDb = sqlite3Strlen30(zDb);
|
||||||
int nName = strlen(zDb);
|
int nName = sqlite3Strlen30(zName);
|
||||||
|
|
||||||
assert( sqlite3_mutex_held(db->mutex) );
|
assert( sqlite3_mutex_held(db->mutex) );
|
||||||
|
|
||||||
@ -825,7 +825,7 @@ int sqlite3session_create(
|
|||||||
){
|
){
|
||||||
sqlite3_session *pNew; /* Newly allocated session object */
|
sqlite3_session *pNew; /* Newly allocated session object */
|
||||||
sqlite3_session *pOld; /* Session object already attached to db */
|
sqlite3_session *pOld; /* Session object already attached to db */
|
||||||
int nDb = strlen(zDb); /* Length of zDb in bytes */
|
int nDb = sqlite3Strlen30(zDb); /* Length of zDb in bytes */
|
||||||
|
|
||||||
/* Zero the output value in case an error occurs. */
|
/* Zero the output value in case an error occurs. */
|
||||||
*ppSession = 0;
|
*ppSession = 0;
|
||||||
@ -882,7 +882,7 @@ void sqlite3session_delete(sqlite3_session *pSession){
|
|||||||
sqlite3_free(p);
|
sqlite3_free(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sqlite3_free(pTab->azCol);
|
sqlite3_free((char*)pTab->azCol); /* cast works around VC++ bug */
|
||||||
sqlite3_free(pTab->apChange);
|
sqlite3_free(pTab->apChange);
|
||||||
sqlite3_free(pTab);
|
sqlite3_free(pTab);
|
||||||
}
|
}
|
||||||
@ -914,7 +914,7 @@ int sqlite3session_attach(
|
|||||||
|
|
||||||
/* First search for an existing entry. If one is found, this call is
|
/* First search for an existing entry. If one is found, this call is
|
||||||
** a no-op. Return early. */
|
** a no-op. Return early. */
|
||||||
nName = strlen(zName);
|
nName = sqlite3Strlen30(zName);
|
||||||
for(pTab=pSession->pTable; pTab; pTab=pTab->pNext){
|
for(pTab=pSession->pTable; pTab; pTab=pTab->pNext){
|
||||||
if( 0==sqlite3_strnicmp(pTab->zName, zName, nName+1) ) break;
|
if( 0==sqlite3_strnicmp(pTab->zName, zName, nName+1) ) break;
|
||||||
}
|
}
|
||||||
@ -985,7 +985,7 @@ static void sessionAppendByte(SessionBuffer *p, u8 v, int *pRc){
|
|||||||
** If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before
|
** If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before
|
||||||
** returning.
|
** returning.
|
||||||
*/
|
*/
|
||||||
static void sessionAppendVarint(SessionBuffer *p, sqlite3_int64 v, int *pRc){
|
static void sessionAppendVarint(SessionBuffer *p, int v, int *pRc){
|
||||||
if( *pRc==SQLITE_OK && 0==sessionBufferGrow(p, 9, pRc) ){
|
if( *pRc==SQLITE_OK && 0==sessionBufferGrow(p, 9, pRc) ){
|
||||||
p->nBuf += sessionVarintPut(&p->aBuf[p->nBuf], v);
|
p->nBuf += sessionVarintPut(&p->aBuf[p->nBuf], v);
|
||||||
}
|
}
|
||||||
@ -1023,7 +1023,7 @@ static void sessionAppendStr(
|
|||||||
const char *zStr,
|
const char *zStr,
|
||||||
int *pRc
|
int *pRc
|
||||||
){
|
){
|
||||||
int nStr = strlen(zStr);
|
int nStr = sqlite3Strlen30(zStr);
|
||||||
if( *pRc==SQLITE_OK && 0==sessionBufferGrow(p, nStr, pRc) ){
|
if( *pRc==SQLITE_OK && 0==sessionBufferGrow(p, nStr, pRc) ){
|
||||||
memcpy(&p->aBuf[p->nBuf], zStr, nStr);
|
memcpy(&p->aBuf[p->nBuf], zStr, nStr);
|
||||||
p->nBuf += nStr;
|
p->nBuf += nStr;
|
||||||
@ -1062,7 +1062,7 @@ static void sessionAppendIdent(
|
|||||||
const char *zStr, /* String to quote, escape and append */
|
const char *zStr, /* String to quote, escape and append */
|
||||||
int *pRc /* IN/OUT: Error code */
|
int *pRc /* IN/OUT: Error code */
|
||||||
){
|
){
|
||||||
int nStr = strlen(zStr)*2 + 2 + 1;
|
int nStr = sqlite3Strlen30(zStr)*2 + 2 + 1;
|
||||||
if( *pRc==SQLITE_OK && 0==sessionBufferGrow(p, nStr, pRc) ){
|
if( *pRc==SQLITE_OK && 0==sessionBufferGrow(p, nStr, pRc) ){
|
||||||
char *zOut = (char *)&p->aBuf[p->nBuf];
|
char *zOut = (char *)&p->aBuf[p->nBuf];
|
||||||
const char *zIn = zStr;
|
const char *zIn = zStr;
|
||||||
@ -1072,7 +1072,7 @@ static void sessionAppendIdent(
|
|||||||
*zOut++ = *(zIn++);
|
*zOut++ = *(zIn++);
|
||||||
}
|
}
|
||||||
*zOut++ = '"';
|
*zOut++ = '"';
|
||||||
p->nBuf = ((u8 *)zOut - p->aBuf);
|
p->nBuf = (int)((u8 *)zOut - p->aBuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1372,7 +1372,7 @@ int sqlite3session_changeset(
|
|||||||
sessionAppendByte(&buf, 'T', &rc);
|
sessionAppendByte(&buf, 'T', &rc);
|
||||||
sessionAppendVarint(&buf, nCol, &rc);
|
sessionAppendVarint(&buf, nCol, &rc);
|
||||||
sessionAppendBlob(&buf, pTab->abPK, nCol, &rc);
|
sessionAppendBlob(&buf, pTab->abPK, nCol, &rc);
|
||||||
sessionAppendBlob(&buf, (u8 *)zName, strlen(zName)+1, &rc);
|
sessionAppendBlob(&buf, (u8 *)zName, sqlite3Strlen30(zName)+1, &rc);
|
||||||
|
|
||||||
/* Build and compile a statement to execute: */
|
/* Build and compile a statement to execute: */
|
||||||
if( rc==SQLITE_OK ){
|
if( rc==SQLITE_OK ){
|
||||||
@ -1413,7 +1413,7 @@ int sqlite3session_changeset(
|
|||||||
if( buf.nBuf==nNoop ){
|
if( buf.nBuf==nNoop ){
|
||||||
buf.nBuf = nRewind;
|
buf.nBuf = nRewind;
|
||||||
}
|
}
|
||||||
sqlite3_free(azCol);
|
sqlite3_free((char*)azCol); /* cast works around VC++ bug */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1589,7 +1589,7 @@ int sqlite3changeset_next(sqlite3_changeset_iter *p){
|
|||||||
p->abPK = (u8 *)aChange;
|
p->abPK = (u8 *)aChange;
|
||||||
aChange += p->nCol;
|
aChange += p->nCol;
|
||||||
p->zTab = (char *)aChange;
|
p->zTab = (char *)aChange;
|
||||||
aChange += (strlen((char *)aChange) + 1);
|
aChange += (sqlite3Strlen30((char *)aChange) + 1);
|
||||||
p->op = *(aChange++);
|
p->op = *(aChange++);
|
||||||
p->bIndirect = *(aChange++);
|
p->bIndirect = *(aChange++);
|
||||||
sqlite3_free(p->apValue);
|
sqlite3_free(p->apValue);
|
||||||
@ -1796,7 +1796,7 @@ int sqlite3changeset_invert(
|
|||||||
*/
|
*/
|
||||||
int nByte = 1 + sessionVarintGet(&aIn[i+1], &nCol);
|
int nByte = 1 + sessionVarintGet(&aIn[i+1], &nCol);
|
||||||
nByte += nCol;
|
nByte += nCol;
|
||||||
nByte += 1 + strlen((char *)&aIn[i+nByte]);
|
nByte += 1 + sqlite3Strlen30((char *)&aIn[i+nByte]);
|
||||||
memcpy(&aOut[i], &aIn[i], nByte);
|
memcpy(&aOut[i], &aIn[i], nByte);
|
||||||
i += nByte;
|
i += nByte;
|
||||||
break;
|
break;
|
||||||
@ -1810,7 +1810,7 @@ int sqlite3changeset_invert(
|
|||||||
sessionReadRecord(&aEnd, nCol, 0);
|
sessionReadRecord(&aEnd, nCol, 0);
|
||||||
aOut[i] = (eType==SQLITE_DELETE ? SQLITE_INSERT : SQLITE_DELETE);
|
aOut[i] = (eType==SQLITE_DELETE ? SQLITE_INSERT : SQLITE_DELETE);
|
||||||
aOut[i+1] = aIn[i+1];
|
aOut[i+1] = aIn[i+1];
|
||||||
nByte = aEnd - &aIn[i+2];
|
nByte = (int)(aEnd - &aIn[i+2]);
|
||||||
memcpy(&aOut[i+2], &aIn[i+2], nByte);
|
memcpy(&aOut[i+2], &aIn[i+2], nByte);
|
||||||
i += 2 + nByte;
|
i += 2 + nByte;
|
||||||
break;
|
break;
|
||||||
@ -1822,9 +1822,9 @@ int sqlite3changeset_invert(
|
|||||||
u8 *aEnd = &aIn[i+2];
|
u8 *aEnd = &aIn[i+2];
|
||||||
|
|
||||||
sessionReadRecord(&aEnd, nCol, 0);
|
sessionReadRecord(&aEnd, nCol, 0);
|
||||||
nByte1 = aEnd - &aIn[i+2];
|
nByte1 = (int)(aEnd - &aIn[i+2]);
|
||||||
sessionReadRecord(&aEnd, nCol, 0);
|
sessionReadRecord(&aEnd, nCol, 0);
|
||||||
nByte2 = aEnd - &aIn[i+2] - nByte1;
|
nByte2 = (int)(aEnd - &aIn[i+2]) - nByte1;
|
||||||
|
|
||||||
aOut[i] = SQLITE_UPDATE;
|
aOut[i] = SQLITE_UPDATE;
|
||||||
aOut[i+1] = aIn[i+1];
|
aOut[i+1] = aIn[i+1];
|
||||||
@ -2416,7 +2416,7 @@ int sqlite3changeset_apply(
|
|||||||
sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
|
sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
|
||||||
int rc; /* Return code */
|
int rc; /* Return code */
|
||||||
const char *zTab = 0; /* Name of current table */
|
const char *zTab = 0; /* Name of current table */
|
||||||
int nTab = 0; /* Result of strlen(zTab) */
|
int nTab = 0; /* Result of sqlite3Strlen30(zTab) */
|
||||||
SessionApplyCtx sApply; /* changeset_apply() context object */
|
SessionApplyCtx sApply; /* changeset_apply() context object */
|
||||||
|
|
||||||
memset(&sApply, 0, sizeof(sApply));
|
memset(&sApply, 0, sizeof(sApply));
|
||||||
@ -2438,7 +2438,7 @@ int sqlite3changeset_apply(
|
|||||||
u8 *abPK;
|
u8 *abPK;
|
||||||
|
|
||||||
schemaMismatch = 0;
|
schemaMismatch = 0;
|
||||||
sqlite3_free(sApply.azCol);
|
sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */
|
||||||
sqlite3_finalize(sApply.pDelete);
|
sqlite3_finalize(sApply.pDelete);
|
||||||
sqlite3_finalize(sApply.pUpdate);
|
sqlite3_finalize(sApply.pUpdate);
|
||||||
sqlite3_finalize(sApply.pInsert);
|
sqlite3_finalize(sApply.pInsert);
|
||||||
@ -2479,7 +2479,7 @@ int sqlite3changeset_apply(
|
|||||||
){
|
){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
nTab = strlen(zTab);
|
nTab = sqlite3Strlen30(zTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If there is a schema mismatch on the current table, proceed to the
|
/* If there is a schema mismatch on the current table, proceed to the
|
||||||
@ -2530,7 +2530,7 @@ int sqlite3changeset_apply(
|
|||||||
sqlite3_finalize(sApply.pDelete);
|
sqlite3_finalize(sApply.pDelete);
|
||||||
sqlite3_finalize(sApply.pUpdate);
|
sqlite3_finalize(sApply.pUpdate);
|
||||||
sqlite3_finalize(sApply.pSelect);
|
sqlite3_finalize(sApply.pSelect);
|
||||||
sqlite3_free(sApply.azCol);
|
sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */
|
||||||
sqlite3_mutex_leave(sqlite3_db_mutex(db));
|
sqlite3_mutex_leave(sqlite3_db_mutex(db));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
|||||||
C Merge\sin\sthe\slatest\schanges\sfrom\sthe\strunk.
|
C Fix\sVC++\scompiler\swarnings.
|
||||||
D 2011-04-06T22:33:50.737
|
D 2011-04-06T23:39:28.224
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in 7a4d9524721d40ef9ee26f93f9bd6a51dba106f2
|
F Makefile.in 7a4d9524721d40ef9ee26f93f9bd6a51dba106f2
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@ -105,7 +105,7 @@ F ext/session/session3.test bfa2376db7cbb2ac69496f84d93a8d81b13110d3
|
|||||||
F ext/session/session4.test a6ed685da7a5293c5d6f99855bcf41dbc352ca84
|
F ext/session/session4.test a6ed685da7a5293c5d6f99855bcf41dbc352ca84
|
||||||
F ext/session/session_common.tcl fb91560b6dbd086010df8b3a137a452f1ac21a28
|
F ext/session/session_common.tcl fb91560b6dbd086010df8b3a137a452f1ac21a28
|
||||||
F ext/session/sessionfault.test 2544a2e2ecad56e3c07a32c09799871d243c114c
|
F ext/session/sessionfault.test 2544a2e2ecad56e3c07a32c09799871d243c114c
|
||||||
F ext/session/sqlite3session.c 2b2936b5188776b33bba1263f93267f3ec9d0d84
|
F ext/session/sqlite3session.c bc6fc77d70d4d9994598b1daf0a43d48965b2155
|
||||||
F ext/session/sqlite3session.h f284bac51c12de0e0096fc986e61f5ae6b9e5be5
|
F ext/session/sqlite3session.h f284bac51c12de0e0096fc986e61f5ae6b9e5be5
|
||||||
F ext/session/test_session.c 82e3fd7d94f485ea63bcfb15d636c95a01db97a9
|
F ext/session/test_session.c 82e3fd7d94f485ea63bcfb15d636c95a01db97a9
|
||||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||||
@ -251,7 +251,7 @@ F src/vdbeapi.c 8051038f7674c708f4515ab189fc3ea929e09a4c
|
|||||||
F src/vdbeaux.c b0a2a184a25380f7eb9d07e9336034ec38d1b213
|
F src/vdbeaux.c b0a2a184a25380f7eb9d07e9336034ec38d1b213
|
||||||
F src/vdbeblob.c c3ccb7c8732858c680f442932e66ad06bb036562
|
F src/vdbeblob.c c3ccb7c8732858c680f442932e66ad06bb036562
|
||||||
F src/vdbemem.c 0498796b6ffbe45e32960d6a1f5adfb6e419883b
|
F src/vdbemem.c 0498796b6ffbe45e32960d6a1f5adfb6e419883b
|
||||||
F src/vdbetrace.c 3ba13bc32bdf16d2bdea523245fd16736bed67b5
|
F src/vdbetrace.c 5d0dc3d5fd54878cc8d6d28eb41deb8d5885b114
|
||||||
F src/vtab.c b0abc931f95af94c9ffdf9f747eb191cda953123
|
F src/vtab.c b0abc931f95af94c9ffdf9f747eb191cda953123
|
||||||
F src/wal.c 7334009b396285b658a95a3b6bc6d2b016a1f794
|
F src/wal.c 7334009b396285b658a95a3b6bc6d2b016a1f794
|
||||||
F src/wal.h 7a5fbb00114b7f2cd40c7e1003d4c41ce9d26840
|
F src/wal.h 7a5fbb00114b7f2cd40c7e1003d4c41ce9d26840
|
||||||
@ -937,7 +937,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
|||||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||||
F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
|
F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
|
||||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||||
P 45f20261720dcd73eb887f7e3df100723000418b 614de91a504d2231009a9de1305e31fce1b1c5a6
|
P 435b57dc2be7b071270a6cddece297758b8153aa
|
||||||
R 502dde3bb5feee985b14f915e41e9858
|
R 430b240dcc83276815f3990defb9cdf0
|
||||||
U drh
|
U drh
|
||||||
Z 9b010756d90228476ef26682d9d1164b
|
Z 063f7a6f50976dabf014f8516d936514
|
||||||
|
@ -1 +1 @@
|
|||||||
435b57dc2be7b071270a6cddece297758b8153aa
|
7b7c8d366c51e89aefc6efc9dcffe3f62c7e1d25
|
@ -85,7 +85,7 @@ char *sqlite3VdbeExpandSql(
|
|||||||
const char *zStart = zRawSql;
|
const char *zStart = zRawSql;
|
||||||
while( *(zRawSql++)!='\n' && *zRawSql );
|
while( *(zRawSql++)!='\n' && *zRawSql );
|
||||||
sqlite3StrAccumAppend(&out, "-- ", 3);
|
sqlite3StrAccumAppend(&out, "-- ", 3);
|
||||||
sqlite3StrAccumAppend(&out, zStart, zRawSql-zStart);
|
sqlite3StrAccumAppend(&out, zStart, (int)(zRawSql-zStart));
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
while( zRawSql[0] ){
|
while( zRawSql[0] ){
|
||||||
|
Reference in New Issue
Block a user