Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
fix of issues from klocwork and coverity
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDorniak99 committed Sep 2, 2020
1 parent 34fab23 commit 339aac8
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/segment_vector/segment_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ main(int argc, char *argv[])
try {
pop = pool<root>::open(path, "segment_vector_example");
r = pop.root();
} catch (const pmem::pool_error &e) {
} catch (const std::exception &e) {
std::cerr << "Exception: " << e.what() << std::endl;
return 1;
}
Expand Down
5 changes: 5 additions & 0 deletions include/libpmemobj++/container/concurrent_hash_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,11 @@ class concurrent_hash_map
acquire(base, h, writer);
}

bucket_accessor(const bucket_accessor &other) = delete;

bucket_accessor &
operator=(const bucket_accessor &other) = delete;

/**
* Find a bucket by masked hashcode, optionally rehash, and
* acquire the lock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,13 @@ class skip_list_iterator {
return tmp;
}

skip_list_iterator &
operator=(const skip_list_iterator &other)
{
node = other.node;
return *this;
}

private:
explicit skip_list_iterator(node_type *n) : node(n)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test(int argc, char *argv[])
parallel_exec(concurrency, [&](size_t thread_index) {
r->pptr1->local() = thread_index;
pop.persist(&r->pptr1->local(),
sizeof(&r->pptr1->local()));
sizeof(r->pptr1->local()));
});

nvobj::transaction::run(pop, [&] {
Expand Down
2 changes: 2 additions & 0 deletions tests/inline_string/inline_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ struct Object {

Object(const Object &o) = default;

Object &operator=(const Object &o) = default;

nvobj::p<int> data;
nvobj::experimental::inline_string s;
};
Expand Down
2 changes: 2 additions & 0 deletions tests/pair/pair.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ struct A {
c = rhs.c;
}

A &operator=(const A &) = default;

int a;
int b;
int c;
Expand Down
2 changes: 1 addition & 1 deletion tests/ptr_arith/ptr_arith.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ test_arith(nvobj::pool_base &pop)
for (int i = TEST_ARR_SIZE; i > 0; --i)
UT_ASSERTeq(*(parr_end - i), TEST_ARR_SIZE - i);

UT_OUT("%d", parr_end - parr_vsize);
UT_OUT("%ld", parr_end - parr_vsize);
UT_ASSERTeq(parr_end - parr_vsize, TEST_ARR_SIZE);

/* check ostream operator */
Expand Down
2 changes: 2 additions & 0 deletions tests/volatile_state/volatile_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ struct v_data1 {

v_data1(const v_data1 &rhs) = delete;

v_data1 &operator=(const v_data1 &rhs) = delete;

~v_data1()
{
volatile_object_state = volatile_object_state_type::destroyed;
Expand Down

0 comments on commit 339aac8

Please sign in to comment.