Merge pull request #273 from nbougalis/static-analysis

Cleanups from static analysis
main
Igor Canadi 10 years ago
commit db8ca520b2
  1. 3
      include/rocksdb/cache.h
  2. 2
      port/stack_trace.cc
  3. 2
      util/hash_cuckoo_rep.cc
  4. 1
      util/ldb_cmd.cc
  5. 1
      utilities/spatialdb/spatial_db.cc

@ -127,9 +127,6 @@ class Cache {
void LRU_Append(Handle* e); void LRU_Append(Handle* e);
void Unref(Handle* e); void Unref(Handle* e);
struct Rep;
Rep* rep_;
// No copying allowed // No copying allowed
Cache(const Cache&); Cache(const Cache&);
void operator=(const Cache&); void operator=(const Cache&);

@ -33,7 +33,7 @@ const char* GetExecutableName() {
char link[1024]; char link[1024];
snprintf(link, sizeof(link), "/proc/%d/exe", getpid()); snprintf(link, sizeof(link), "/proc/%d/exe", getpid());
auto read = readlink(link, name, sizeof(name)); auto read = readlink(link, name, sizeof(name) - 1);
if (-1 == read) { if (-1 == read) {
return nullptr; return nullptr;
} else { } else {

@ -70,7 +70,7 @@ class HashCuckooRep : public MemTableRep {
} }
cuckoo_path_ = reinterpret_cast<int*>( cuckoo_path_ = reinterpret_cast<int*>(
arena_->Allocate(sizeof(int*) * (cuckoo_path_max_depth_ + 1))); arena_->Allocate(sizeof(int) * (cuckoo_path_max_depth_ + 1)));
is_nearly_full_ = false; is_nearly_full_ = false;
} }

@ -541,6 +541,7 @@ void ManifestDumpCommand::DoCommand() {
} else { } else {
exec_state_ = LDBCommandExecuteResult::FAILED( exec_state_ = LDBCommandExecuteResult::FAILED(
"Multiple MANIFEST files found; use --path to select one"); "Multiple MANIFEST files found; use --path to select one");
closedir(d);
return; return;
} }
} }

@ -221,6 +221,7 @@ std::string FeatureSet::DebugString() const {
switch (iter.second.type()) { switch (iter.second.type()) {
case Variant::kNull: case Variant::kNull:
out.append("null"); out.append("null");
break;
case Variant::kBool: case Variant::kBool:
if (iter.second.get_bool()) { if (iter.second.get_bool()) {
out.append("true"); out.append("true");

Loading…
Cancel
Save