Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2850)

Unified Diff: amalgamation/sqlite3.c

Issue 552673003: SQLite's recover.c should be valid C code (Closed) Base URL: https://src.chromium.org/svn/trunk/src/third_party/sqlite/
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « no previous file | src/src/recover.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: amalgamation/sqlite3.c
===================================================================
--- amalgamation/sqlite3.c (revision 291977)
+++ amalgamation/sqlite3.c (working copy)
@@ -110889,6 +110889,8 @@
/* Internal helper. Reset storage in preparation for iterating pPage. */
static void interiorCursorSetPage(RecoverInteriorCursor *pCursor,
DbPage *pPage){
+ const unsigned knMinCellLength = 2 + 4 + 1;
+ unsigned nMaxChildren;
assert( PageHeader(pPage)[kiPageTypeOffset]==kTableInteriorPage );
if( pCursor->pPage ){
@@ -110909,8 +110911,7 @@
* each child contains a 32-bit page number and at least a varint (min size of
* one byte). The final child page is in the header.
*/
- const unsigned knMinCellLength = 2 + 4 + 1;
- unsigned nMaxChildren =
+ nMaxChildren =
(pCursor->nPageSize - kiPageInteriorHeaderBytes) / knMinCellLength + 1;
if (pCursor->nChildren > nMaxChildren) {
pCursor->nChildren = nMaxChildren;
« no previous file with comments | « no previous file | src/src/recover.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698