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

Unified Diff: src/src/recover.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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « amalgamation/sqlite3.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/src/recover.c
===================================================================
--- src/src/recover.c (revision 291977)
+++ src/src/recover.c (working copy)
@@ -643,6 +643,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 ){
@@ -669,8 +671,7 @@
* byte is corrupted. Could be an overflow page, but it would require
* a very large database.
*/
- 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 | « amalgamation/sqlite3.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698