diff options
author | pkasting <pkasting@chromium.org> | 2015-07-21 15:28:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-21 22:29:02 +0000 |
commit | b0bf37632646237f4005203cf08e76e3b94e545c (patch) | |
tree | 1c679c15dcf2676c12a4ac1a74bdf0721948d382 | |
parent | 7d9390443d5da1f4a38f4f61f3d901421d4c7937 (diff) | |
download | chromium_src-b0bf37632646237f4005203cf08e76e3b94e545c.zip chromium_src-b0bf37632646237f4005203cf08e76e3b94e545c.tar.gz chromium_src-b0bf37632646237f4005203cf08e76e3b94e545c.tar.bz2 |
Fix MSVC warning C4018 for sqlite.
This is a warning about signed vs. unsigned values in a comparison. The code in
question was added entirely by a previous patch, so this simply modifies that
patch, and the results of applying it.
Adding an "(unsigned)" C-style cast is a somewhat ugly fix to one location, but
the alternative would be a potentially-vast change to the APIs in question to
change int to unsigned throughout the transitive closure of places that touch
this. I didn't seriously investigate doing this.
BUG=398202
TEST=none
Review URL: https://codereview.chromium.org/1248763003
Cr-Commit-Position: refs/heads/master@{#339765}
3 files changed, 18 insertions, 18 deletions
diff --git a/third_party/sqlite/amalgamation/sqlite3.c b/third_party/sqlite/amalgamation/sqlite3.c index 82dc780..c6747fd 100644 --- a/third_party/sqlite/amalgamation/sqlite3.c +++ b/third_party/sqlite/amalgamation/sqlite3.c @@ -130692,7 +130692,7 @@ static int recoverColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){ FNENTRY(); - if( i>=pRecover->nCols ){ + if( (unsigned)i>=pRecover->nCols ){ return SQLITE_ERROR; } @@ -130999,11 +130999,11 @@ static int recoverInit( sqlite3_vtab **ppVtab, /* OUT: New virtual table */ char **pzErr /* OUT: Error message, if any */ ){ - const unsigned kTypeCol = 4; /* First argument with column type info. */ - Recover *pRecover; /* Virtual table structure being created. */ - char *zDot; /* Any dot found in "db.table" backing. */ - u32 iRootPage; /* Root page of backing table. */ - char *zCreateSql; /* Schema of created virtual table. */ + const int kTypeCol = 4; /* First argument with column type info. */ + Recover *pRecover; /* Virtual table structure being created. */ + char *zDot; /* Any dot found in "db.table" backing. */ + u32 iRootPage; /* Root page of backing table. */ + char *zCreateSql; /* Schema of created virtual table. */ int rc; /* Require to be in the temp database. */ diff --git a/third_party/sqlite/patches/0006-Virtual-table-supporting-recovery-of-corrupted-datab.patch b/third_party/sqlite/patches/0006-Virtual-table-supporting-recovery-of-corrupted-datab.patch index 24fcbcf..eb1cffa 100644 --- a/third_party/sqlite/patches/0006-Virtual-table-supporting-recovery-of-corrupted-datab.patch +++ b/third_party/sqlite/patches/0006-Virtual-table-supporting-recovery-of-corrupted-datab.patch @@ -1891,7 +1891,7 @@ index 0000000..c996d53 + + FNENTRY(); + -+ if( i>=pRecover->nCols ){ ++ if( (unsigned)i>=pRecover->nCols ){ + return SQLITE_ERROR; + } + @@ -2198,11 +2198,11 @@ index 0000000..c996d53 + sqlite3_vtab **ppVtab, /* OUT: New virtual table */ + char **pzErr /* OUT: Error message, if any */ +){ -+ const unsigned kTypeCol = 4; /* First argument with column type info. */ -+ Recover *pRecover; /* Virtual table structure being created. */ -+ char *zDot; /* Any dot found in "db.table" backing. */ -+ u32 iRootPage; /* Root page of backing table. */ -+ char *zCreateSql; /* Schema of created virtual table. */ ++ const int kTypeCol = 4; /* First argument with column type info. */ ++ Recover *pRecover; /* Virtual table structure being created. */ ++ char *zDot; /* Any dot found in "db.table" backing. */ ++ u32 iRootPage; /* Root page of backing table. */ ++ char *zCreateSql; /* Schema of created virtual table. */ + int rc; + + /* Require to be in the temp database. */ diff --git a/third_party/sqlite/src/src/recover.c b/third_party/sqlite/src/src/recover.c index c996d53..c91c88d 100644 --- a/third_party/sqlite/src/src/recover.c +++ b/third_party/sqlite/src/src/recover.c @@ -1775,7 +1775,7 @@ static int recoverColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){ FNENTRY(); - if( i>=pRecover->nCols ){ + if( (unsigned)i>=pRecover->nCols ){ return SQLITE_ERROR; } @@ -2082,11 +2082,11 @@ static int recoverInit( sqlite3_vtab **ppVtab, /* OUT: New virtual table */ char **pzErr /* OUT: Error message, if any */ ){ - const unsigned kTypeCol = 4; /* First argument with column type info. */ - Recover *pRecover; /* Virtual table structure being created. */ - char *zDot; /* Any dot found in "db.table" backing. */ - u32 iRootPage; /* Root page of backing table. */ - char *zCreateSql; /* Schema of created virtual table. */ + const int kTypeCol = 4; /* First argument with column type info. */ + Recover *pRecover; /* Virtual table structure being created. */ + char *zDot; /* Any dot found in "db.table" backing. */ + u32 iRootPage; /* Root page of backing table. */ + char *zCreateSql; /* Schema of created virtual table. */ int rc; /* Require to be in the temp database. */ |