Change the name of variable "near" to "nearby" since MSVC mistakenly belieaves

that "near" is a keyword. (CVS 685)

FossilOrigin-Name: 9761a2a0fbfd3e98f719a813bcc544950968aef2
This commit is contained in:
drh 2002-07-18 11:01:47 +00:00
parent bd44700073
commit 199e3cf1b6
3 changed files with 17 additions and 17 deletions

View File

@ -1,5 +1,5 @@
C Version\s2.6.0\sRelease\s1\s(CVS\s684)
D 2002-07-18T02:50:52
C Change\sthe\sname\sof\svariable\s"near"\sto\s"nearby"\ssince\sMSVC\smistakenly\sbelieaves\nthat\s"near"\sis\sa\skeyword.\s(CVS\s685)
D 2002-07-18T11:01:48
F Makefile.in 6291a33b87d2a395aafd7646ee1ed562c6f2c28c
F Makefile.template 4e11752e0b5c7a043ca50af4296ec562857ba495
F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0
@ -18,7 +18,7 @@ F publish.sh fda6422258846d26a56270174162379fa1e3ca8d
F spec.template 238f7db425a78dc1bb7682e56e3834c7270a3f5e
F sqlite.1 83f4a9d37bdf2b7ef079a82d54eaf2e3509ee6ea
F src/TODO af7f3cab0228e34149cf98e073aa83d45878e7e6
F src/btree.c db8cd1bd46cd30a1763c3cc80602571d1b30a329
F src/btree.c f014b682e184876aba5df14a68f96594e0b7ae00
F src/btree.h 8abeabfe6e0b1a990b64fa457592a6482f6674f3
F src/build.c 2f81c837284840448f21c90ef7c9c6c6c0d4d8a0
F src/delete.c bc35d6aa7e7b2a4f88510a17e060abb355a53bd6
@ -142,7 +142,7 @@ F www/speed.tcl da8afcc1d3ccc5696cfb388a68982bc3d9f7f00f
F www/sqlite.tcl ae3dcfb077e53833b59d4fcc94d8a12c50a44098
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
P f2d9191381e956900a14bd80e50678b9d49e19e5
R b4dca914d3bc15b016390e11b1848c08
P dde65e9e060b9154e848d53d15272a0dcc7c2723
R f35c505519ae809b4af4159e98b97973
U drh
Z a3e72f3606c0149b7860dda7efb12d13
Z 42051f6c51d45784ab46293850436a20

View File

@ -1 +1 @@
dde65e9e060b9154e848d53d15272a0dcc7c2723
9761a2a0fbfd3e98f719a813bcc544950968aef2

View File

@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.67 2002/07/08 10:59:51 drh Exp $
** $Id: btree.c,v 1.68 2002/07/18 11:01:48 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to
@ -1510,12 +1510,12 @@ int sqliteBtreeNext(BtCursor *pCur, int *pRes){
** an error. *ppPage and *pPgno are undefined in the event of an error.
** Do not invoke sqlitepager_unref() on *ppPage if an error is returned.
**
** If the "near" parameter is not 0, then a (feeble) effort is made to
** locate a page close to the page number "near". This can be used in an
** If the "nearby" parameter is not 0, then a (feeble) effort is made to
** locate a page close to the page number "nearby". This can be used in an
** attempt to keep related pages close to each other in the database file,
** which in turn can make database access faster.
*/
static int allocatePage(Btree *pBt, MemPage **ppPage, Pgno *pPgno, Pgno near){
static int allocatePage(Btree *pBt, MemPage **ppPage, Pgno *pPgno, Pgno nearby){
PageOne *pPage1 = pBt->page1;
int rc;
if( pPage1->freeList ){
@ -1539,13 +1539,13 @@ static int allocatePage(Btree *pBt, MemPage **ppPage, Pgno *pPgno, Pgno near){
*ppPage = (MemPage*)pOvfl;
}else{
int closest;
if( pInfo->nFree>1 && near>0 ){
if( pInfo->nFree>1 && nearby>0 ){
int i, dist;
closest = 0;
dist = pInfo->aFree[0] - near;
dist = pInfo->aFree[0] - nearby;
if( dist<0 ) dist = -dist;
for(i=1; i<pInfo->nFree; i++){
int d2 = pInfo->aFree[i] - near;
int d2 = pInfo->aFree[i] - nearby;
if( d2<0 ) d2 = -d2;
if( d2<dist ) closest = i;
}
@ -1680,7 +1680,7 @@ static int fillInCell(
int nPayload;
const char *pPayload;
char *pSpace;
Pgno near = 0;
Pgno nearby = 0;
pCell->h.leftChild = 0;
pCell->h.nKey = nKey & 0xffff;
@ -1698,11 +1698,11 @@ static int fillInCell(
pPrior = 0;
while( nPayload>0 ){
if( spaceLeft==0 ){
rc = allocatePage(pBt, (MemPage**)&pOvfl, pNext, near);
rc = allocatePage(pBt, (MemPage**)&pOvfl, pNext, nearby);
if( rc ){
*pNext = 0;
}else{
near = *pNext;
nearby = *pNext;
}
if( pPrior ) sqlitepager_unref(pPrior);
if( rc ){