Hello Richard !  

I just saw this commit https://www.sqlite.org/src/info/6a4cfc7ab62046eb and
noticed you've been using magic numbers would it be better to use a macro
instead ?  

I think for other people (and maybe yourself) would be easier to see
something like "INFO_SIZE_ADJUST" (or any meaningful name) instead of "4".  

This also happen on other places, although I understand that is hard to
maintain consistency (there is several places where sqlite3 do use macros
instead of magic numbers).  

Cheers !  
in src/btree.c

1054 pInfo->nSize = (u16)(&pInfo->pPayload[pInfo->nLocal] - pCell) + 4;
1079 assert( pPage->childPtrSize==4 );
1083 pInfo->nSize = 4 + getVarint(&pCell[4], (u64*)&pInfo->nKey);
1153 if( pInfo->nSize<4 ) pInfo->nSize = 4;
1191 if( pInfo->nSize<4 ) pInfo->nSize = 4;
1309 Pgno ovfl = get4byte(&pCell[info.nSize-4]);
3349 && iFrom==get4byte(pCell+info.nSize-4)
5999 ovflPgno = get4byte(pCell + info.nSize - 4);
6000 assert( pBt->usableSize > 4 );
6001 ovflPageSize = pBt->usableSize - 4;
6858 Pgno ovfl = get4byte(&z[info.nSize-4]);
9164 assert( pc + info.nSize - 4 <= usableSize );
9166 pgnoOvfl = get4byte(&pCell[info.nSize - 4]);

Reply via email to