diff --git a/containers_cpp/include/embb/containers/internal/lock_free_stack-inl.h b/containers_cpp/include/embb/containers/internal/lock_free_stack-inl.h index 5aa032a..572aa32 100644 --- a/containers_cpp/include/embb/containers/internal/lock_free_stack-inl.h +++ b/containers_cpp/include/embb/containers/internal/lock_free_stack-inl.h @@ -46,8 +46,8 @@ namespace internal { } template< typename T > - void LockFreeStackNode< T >::SetNext(LockFreeStackNode< T >* next) { - this->next = next; + void LockFreeStackNode< T >::SetNext(LockFreeStackNode< T >* next_to_set) { + this->next = next_to_set; } template< typename T > diff --git a/containers_cpp/test/hazard_pointer_test.cc b/containers_cpp/test/hazard_pointer_test.cc index 71f1d2e..7913b92 100644 --- a/containers_cpp/test/hazard_pointer_test.cc +++ b/containers_cpp/test/hazard_pointer_test.cc @@ -169,7 +169,7 @@ void HazardPointerTest::HazardPointerTest1ThreadMethod() { same = true; break; } - bool success = stack_->TryPush(allocated_object_from_different_thread); + success = stack_->TryPush(allocated_object_from_different_thread); PT_ASSERT(success == true); } PT_ASSERT(success_pop == true); diff --git a/containers_cpp/test/pool_test-inl.h b/containers_cpp/test/pool_test-inl.h index 2c74935..70efb60 100644 --- a/containers_cpp/test/pool_test-inl.h +++ b/containers_cpp/test/pool_test-inl.h @@ -165,7 +165,6 @@ void PoolTest::PoolTestStatic() { //if we allocate again, we should get those elements for (int i = 0; i != static_cast(indexes_to_free.size()); i++) { - int element, index; index = ap.Allocate(element); PT_EXPECT((index != -1)); diff --git a/doc/examples/containers/queues-snippet.h b/doc/examples/containers/queues-snippet.h index 951f5c3..4e3a24b 100644 --- a/doc/examples/containers/queues-snippet.h +++ b/doc/examples/containers/queues-snippet.h @@ -4,12 +4,12 @@ int i, j; bool result = queue.TryDequeue(i); //@\label{lst:queue_lst1:fail_pop}@ assert(result == false); -for (int i = 0; i <= 4; ++i) { //@\label{lst:queue_lst1:loop1}@ +for (i = 0; i <= 4; ++i) { //@\label{lst:queue_lst1:loop1}@ result = queue.TryEnqueue(i); //@\label{lst:queue_lst1:push}@ assert(result == true); } -for (int i = 0; i <= 4; ++i) { //@\label{lst:queue_lst1:loop2}@ +for (i = 0; i <= 4; ++i) { //@\label{lst:queue_lst1:loop2}@ result = queue.TryDequeue(j); //@\label{lst:queue_lst1:pop}@ assert(result == true && i == j); //@\label{lst:queue_lst1:assert}@ } \ No newline at end of file diff --git a/doc/examples/containers/stack-snippet.h b/doc/examples/containers/stack-snippet.h index dce744f..057ebe5 100644 --- a/doc/examples/containers/stack-snippet.h +++ b/doc/examples/containers/stack-snippet.h @@ -4,12 +4,12 @@ int i, j; bool result = stack.TryPop(i); //@\label{lst:stack_lst1:fail_pop}@ assert(result == false); -for (int i = 0; i <= 4; ++i) {//@\label{lst:stack_lst1:loop1}@ +for (i = 0; i <= 4; ++i) {//@\label{lst:stack_lst1:loop1}@ result = stack.TryPush(i); //@\label{lst:stack_lst1:push}@ assert(result == true); } -for (int i = 4; i >= 0; --i) { //@\label{lst:stack_lst1:loop2}@ +for (i = 4; i >= 0; --i) { //@\label{lst:stack_lst1:loop2}@ result = stack.TryPop(j); //@\label{lst:stack_lst1:pop}@ assert(result == true && i == j); //@\label{lst:stack_lst1:assert}@ } \ No newline at end of file diff --git a/mtapi_c/test/embb_mtapi_test_task.cc b/mtapi_c/test/embb_mtapi_test_task.cc index 8d04992..9393ec5 100644 --- a/mtapi_c/test/embb_mtapi_test_task.cc +++ b/mtapi_c/test/embb_mtapi_test_task.cc @@ -107,7 +107,7 @@ void TaskTest::TestBasic() { mtapi_action_hndl_t action; mtapi_job_hndl_t job; mtapi_task_hndl_t task[100]; - int ii; + mtapi_uint_t ii; embb_mtapi_log_info("running testTask...\n"); @@ -169,9 +169,9 @@ void TaskTest::TestBasic() { job = mtapi_job_get(JOB_TEST_TASK, THIS_DOMAIN_ID, &status); MTAPI_CHECK_STATUS(status); - for (ii = 0; ii < 100; ii++) { + for (ii = 0; ii < 100u; ii++) { status = MTAPI_ERR_UNKNOWN; - int arg = ii; + mtapi_uint_t arg = ii; task[ii] = mtapi_task_start( TASK_TEST_ID, job, @@ -187,7 +187,7 @@ void TaskTest::TestBasic() { testDoSomethingElse(); - for (ii = 0; ii < 100; ii++) { + for (ii = 0; ii < 100u; ii++) { status = MTAPI_ERR_UNKNOWN; mtapi_task_wait(task[ii], 100000, &status); MTAPI_CHECK_STATUS(status); @@ -227,7 +227,7 @@ void TaskTest::TestBasic() { MTAPI_CHECK_STATUS(status); mtapi_uint_t result[kTaskInstances]; - for (mtapi_uint_t ii = 0; ii < kTaskInstances; ii++) { + for (ii = 0; ii < kTaskInstances; ii++) { result[ii] = kTaskInstances + 1; } @@ -245,7 +245,7 @@ void TaskTest::TestBasic() { mtapi_task_wait(multiinstance_task, MTAPI_INFINITE, &status); MTAPI_CHECK_STATUS(status); - for (mtapi_uint_t ii = 0; ii < kTaskInstances; ii++) { + for (ii = 0; ii < kTaskInstances; ii++) { PT_EXPECT_EQ(result[ii], ii); }