diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2017-02-13 10:02:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-13 10:02:37 -0500 |
commit | 2258dac42020b486b78947d434fde72c236d1e48 (patch) | |
tree | 1c9ca7af7141d0a3c1d05ee6f9bf7d431d43366e /test | |
parent | a8fe04026ef55b8f59df24ff75ae151c7c370e2a (diff) | |
download | mongo-2258dac42020b486b78947d434fde72c236d1e48.tar.gz |
WT-3174 Coverity/lint cleanup (#3293)
* WT-3174 Coverity/lint cleanup
clang38 complaints:
wt3135_search_near_collator/main.c:75:22: error: implicit conversion loses
integer precision: 'int64_t' (aka 'long') to 'int'
[-Werror,-Wshorten-64-to-32]
*cmp = compare_int(pkey1, pkey2);
~~~~~~~~~~~ ^~~~~
wt3135_search_near_collator/main.c:75:29: error: implicit conversion loses
integer precision: 'int64_t' (aka 'long') to 'int'
[-Werror,-Wshorten-64-to-32]
*cmp = compare_int(pkey1, pkey2);
~~~~~~~~~~~ ^~~~~
* Coverity complains in __split_root():
dead_error_condition: The switch value complete cannot be WT_ERR_PANIC.
CID 1371132 (#1 of 1): Logically dead code (DEADCODE)
dead_error_begin: Execution cannot reach this statement: case WT_ERR_PANIC:.
Revert a minor part of 7f5d0f9, don't switch to benign error mode
(setting WT_ERR_IGNORE) until after the split has been verified in
DIAGNOSTIC mode. That makes sense and should make Coverity happy.
* Fix type-casting, sizeof()/sizeof() is a size_t.
Diffstat (limited to 'test')
-rw-r--r-- | test/csuite/wt3135_search_near_collator/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/csuite/wt3135_search_near_collator/main.c b/test/csuite/wt3135_search_near_collator/main.c index 3113d29dfa9..8783034a7d8 100644 --- a/test/csuite/wt3135_search_near_collator/main.c +++ b/test/csuite/wt3135_search_near_collator/main.c @@ -57,7 +57,7 @@ item_str_equal(WT_ITEM *item, const char *str) } static int -compare_int(int a, int b) +compare_int(int64_t a, int64_t b) { return (a < b ? -1 : (a > b ? 1 : 0)); } @@ -329,7 +329,7 @@ main(int argc, char *argv[]) { TEST_OPTS *opts, _opts; WT_SESSION *session; - int32_t i; + size_t i; opts = &_opts; memset(opts, 0, sizeof(*opts)); @@ -349,8 +349,8 @@ main(int argc, char *argv[]) testutil_check(opts->conn->add_extractor(opts->conn, "extractor_u", &extractor_u, NULL)); - for (i = 0; i < (int32_t)TEST_SET_COUNT; i++) { - printf("test set %d\n", i); + for (i = 0; i < TEST_SET_COUNT; i++) { + printf("test set %" WT_SIZET_FMT "\n", i); test_one_set(session, test_sets[i]); } |