1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix a few minor and harmless clang warnings in FTS3 and RTREE.

FossilOrigin-Name: b3324f6cc27c3bfb32b12eacace2fc731c2dd644
This commit is contained in:
drh
2011-10-14 22:57:03 +00:00
parent b07028f71c
commit 086e4913b5
5 changed files with 27 additions and 17 deletions

View File

@ -438,7 +438,7 @@ static void fts3GetReverseVarint(
sqlite3_int64 *pVal
){
sqlite3_int64 iVal;
char *p = *pp;
char *p;
/* Pointer p now points at the first byte past the varint we are
** interested in. So, unless the doclist is corrupt, the 0x80 bit is
@ -839,7 +839,7 @@ static char *fts3WriteExprList(Fts3Table *p, const char *zFunc, int *pRc){
** This function is used when parsing the "prefix=" FTS4 parameter.
*/
static int fts3GobbleInt(const char **pp, int *pnOut){
const char *p = *pp; /* Iterator pointer */
const char *p; /* Iterator pointer */
int nInt = 0; /* Output value */
for(p=*pp; p[0]>='0' && p[0]<='9'; p++){
@ -1429,6 +1429,7 @@ static int fts3ScanInteriorNode(
}
zBuffer = zNew;
}
assert( zBuffer );
memcpy(&zBuffer[nPrefix], zCsr, nSuffix);
nBuffer = nPrefix + nSuffix;
zCsr += nSuffix;
@ -2865,7 +2866,7 @@ static int fts3RollbackMethod(sqlite3_vtab *pVtab){
*/
static void fts3ReversePoslist(char *pStart, char **ppPoslist){
char *p = &(*ppPoslist)[-2];
char c;
char c = 0;
while( p>pStart && (c=*p--)==0 );
while( p>pStart && (*p & 0x80) | c ){
@ -4335,7 +4336,9 @@ static int fts3EvalNearTest(Fts3Expr *pExpr, int *pRc){
aPoslist = pExpr->pRight->pPhrase->doclist.pList;
nToken = pExpr->pRight->pPhrase->nToken;
for(p=pExpr->pLeft; p && res; p=p->pLeft){
int nNear = p->pParent->nNear;
int nNear;
assert( p->pParent && p->pParent->pLeft==p );
nNear = p->pParent->nNear;
Fts3Phrase *pPhrase = (
p->eType==FTSQUERY_NEAR ? p->pRight->pPhrase : p->pPhrase
);

View File

@ -302,8 +302,12 @@ static int getNextString(
p->pPhrase->nToken = nToken;
zBuf = (char *)&p->pPhrase->aToken[nToken];
memcpy(zBuf, zTemp, nTemp);
sqlite3_free(zTemp);
if( zTemp ){
memcpy(zBuf, zTemp, nTemp);
sqlite3_free(zTemp);
}else{
assert( nTemp==0 );
}
for(jj=0; jj<p->pPhrase->nToken; jj++){
p->pPhrase->aToken[jj].z = zBuf;

View File

@ -1268,7 +1268,8 @@ static int rtreeFilter(
rc = SQLITE_NOMEM;
}else{
memset(pCsr->aConstraint, 0, sizeof(RtreeConstraint)*argc);
assert( (idxStr==0 && argc==0) || (int)strlen(idxStr)==argc*2 );
assert( (idxStr==0 && argc==0)
|| (idxStr && (int)strlen(idxStr)==argc*2) );
for(ii=0; ii<argc; ii++){
RtreeConstraint *p = &pCsr->aConstraint[ii];
p->op = idxStr[ii*2];
@ -1569,7 +1570,9 @@ static int ChooseLeaf(
float fMinGrowth = 0.0;
float fMinArea = 0.0;
#if VARIANT_RSTARTREE_CHOOSESUBTREE
float fMinOverlap = 0.0;
#endif
int nCell = NCELL(pNode);
RtreeCell cell;
@ -1616,6 +1619,7 @@ static int ChooseLeaf(
|| (overlap==fMinOverlap && growth==fMinGrowth && area<fMinArea)
){
bBest = 1;
fMinOverlap = overlap;
}
#else
if( iCell==0||growth<fMinGrowth||(growth==fMinGrowth && area<fMinArea) ){
@ -1623,7 +1627,6 @@ static int ChooseLeaf(
}
#endif
if( bBest ){
fMinOverlap = overlap;
fMinGrowth = growth;
fMinArea = area;
iBest = cell.iRowid;

View File

@ -1,5 +1,5 @@
C Add\sassert()\sstatements\sand\seliminate\sneedless\svariable\sassignments\sin\sorder\nto\sget\sthe\sclang\sscan-build\sutility\sto\sreport\szero\sproblems\sagainst\sthe\nSQLite\score.\s\sClang's\sstatic\sanalysis\sdid\sfind\sone\sreal\sproblem\s-\sbut\sit\swas\nin\sthe\scommand-line\sshell,\snot\sin\sthe\sSQLite\score.
D 2011-10-14T21:49:18.517
C Fix\sa\sfew\sminor\sand\sharmless\sclang\swarnings\sin\sFTS3\sand\sRTREE.
D 2011-10-14T22:57:03.219
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in a162fe39e249b8ed4a65ee947c30152786cfe897
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -62,11 +62,11 @@ F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
F ext/fts3/fts3.c 0ace6b45d62338b35f095c7e7d1851965e477e4e
F ext/fts3/fts3.c 9dd7e3edfe0cadda09fa4ac702f2e1f43eeed232
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
F ext/fts3/fts3Int.h 59c5a9475fed5d76c70a4763103b3c8e60424a68
F ext/fts3/fts3_aux.c 0ebfa7b86cf8ff6a0861605fcc63b83ec1b70691
F ext/fts3/fts3_expr.c 23791de01b3a5d313d76e02befd2601d4096bc2b
F ext/fts3/fts3_expr.c 61ceee7c9698c7ae1ba55ab6ff7961456a8b465a
F ext/fts3/fts3_hash.c 8dd2d06b66c72c628c2732555a32bc0943114914
F ext/fts3/fts3_hash.h 8331fb2206c609f9fc4c4735b9ab5ad6137c88ec
F ext/fts3/fts3_icu.c 6c8f395cdf9e1e3afa7fadb7e523dbbf381c6dfa
@ -84,7 +84,7 @@ F ext/icu/README.txt bf8461d8cdc6b8f514c080e4e10dc3b2bbdfefa9
F ext/icu/icu.c eb9ae1d79046bd7871aa97ee6da51eb770134b5a
F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
F ext/rtree/rtree.c b431c54d1ed05f04f2987e8a4fbb931acb40c312
F ext/rtree/rtree.c 1ac5f6dc216374d9534806aa0be326ab88166c95
F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e
F ext/rtree/rtree1.test 28e1b8da4da98093ce3210187434dd760a8d89d8
F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba
@ -969,7 +969,7 @@ F tool/symbols.sh fec58532668296d7c7dc48be9c87f75ccdb5814f
F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
P 19536a382815c2ff4cb23625984b4ca92e5e17ee
R 58341c3af5b5e017b2de4c1d1c18c025
P 60fee9574b0125705787e33c16f116cf188c8323
R 1a4c08a3338b0b158cd0a6ed96050fd2
U drh
Z df8323ed17eddd9599c36e3ee7e4fb6f
Z 24b0cbc69060cf779c3e05cfda4702af

View File

@ -1 +1 @@
60fee9574b0125705787e33c16f116cf188c8323
b3324f6cc27c3bfb32b12eacace2fc731c2dd644