rocksdb/tools
Igor Sugak 62f7a1be4f rocksdb: Fixed 'Dead assignment' and 'Dead initialization' scan-build warnings
Summary:
This diff contains trivial fixes for 6 scan-build warnings:

**db/c_test.c**
`db` variable is never read. Removed assignment.
scan-build report:
http://home.fburl.com/~sugak/latest20/report-9b77d2.html#EndPath

**db/db_iter.cc**
`skipping` local variable is assigned to false. Then in the next switch block the only "non return" case assign `skipping` to true, the rest cases don't use it and all do return.
scan-build report:
http://home.fburl.com/~sugak/latest20/report-13fca7.html#EndPath

**db/log_reader.cc**
In `bool Reader::SkipToInitialBlock()` `offset_in_block` local variable is assigned to 0 `if (offset_in_block > kBlockSize - 6)` and then never used. Removed the assignment and renamed it to `initial_offset_in_block` to avoid confusion.
scan-build report:
http://home.fburl.com/~sugak/latest20/report-a618dd.html#EndPath

In `bool Reader::ReadRecord(Slice* record, std::string* scratch)` local variable `in_fragmented_record` in switch case `kFullType` block is assigned to false and then does `return` without use. In the other switch case `kFirstType` block the same `in_fragmented_record` is assigned to false, but later assigned to true without prior use. Removed assignment for both cases.
scan-build reprots:
http://home.fburl.com/~sugak/latest20/report-bb86b0.html#EndPath
http://home.fburl.com/~sugak/latest20/report-a975be.html#EndPath

**table/plain_table_key_coding.cc**
Local variable `user_key_size` is assigned when declared. But then in both places where it is used assigned to `static_cast<uint32_t>(key.size() - 8)`. Changed to initialize the variable to the proper value in declaration.
scan-build report:
http://home.fburl.com/~sugak/latest20/report-9e6b86.html#EndPath

**tools/db_stress.cc**
Missing `break` in switch case block. This seems to be a bug. Added missing `break`.

Test Plan:
Make sure all tests are passing and scan-build does not report 'Dead assignment' and 'Dead initialization' bugs.
```lang=bash
% make check
% make analyze
```

Reviewers: meyering, igor, kradhakrishnan, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D33795
2015-02-23 14:10:09 -08:00
..
rdb first rdb commit 2014-11-20 23:33:00 -05:00
auto_sanity_test.sh
benchmark.sh benchmark.sh won't run through all tests properly if one specifies wal_dir to be different than db directory. 2015-01-05 15:36:47 -08:00
db_crashtest.py
db_crashtest2.py
db_repl_stress.cc Make db_stress built for ROCKSDB_LITE 2014-11-14 10:20:51 -08:00
db_sanity_test.cc New BlockBasedTable version -- better compressed block format 2015-01-14 16:24:24 -08:00
db_stress.cc rocksdb: Fixed 'Dead assignment' and 'Dead initialization' scan-build warnings 2015-02-23 14:10:09 -08:00
dbench_monitor Added simple monitoring script to monitor overusage of memory in db_bench 2015-02-11 18:40:11 -08:00
ldb.cc Make db_stress built for ROCKSDB_LITE 2014-11-14 10:20:51 -08:00
ldb_test.py Added 'dump_live_files' command to ldb tool. 2014-12-12 17:50:36 -08:00
pflag Added simple monitoring script to monitor overusage of memory in db_bench 2015-02-11 18:40:11 -08:00
reduce_levels_test.cc
run_flash_bench.sh add range scan test to benchmark script 2014-12-10 13:04:58 -08:00
sst_dump.cc Make db_stress built for ROCKSDB_LITE 2014-11-14 10:20:51 -08:00