Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Explicit casts to squelch bogus warnings for vc++. Ticket #194. (CVS 932) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
cb808c14bc14e7bd1cfff134ae5206ac |
User & Date: | drh 2003-04-25 03:13:25.000 |
Context
2003-04-25
| ||
13:22 | Make VACUUM work even if multiple processes have the database open at once. (CVS 933) (check-in: caa960289f user: drh tags: trunk) | |
03:13 | Explicit casts to squelch bogus warnings for vc++. Ticket #194. (CVS 932) (check-in: cb808c14bc user: drh tags: trunk) | |
02:43 | Get VACUUM working again - with test cases. Some other minor cleanups. (CVS 931) (check-in: 5afb88008f user: drh tags: trunk) | |
Changes
Changes to src/btree.c.
1 2 3 4 5 6 7 8 9 10 11 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** $Id: btree.c,v 1.90 2003/04/25 03:13:25 drh Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** For a detailed discussion of BTrees, refer to ** ** Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3: ** "Sorting And Searching", pages 473-480. Addison-Wesley ** Publishing Company, Reading, Massachusetts. |
︙ | ︙ | |||
61 62 63 64 65 66 67 | /* ** Macros used for byteswapping. B is a pointer to the Btree ** structure. This is needed to access the Btree.needSwab boolean ** in order to tell if byte swapping is needed or not. ** X is an unsigned integer. SWAB16 byte swaps a 16-bit integer. ** SWAB32 byteswaps a 32-bit integer. */ | | | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | /* ** Macros used for byteswapping. B is a pointer to the Btree ** structure. This is needed to access the Btree.needSwab boolean ** in order to tell if byte swapping is needed or not. ** X is an unsigned integer. SWAB16 byte swaps a 16-bit integer. ** SWAB32 byteswaps a 32-bit integer. */ #define SWAB16(B,X) ((B)->needSwab? swab16((u16)X) : ((u16)X)) #define SWAB32(B,X) ((B)->needSwab? swab32(X) : (X)) #define SWAB_ADD(B,X,A) \ if((B)->needSwab){ X=swab32(swab32(X)+A); }else{ X += (A); } /* ** The following global variable - available only if SQLITE_TEST is ** defined - is used to determine whether new databases are created in |
︙ | ︙ | |||
532 533 534 535 536 537 538 | pFBlk = (FreeBlk*)&pPage->u.aDisk[idx]; iSize = SWAB16(pBt, pFBlk->iSize); if( idx + iSize == start ){ pFBlk->iSize = SWAB16(pBt, iSize + size); if( idx + iSize + size == SWAB16(pBt, pFBlk->iNext) ){ pNext = (FreeBlk*)&pPage->u.aDisk[idx + iSize + size]; if( pBt->needSwab ){ | | | 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | pFBlk = (FreeBlk*)&pPage->u.aDisk[idx]; iSize = SWAB16(pBt, pFBlk->iSize); if( idx + iSize == start ){ pFBlk->iSize = SWAB16(pBt, iSize + size); if( idx + iSize + size == SWAB16(pBt, pFBlk->iNext) ){ pNext = (FreeBlk*)&pPage->u.aDisk[idx + iSize + size]; if( pBt->needSwab ){ pFBlk->iSize = swab16((u16)swab16(pNext->iSize)+iSize+size); }else{ pFBlk->iSize += pNext->iSize; } pFBlk->iNext = pNext->iNext; } pPage->nFree += size; return; |
︙ | ︙ |